From: Junio C Hamano <gitster@pobox.com>
To: Todd Zullinger <tmz@pobox.com>, Johan Herland <johan@herland.net>
Cc: git@vger.kernel.org, Santiago Torres <santiago@nyu.edu>
Subject: Re: [PATCH] t/lib-gpg: fix gpgconf stderr redirect to /dev/null
Date: Tue, 14 Nov 2017 12:30:05 +0900 [thread overview]
Message-ID: <xmqqshdh5ygy.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <20171114030351.GS5144@zaya.teonanacatl.net> (Todd Zullinger's message of "Mon, 13 Nov 2017 22:03:51 -0500")
Todd Zullinger <tmz@pobox.com> writes:
>> 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.
next prev parent reply other threads:[~2017-11-14 3:30 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-13 21:07 [PATCH] t/lib-gpg: fix gpgconf stderr redirect to /dev/null Todd Zullinger
2017-11-13 22:18 ` Santiago Torres
2017-11-13 22:43 ` Todd Zullinger
2017-11-13 23:02 ` Santiago Torres
2017-11-13 23:06 ` Santiago Torres
2017-11-14 3:10 ` Todd Zullinger
2017-11-14 15:35 ` Santiago Torres
2017-11-14 2:49 ` Junio C Hamano
2017-11-14 3:03 ` Todd Zullinger
2017-11-14 3:30 ` Junio C Hamano [this message]
2017-11-14 5:15 ` Todd Zullinger
2017-11-14 9:31 ` Johan Herland
2017-11-14 14:52 ` Junio C Hamano
2017-11-14 16:17 ` [PATCH] notes: send "Automatic notes merge failed" messages to stderr Todd Zullinger
2017-11-15 13:13 ` Johan Herland
2017-11-15 21:09 ` Todd Zullinger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqshdh5ygy.fsf@gitster.mtv.corp.google.com \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=johan@herland.net \
--cc=santiago@nyu.edu \
--cc=tmz@pobox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).