git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] git-completion: Add git help completion for aliases

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Mar 21, 2011, 22:07 UTC
Message-ID
<alpine.DEB.1.00.1103212302000.1561@bonsai2>
In-Reply-To
<7vhbawno11.fsf@alter.siamese.dyndns.org>
Hi,
On Mon, 21 Mar 2011, Junio C Hamano wrote:
Show 31 quoted lines
> Jakob Pfender <jpfender@elegosoft.com> writes:
> 
> > Enable bash completion for "git help <alias>", analogous to "git
> > <alias>", which was already implemented.
> >
> > Signed-off-by: Jakob Pfender <jpfender@elegosoft.com>
> > ---
> >  contrib/completion/git-completion.bash |    2 +-
> >  1 files changed, 1 insertions(+), 1 deletions(-)
> >
> > diff --git a/contrib/completion/git-completion.bash
> > b/contrib/completion/git-completion.bash
> > index 893b771..f9a74d3 100755
> > --- a/contrib/completion/git-completion.bash
> > +++ b/contrib/completion/git-completion.bash
> > @@ -1506,7 +1506,7 @@ _git_help ()
> >  		;;
> >  	esac
> >  	__git_compute_all_commands
> > -	__gitcomp "$__git_all_commands
> > +	__gitcomp "$__git_all_commands $(__git_aliases)
> >  		attributes cli core-tutorial cvs-migration
> >  		diffcore gitk glossary hooks ignore modules
> >  		repository-layout tutorial tutorial-2
> 
> This patch may not be _wrong_ per-se, but it it useful in practice?
> 
> I dunno.
> 
> Don't people usually use aliases so that they do not have to type long
> command names that would need completion?

Yes. And if you use a lot of aliases, or a lot of machines with evolving aliases, the easiest way to inspect the alias is "git help <alias>". Not seeing it completed is an unexpected behavior.

Git is moving the right direction in terms of user-friendliness, e.g. by DWIMming "git checkout <remote branch>". Adding this completion would be a small step in the same direction, not more.

Ciao, Johannes

Previous: Junio C HamanoNext: Junio C Hamano
Message 3 of 19 in “git-completion: Add git help completion for aliases”
  1. git-completion: Add git help completion for aliasesJakob Pfender, Mar 21, 2011
  2. Junio C HamanoMar 21, 2011
  3. Johannes SchindelinMar 21, 2011
  4. Junio C HamanoMar 22, 2011
  5. Johannes SchindelinMar 22, 2011
  6. SZEDER GáborMar 22, 2011
  7. Erik Faye-LundMar 22, 2011
  8. Erik Faye-LundMar 22, 2011
  9. SZEDER GáborMar 22, 2011
  10. Erik Faye-LundMar 22, 2011
  11. Michael J GruberMar 22, 2011
  12. SZEDER GáborMar 22, 2011
  13. Erik Faye-LundMar 23, 2011
  14. Jakub NarebskiMar 23, 2011
  15. Erik Faye-LundMar 23, 2011
  16. Junio C HamanoMar 22, 2011
  17. SZEDER GáborMar 22, 2011
  18. SZEDER GáborMar 22, 2011
  19. Michael J GruberMar 22, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.