From: Stefan Beller <sbeller@google.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: "git@vger.kernel.org" <git@vger.kernel.org>,
Jens Lehmann <Jens.Lehmann@web.de>
Subject: Re: [PATCH 04/10] shell helpers usage: always send help to stderr
Date: Mon, 2 May 2016 16:44:41 -0700 [thread overview]
Message-ID: <CAGZ79ka7uPxLKVU7Dn-4yHyN1BMgeG33_7LJDShF3UVjrT2fgQ@mail.gmail.com> (raw)
In-Reply-To: <xmqqtwigox9x.fsf@gitster.mtv.corp.google.com>
On Mon, May 2, 2016 at 4:28 PM, Junio C Hamano <gitster@pobox.com> wrote:
> Stefan Beller <sbeller@google.com> writes:
>
>> `git submodule asdf` would trigger displaying the usage of the submodule
>> command on stderr, however `git submodule -h` would display the usage on
>> stdout. Unify displaying help for shell commands on stderr.
>
> The primary output from "git cmd --help" is the usage message. It
> is debatable why it should go to the standard error output when it
> is the primary thing the user asked for.
I had written some lengthy arguments, but when I wanted to back up
with data and facts, the first search result[1] convinced me this is
a bad patch as when a user asks for help specifically, they want it
to easily be piped, i.e.
git --help |grep pull
instead of
git --help 2>&1 |grep pull
So I'll drop this patch.
Thanks,
Stefan
[1] http://www.jstorimer.com/blogs/workingwithcode/7766119-when-to-use-stderr-instead-of-stdout
>
>
>
>>
>> Signed-off-by: Stefan Beller <sbeller@google.com>
>> ---
>> git-sh-setup.sh | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/git-sh-setup.sh b/git-sh-setup.sh
>> index c48139a..5c02446 100644
>> --- a/git-sh-setup.sh
>> +++ b/git-sh-setup.sh
>> @@ -65,7 +65,7 @@ say () {
>>
>> if test -n "$OPTIONS_SPEC"; then
>> usage() {
>> - "$0" -h
>> + "$0" -h 1>&2
>> exit 1
>> }
next prev parent reply other threads:[~2016-05-02 23:44 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-30 0:40 [PATCH 00/10] submodule output patches Stefan Beller
2016-04-30 0:40 ` [PATCH 01/10] submodule deinit test: fix broken && chain in subshell Stefan Beller
2016-04-30 0:40 ` [PATCH 02/10] submodule deinit: lose requirement for giving '.' Stefan Beller
2016-04-30 0:40 ` [PATCH 03/10] submodule init: redirect stdout to stderr Stefan Beller
2016-04-30 0:40 ` [PATCH 04/10] shell helpers usage: always send help " Stefan Beller
2016-05-02 23:28 ` Junio C Hamano
2016-05-02 23:44 ` Stefan Beller [this message]
2016-05-03 0:45 ` Junio C Hamano
2016-05-03 1:17 ` Junio C Hamano
2016-04-30 0:40 ` [PATCH 05/10] submodule add: send messages " Stefan Beller
2016-05-02 23:26 ` Junio C Hamano
2016-04-30 0:40 ` [PATCH 06/10] submodule deinit: " Stefan Beller
2016-05-02 23:28 ` Junio C Hamano
2016-04-30 0:40 ` [PATCH 07/10] submodule foreach: " Stefan Beller
2016-04-30 0:40 ` [PATCH 08/10] submodule update: " Stefan Beller
2016-04-30 0:40 ` [PATCH 09/10] submodule sync: " Stefan Beller
2016-04-30 0:40 ` [PATCH 10/10] submodule deinit: complain when given a file instead of a submodule Stefan Beller
2016-05-02 8:26 ` Per Cederqvist
2016-05-02 16:21 ` Stefan Beller
2016-05-02 17:00 ` Stefan Beller
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=CAGZ79ka7uPxLKVU7Dn-4yHyN1BMgeG33_7LJDShF3UVjrT2fgQ@mail.gmail.com \
--to=sbeller@google.com \
--cc=Jens.Lehmann@web.de \
--cc=git@vger.kernel.org \
--cc=gitster@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).