Re: [PATCH] help: allow redirecting to help for aliased command
- From
Duy Nguyen <pclouds@gmail.com>
- Date
- Sep 26, 2018, 15:16 UTC
- Message-ID
- <CACsJy8Ac0TEpfHK6-pS_CMzGrYjmkaT_bM0V4kXfNxqY0TONtg@mail.gmail.com>
- In-Reply-To
- <20180926102636.30691-1-rv@rasmusvillemoes.dk>
On Wed, Sep 26, 2018 at 12:29 PM Rasmus Villemoes <rv@rasmusvillemoes.dk> wrote:
Show 18 quoted lines
> > I often use 'git <cmd> --help' as a quick way to get the documentation > for a command. However, I've also trained my muscle memory to use my > aliases (cp=cherry-pick, co=checkout etc.), which means that I often end > up doing > > git cp --help > > to which git correctly informs me that cp is an alias for > cherry-pick. However, I already knew that, and what I really wanted was > the man page for the cherry-pick command. > > This introduces a help.followAlias config option that transparently > redirects to (the first word of) the alias text (provided of course it > is not a shell command), similar to the option for autocorrect of > misspelled commands. > > The documentation in config.txt could probably be improved.
While at there, maybe you could also mention the behavior of "git help" when given an alias, in git-help.txt. And you could also add a hint to suggest this new config help.followAlias there.
-- Duy