Re: [PATCH] t6423: fix suppression of Git’s exit code in tests
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Feb 4, 2025, 13:08 UTC
- Message-ID
- <xmqqjza5x3go.fsf@gitster.g>
- In-Reply-To
- <20250204003815.61391-1-ayu.chandekar@gmail.com>
Ayush Chandekar <ayu.chandekar@gmail.com> writes:
> Do you see any other changes needed in this patch? Let me know if there's > anything you want me to adjust, especially in my commit message. Since my > previous attempt wasn't very suitable.
If I were to change something, there are two minor things, but they are so minor that I'd be OK without these changes.
If this is supposed to be a part of microproject exchange (sorry, I lost track), then I am also OK to do the second (and hopefully final) iteration to give us a chance to practice.
If I were you and I chose to iterate one more time, I'd rephrase this
This commit ensures that Git's exit status is correctly propogated by:
- Avoiding pipes that suppress exit codes.to more like
Instead of placing a git command on the upstream side of a pipe,
redirect its output to a file and process the file contents in
two separate steps to avoid losing the exit status.Also I'd not redirect into "uniq", i.e. instead of
uniq <actual >tracked &&
I'd write
uniq actual >tracked &&
but as discussed with Eric, this "better style" is not followed by existing code.