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

Re: [PATCH v2] t9832,t2200: avoid using pipes in git commands

From
Amanda Shafack <shafack.likhene@gmail.com>
Date
Oct 18, 2020, 20:40 UTC
Message-ID
<CAGxm6oVtOuQjOEbPVtn_KOjE9nBmW=49jkdE-KRdAg-i0Quxsg@mail.gmail.com>
In-Reply-To
<CAPig+cR7Hm9m1EiWkr5tKYS3r_zJf98XT7OQ+-Jt4EWkaFQTDw@mail.gmail.com>
On Sun, Oct 18, 2020 at 8:25 PM Eric Sunshine <sunshine@sunshineco.com> wrote:
Show 19 quoted lines
>
> On Sun, Oct 18, 2020 at 10:42 AM Amanda Shafack via GitGitGadget
> <gitgitgadget@gmail.com> wrote:
> > t9832,t2200: avoid using pipes in git commands
>
> The subject is a bit confusing since pipes aren't used in Git
> commands; instead, Git commands may be components of pipes. However,
> even that is too imprecise. The issue this patch is addressing is that
> we want to avoid Git commands _upstream_ in a pipe. It's perfectly
> acceptable for the Git command to be the final element of a pipe since
> the pipe returns the exit code of the final command. So, to be more
> precise, the subject could say:
>
>     t2200,t9832: avoid using `git` upstream in a pipe
>
> Nit: It's subjective, but it feels a bit more natural to list the test
> numbers in ascending order rather than descending order, which is why
> I swapped them around in the example above.
>
I agree it looks more appropriate.
Show 18 quoted lines
> > When a git command is upstream in a pipe, an unexpected failure of
> > the git command will go unnoticed.
> >
> > Write out the output of the git command to a file, so as to actively
> > catch a failure of the git command.
>
> It's easy to see from the patch itself that the output of the Git
> command is now written to a file, so it's not necessary to say so in
> the commit message. Therefore, the entire body of the commit message
> could be written more succinctly, perhaps like this:
>
>     Avoid placing `git` upstream in a pipe since doing so throws away
>     its exit code, thus an unexpected failure may go unnoticed.
>
> The actual patch itself looks fine, and these comments about the
> commit message are quite minor, thus there probably is no need to
> re-roll (though feel free to do so if you think the bit of extra
> polishing of the commit message is worthwhile).

I believe it's best practice to optimize one's work as much as possible, so I have included these changes. Thanks for the detailed explanation.

> Thanks.
-- 
Cheers!

Amanda  Shafack
Previous: Amanda ShafackNext: Amanda Shafack via GitGitGadget
Message 12 of 14 in “t9832,t2200: avoid using pipes in git related commands”
  1. 0/2 [Outreachy][Patch v1] t9832,t2200: avoid using pipes in git related commandsAmanda Shafack via GitGitGadget, Oct 17, 2020
  2. 2/2 t2200: modify code syntaxAmanda Shafack via GitGitGadget, Oct 17, 2020
  3. Eric SunshineOct 18, 2020
  4. Amanda ShafackOct 18, 2020
  5. 1/2 t9832,t2200: avoid using pipes in git commandsAmanda Shafack via GitGitGadget, Oct 17, 2020
  6. Eric SunshineOct 18, 2020
  7. Amanda ShafackOct 18, 2020
  8. t9832,t2200: avoid using pipes in git commandsAmanda Shafack via GitGitGadget, Oct 18, 2020
  9. Eric SunshineOct 18, 2020
  10. Junio C HamanoOct 18, 2020
  11. Amanda ShafackOct 18, 2020
  12. Amanda ShafackOct 18, 2020
  13. t2200,t9832: avoid using 'git' upstream in a pipeAmanda Shafack via GitGitGadget, Oct 18, 2020
  14. Junio C HamanoOct 18, 2020

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.