Web lists-archives.com

Re: [PATCH 06/28] t0000: annotate with SHA1 prerequisite

On Tue, May 08, 2018 at 08:28:47PM +0200, Martin Ågren wrote:
> On 8 May 2018 at 01:40, brian m. carlson <sandals@xxxxxxxxxxxxxxxxxxxx> wrote:
> > As I mentioned in an earlier email, I plan to set an environment
> > variable for the algorithms in use and then do something like:
> >
> >   test "$tree" = "$(test-tool hash-helper --output known-tree)"
> >
> > where "known-tree" is some key we can use to look up the SHA-1 or
> > NewHash value, and we've specified we want the output format (as opposed
> > to input format or on-disk format).
> My first thought was, can't we introduce such a helper already now? It
> would not check with the environment, but would always output SHA-1
> values. Thinking about it some more, maybe the exact usage/interface
> would be a bit volatile in the beginning, making it just as good an idea
> to gain some more experience and feeling first.

I think your second thought is spot on.  As we move on in this work, it
will become more obvious what functionality we need.

As a note, the benefit of using the prerequisite is in development work.
It's useful to know that all but a certain set of tests pass in the
codebase, because that gives me confidence that Git as a whole is mostly
functional as a result of my refactors.

Because I'm using a hash that may not be the final NewHash, it doesn't
make sense for me to compute translation tables.  Even if I did go
through that work, I couldn't submit it upstream, because nobody is
interested in carrying code for brian's development hash.  A helper that
output SHA-1 wouldn't be useful to me, because the tests would still
fail, and I wouldn't know what was failing because it was broken and
what just depended on SHA-1.

So part of the idea with the prerequisite is to provide code that can be
included in the main project and provides benefit to those that are
doing future development work.  The test helper approach becomes more
viable once we're clearer about what variations we need from the helper
and what hash we're actually using.
brian m. carlson: Houston, Texas, US
OpenPGP: https://keybase.io/bk2204

Attachment: signature.asc
Description: PGP signature