public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Michael J Gruber <git@drmicha•warpmail.net>
To: Junio C Hamano <gitster@pobox•com>
Cc: Miles Bader <miles@gnu•org>, Gelonida N <gelonida@gmail•com>,
	git@vger•kernel.org
Subject: Re: git alias and --help
Date: Fri, 28 Oct 2011 11:00:31 +0200	[thread overview]
Message-ID: <4EAA6F2F.5020301@drmicha.warpmail.net> (raw)
In-Reply-To: <7vvcr9wyje.fsf@alter.siamese.dyndns.org>

Junio C Hamano venit, vidit, dixit 28.10.2011 06:05:
> Miles Bader <miles@gnu•org> writes:
> 
>> Of course, that would be the wrong thing for somebody that just wants
>> to be reminded what an alias expands too, but my intuition is that
>> this is a very tiny minority compared to people that want to examine
>> the options for the underlying command...
> 
> And it is doubly wrong if help backend is configured to be anything but
> manpages, no?
> 
> As I said, you should be able to come up with a patch that detects and
> special cases the no frills case (replacement to single token) to get what
> you want.

But "help" is still too much to type for the OP ;) How about this in
your config:

[alias]
	h = help
	hh = "!sh -c 'a=$(git config --get alias.$1); : ${a:=$1}; git help
${a%% *}' -"

Ugly as hell, I know, and works only for aliases whose first word is the
name of a git command, as well as for non-aliases. Catching "!command"
type aliases is left as an exercise to the reader.

Michael

  reply	other threads:[~2011-10-28  9:01 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
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 [this message]
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=4EAA6F2F.5020301@drmicha.warpmail.net \
    --to=git@drmicha$(echo .)warpmail.net \
    --cc=gelonida@gmail$(echo .)com \
    --cc=git@vger$(echo .)kernel.org \
    --cc=gitster@pobox$(echo .)com \
    --cc=miles@gnu$(echo .)org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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