summaryrefslogtreecommitdiff
path: root/sigchain.h
diff options
context:
space:
mode:
authorLibravatar Rasmus Villemoes <rv@rasmusvillemoes.dk>2018-10-09 13:59:07 +0200
committerLibravatar Junio C Hamano <gitster@pobox.com>2018-10-11 10:21:41 +0900
commite6e76baaf4f0f5bfac5cf5708df536258c28f0f0 (patch)
treefd200537530ea40bee20ae98c99da2ca3d0140ea /sigchain.h
parentSecond batch post 2.19 (diff)
downloadtgif-e6e76baaf4f0f5bfac5cf5708df536258c28f0f0.tar.xz
help: redirect to aliased commands for "git cmd --help"
As discussed in the thread for v1 of this patch [1] [2], this changes the rules for "git foo --help" when foo is an alias. (1) When invoked as "git help foo", we continue to print the "foo is aliased to bar" message and nothing else. (2) If foo is an alias for a shell command, print "foo is aliased to !bar" as usual. (3) Otherwise, print "foo is aliased to bar" to the standard error stream, and then break the alias string into words and pretend as if "git word[0] --help" were called. Getting the man page for git-cherry-pick directly with "git cp --help" is consistent with "--help" generally providing more comprehensive help than "-h". Printing the alias definition to stderr means that in certain cases (e.g. if help.format=web or if the pager uses an alternate screen and does not clear the terminal), one has 'cp' is aliased to 'cherry-pick -n' above the prompt when one returns to the terminal/quits the pager, which is a useful reminder that using 'cp' has some flag implicitly set. There are cases where this information vanishes or gets scrolled away, but being printed to stderr, it should never hurt. [1] https://public-inbox.org/git/20180926102636.30691-1-rv@rasmusvillemoes.dk/ [2] https://public-inbox.org/git/20180926184914.GC30680@sigill.intra.peff.net/ Signed-off-by: Rasmus Villemoes <rv@rasmusvillemoes.dk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'sigchain.h')
0 files changed, 0 insertions, 0 deletions