git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Gelonida N <gelonida@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: git alias and --help
Date: Thu, 27 Oct 2011 15:50:41 -0700	[thread overview]
Message-ID: <7v8vo6xd4u.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <7vfwiexe6m.fsf@alter.siamese.dyndns.org> (Junio C. Hamano's message of "Thu, 27 Oct 2011 15:28:01 -0700")

Junio C Hamano <gitster@pobox.com> writes:

> Gelonida N <gelonida@gmail.com> writes:
>
>> Is there any trick to get the help text of git branch without
>> having to type
>>
>> git branch --help
>
> How about "git help branch"?

It was bad of me to write a tongue-in-cheek answer, get distracted and
ended up sending it without the real answer.

The reason why we do not do what you seem to be suggesting is because
giving the same behaviour to "git b --help" as "git branch --help" is
wrong.

To see why, imagine you have configured an alias that is not a simple and
stupid substitution "b == branch", but something like "bt == branch -t",
and then want to know what you should write after "git bt".  Giving the
manpage for branch without giving them any hint that they configured that
alias to produce customized behaviour that is different from plain vanilla
"branch" is not quite acceptable.

I think you _could_ make a patch that special cases a simple and straight
substitution and skip the "foo is aliased to bar" step, but I doubt it is
worth it to lose consistency between "git b --help" vs "git bt --help"
that way.

  reply	other threads:[~2011-10-27 22:50 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-27 22:20 git alias and --help Gelonida N
2011-10-27 22:28 ` Junio C Hamano
2011-10-27 22:50   ` Junio C Hamano [this message]
2011-10-28  0:24     ` Gelonida N
2011-10-28  1:51     ` Miles Bader
2011-10-28  4:05       ` Junio C Hamano
2011-10-28  9:00         ` Michael J Gruber
2011-10-28  9:17         ` Gelonida N
2011-10-28 13:27           ` Jakub Narebski
2011-10-28 20:21             ` Gelonida N
2011-10-28 13:26       ` Jakub Narebski
2011-10-28 18:07         ` Junio C Hamano
2011-10-28 18:25           ` Miles Bader
2011-10-28 20:23         ` Gelonida N

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7v8vo6xd4u.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=gelonida@gmail.com \
    --cc=git@vger.kernel.org \
    /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.
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 NNTP newsgroup(s).