Re: [PATCH 2/3] help: Add '--follow-alias' option

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: [PATCH 2/3] help: Add '--follow-alias' option

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:53:18

김남형 [off-list ref] writes:
2012-03-15 3:00 PM, Junio C Hamano wrote:
quoted
Namhyung Kim[off-list ref]  writes:
quoted
The --follow-alias option will look up the alias definitions and
use the first word as a command. For example, if I set my aliases
as follows:

  $ git help br
  `git br' is aliased to `git branch'
  $ git help ru
  `git ru' is aliased to `git remote update'

adding --follow-alias (or -f) option will show man pages of
git-branch and git-remote, respectively.
What would happen when somebody has this?

	[alias]
         	br = branch --list

	$ git help --follow-alias br
	... man page for git-branch is shown ...

NAK.
I'm sorry I don't understand what you meant by this. What should be
happened for this?
You _somehow_ restict the output, or at least draw the user's attention,
to the description of --list mode in the resulting "git-branch" manual.

I do not think that is feasible.

But showing the whole manual page, without telling the user that "br" is
not aliased to a plain vanilla "branch" without any option, is not a
solution, especially if you are going to let the user set a configuration
variable to allow him to forget about this setting. Progressive revelation
would not have such a downside and I think it is more appropriate approach
for something like "help".

Re: [PATCH 2/3] help: Add '--follow-alias' option

From: Namhyung Kim <hidden>
Date: 2016-06-15 22:53:18

2012-03-15 3:23 PM, Junio C Hamano wrote:
김남형 [off-list ref] writes:
quoted
2012-03-15 3:00 PM, Junio C Hamano wrote:
quoted
Namhyung Kim [off-list ref] writes:
quoted
The --follow-alias option will look up the alias definitions and
use the first word as a command. For example, if I set my aliases
as follows:

   $ git help br
   `git br' is aliased to `git branch'
   $ git help ru
   `git ru' is aliased to `git remote update'

adding --follow-alias (or -f) option will show man pages of
git-branch and git-remote, respectively.
What would happen when somebody has this?

	[alias]
          	br = branch --list

	$ git help --follow-alias br
	... man page for git-branch is shown ...

NAK.
I'm sorry I don't understand what you meant by this. What should be
happened for this?
You _somehow_ restict the output, or at least draw the user's attention,
to the description of --list mode in the resulting "git-branch" manual.

I do not think that is feasible.
Actually I was thinking about moving to an appropriate point in the document 
by checking second argument (if any) and searching it (using regexp?). But I 
coundn't be sure it'd be possible too.

But showing the whole manual page, without telling the user that "br" is
not aliased to a plain vanilla "branch" without any option, is not a
solution, especially if you are going to let the user set a configuration
variable to allow him to forget about this setting. Progressive revelation
would not have such a downside and I think it is more appropriate approach
for something like "help".
OK. That makes sense to me too. This was just a quick thought hoping that can 
be helpful for someone who uses alias as a simple abbreviation.

Thanks for taking your time and giving me detailed comments.
Namhyung
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help