Re: [PATCH v4] fast-(import|export): improve on commit signature output format
- From
Christian Couder <christian.couder@gmail.com>
- Date
- Jul 8, 2025, 09:16 UTC
- Message-ID
- <CAP8UFD0aXSvepjvwHu_dDcoEn5j6p=HxSEMgftotiZg3B1Hzmw@mail.gmail.com>
- In-Reply-To
- <xmqqbjqjdbmj.fsf@gitster.g>
On Thu, Jun 19, 2025 at 4:55 PM Junio C Hamano <gitster@pobox.com> wrote:
Show 14 quoted lines
> > Christian Couder <christian.couder@gmail.com> writes: > > > This v4 is just about fixing a few bugs in the tests using the SHA-256 > > object format compared to the v3. (I had issues with CI tests on v3, > > so I sent it without waiting for the results.) > > Thanks. > > I am not sure if "I am happy is either 1 or 256" is what you really > want, though. The test presumably knows what algorithm is being > used during its run, so wouldn't you want to say more like "I know I > used sha256, and I expect seeing sha256, ah, I see sha256 and even > better I see no sha1, so I am very happy"?
Yeah, I agree it's better to have tests say things like "I know I used sha256, and I expect to see sha256". So in v5 tests now use:
test_grep -E "^gpgsig $GIT_DEFAULT_HASH x509" output
as "$GIT_DEFAULT_HASH" should be either "sha1" or "sha256" depending on the current hash.
I am not sure "and even better I see no sha1" is worth it then though, so I haven't added that.
Show 7 quoted lines
> > There are no tests in this v4 and in v3 with both a SHA-1 and a > > SHA-256 signature on the same commit though, as I am not sure yet how > > to best generate a commit with such signatures. Suggestions welcome! > > Good point to fill potential gaps. If we had such a commit, then > would these tests say "I know I want both 1 and 256, and I do see > one instance each of 1 and 256, so I am happy"?
There is a test with such a commit in the v5 I am about to send and yeah it checks that there is one instance of 1 and 256.