git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v2] t3310: avoid hiding failures from rev-parse in command substitutions

From
Eric Sunshine <sunshine@sunshineco.com>
Date
Mar 5, 2026, 22:34 UTC
Message-ID
<CAPig+cTsYWVg0nrU7kMakOKQaqFSo=i_nZ=_YuCJK_hq5gdZPQ@mail.gmail.com>
In-Reply-To
<xmqq5x7a3x9w.fsf@gitster.g>
On Thu, Mar 5, 2026 at 2:13 PM Junio C Hamano <gitster@pobox.com> wrote:
Show 17 quoted lines
> > Running `git` commands inside command substitutions like
> >
> >       test "$(git rev-parse A)" = "$(git rev-parse B)"
> >
> > can hide failures from the `git` invocations and provide little
> > diagnostic information when `test` fails.
> >
> > Use `test_cmp` when comparing against a stored expected value so
> > mismatches show both expected and actual output. Use `test_cmp_rev`
> > when comparing two revisions. These helpers produce clearer failure
> > output, making it easier to understand what went wrong.
> >
> > Suggested-by: Junio C Hamano <gitster@pobox.com>
>
> Hmph, did I suggest this?  I know Eric had comments on a previous
> round, and the improvements in this patch seems to be influenced a
> lot stronger by his input than whatever I may have said.

Indeed. The use of test_cmp and test_cmp_rev makes this version much more developer-friendly than v1. Nice.

Show 7 quoted lines
> >  t/t3310-notes-merge-manual-resolve.sh | 60 ++++++++++++---------------
> >  1 file changed, 27 insertions(+), 33 deletions(-)
> >
> > diff --git a/t/t3310-notes-merge-manual-resolve.sh b/t/t3310-notes-merge-manual-resolve.sh
> > index 92a5951331..64c0a753ff 100755
>
> On top of what commit is this patch designed to apply?

What Junio probably means is that you appear to have based v2 atop v1, but instead you should squash v1 and v2 into a single patch, and send that as v3 so that when the patch is finally accepted into his tree, it will appear to have been perfect from the start (because v1 and v2 will only exist in the mailing list archive, not in the Git project history).

Previous: Junio C HamanoNext: Francesco Paparatto
Message 5 of 15 in “t3310: avoid hiding failures from rev-parse in command substitutions”
  1. t3310: avoid hiding failures from rev-parse in command substitutionsFrancesco Paparatto, Mar 4, 2026
  2. Eric SunshineMar 4, 2026
  3. t3310: avoid hiding failures from rev-parse in command substitutionsFrancesco Paparatto, Mar 5, 2026
  4. Junio C HamanoMar 5, 2026
  5. Eric SunshineMar 5, 2026
  6. Francesco PaparattoMar 5, 2026
  7. Francesco PaparattoMar 5, 2026
  8. t3310: avoid hiding failures from rev-parse in command substitutionsFrancesco Paparatto, Mar 5, 2026
  9. Junio C HamanoMar 5, 2026
  10. Junio C HamanoMar 5, 2026
  11. Eric SunshineMar 7, 2026
  12. Francesco PaparattoMar 7, 2026
  13. t3310: avoid hiding failures from rev-parse in command substitutionsFrancesco Paparatto, Mar 7, 2026
  14. Eric SunshineMar 8, 2026
  15. Junio C HamanoMar 8, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.