git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Sixt <j.sixt@viscovery.net>
To: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Cc: git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>,
	Jonathan Nieder <jrnieder@gmail.com>, Jeff King <peff@peff.net>,
	"H.Merijn Brand" <h.m.brand@xs4all.nl>
Subject: Re: [PATCH] help: show manpage for aliased command on git <alias> --help
Date: Tue, 05 Mar 2013 16:42:52 +0100	[thread overview]
Message-ID: <5136127C.2090402@viscovery.net> (raw)
In-Reply-To: <1362494681-11419-1-git-send-email-avarab@gmail.com>

Am 3/5/2013 15:44, schrieb Ævar Arnfjörð Bjarmason:
> Change the semantics of "git <alias> --help" to show the help for the
> command <alias> is aliased to, instead of just saying:
> 
>     `git <alias>' is aliased to `<whatever>'
> 
> E.g. if you have "checkout" aliased to "co" you won't get:
> 
>     $ git co --help
>     `git co' is aliased to `checkout'
> 
> But will instead get the manpage for git-checkout.
...
>  	alias = alias_lookup(argv[0]);
>  	if (alias && !is_git_command(argv[0])) {
> -		printf_ln(_("`git %s' is aliased to `%s'"), argv[0], alias);
> -		return 0;
> +		show_help_for = alias;
> +	} else {
> +		show_help_for = argv[0];
>  	}

This needs a lot more scrutiny. The alias can be more than just a single
word, and it can even be a shell scriptlet, i.e., not a git command at all.

It may make sense to show the help of the aliased-to command if the alias
resolves to just a single word.

-- Hannes

  reply	other threads:[~2013-03-05 15:43 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-05 14:44 [PATCH] help: show manpage for aliased command on git <alias> --help Ævar Arnfjörð Bjarmason
2013-03-05 15:42 ` Johannes Sixt [this message]
2013-03-05 15:54   ` H.Merijn Brand
2013-03-05 16:41     ` Matthieu Moy
2013-03-05 16:16 ` Junio C Hamano
2013-03-05 16:32   ` Ævar Arnfjörð Bjarmason
2013-03-05 16:52     ` Junio C Hamano
2013-03-05 17:38 ` Jeff King
2013-03-06 13:10   ` Michael J Gruber
2013-03-06 23:55     ` Junio C Hamano

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=5136127C.2090402@viscovery.net \
    --to=j.sixt@viscovery.net \
    --cc=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=h.m.brand@xs4all.nl \
    --cc=jrnieder@gmail.com \
    --cc=peff@peff.net \
    /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).