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

Re: [PATCH] t/lib-gpg: fix gpgconf stderr redirect to /dev/null

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 14, 2017, 03:30 UTC
Message-ID
<xmqqshdh5ygy.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<20171114030351.GS5144@zaya.teonanacatl.net>
Todd Zullinger <tmz@pobox.com> writes:
Show 23 quoted lines
>> I wonder if this line in 3320 is doing what it meant to do:
>>
>>    test_must_fail git notes merge z 2>&1 >out &&    test_i18ngrep
>> "Automatic notes merge failed" out &&    grep -v "A notes merge into
>> refs/notes/x is already in-progress in" out
>
> That's a fine question.  I only grepped for 2>&1 >/dev/null.  Dropping
> /dev/null, as you did only turns up that test as an additional hit.
>
> I think, based on a very cursory reading of the test, that it's
> intending to direct stderr and stdout to the file out.  The test gets
> lucky that the code in builtin/notes.c directs the error message to
> stdout:
>
>        printf(_("Automatic notes merge failed. Fix conflicts in %s and "
>                 "commit the result with 'git notes merge --commit', or "
>                 "abort the merge with 'git notes merge --abort'.\n"),
>               git_path(NOTES_MERGE_WORKTREE));
>
> Perhaps that should be using fprintf(stderr, ...) instead?  (And the
> test redirection corrected as well, of course.)  If that seems
> correct, I can submit the trivial patch for that as well, while I'm on
> the subject.

The message goes to the standard output stream since it was introduced in 809f38c8 ("git notes merge: Manual conflict resolution, part 1/2", 2010-11-09) and 6abb3655 ("git notes merge: Manual conflict resolution, part 2/2", 2010-11-09). I do think it makes more sense to send it to the standard error stream, but just in case if the original author thinks of a reason why it shouldn't, let's summon Johan and ask his input.

Thanks.
Previous: Todd ZullingerNext: Todd Zullinger
Message 10 of 16 in “t/lib-gpg: fix gpgconf stderr redirect to /dev/null”
  1. t/lib-gpg: fix gpgconf stderr redirect to /dev/nullTodd Zullinger, Nov 13, 2017
  2. Santiago TorresNov 13, 2017
  3. Todd ZullingerNov 13, 2017
  4. Santiago TorresNov 13, 2017
  5. Santiago TorresNov 13, 2017
  6. Todd ZullingerNov 14, 2017
  7. Santiago TorresNov 14, 2017
  8. Junio C HamanoNov 14, 2017
  9. Todd ZullingerNov 14, 2017
  10. Junio C HamanoNov 14, 2017
  11. Todd ZullingerNov 14, 2017
  12. Johan HerlandNov 14, 2017
  13. Junio C HamanoNov 14, 2017
  14. notes: send "Automatic notes merge failed" messages to stderrTodd Zullinger, Nov 14, 2017
  15. Johan HerlandNov 15, 2017
  16. Todd ZullingerNov 15, 2017

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.