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

Re: What's cooking in git.git (Jun 2013, #07; Thu, 20)

From
Ramkumar Ramachandra <artagnon@gmail.com>
Date
Jun 22, 2013, 06:17 UTC
Message-ID
<CALkWK0=FaC9CqiTLE=UJA+Xg04=ZS45XddQ-RmPe_HSej2s5bA@mail.gmail.com>
In-Reply-To
<7vvc57kxxt.fsf@alter.siamese.dyndns.org>
Junio C Hamano wrote:
> Because the implementation is too ugly.

I know :) The only reason I sent it with code is because I didn't get any responses to an email without code. If you agree that it is a useful feature, we have to figure out a beautiful implementation.

Show 6 quoted lines
> I would however can imagine an alternative implementation which
> might be more palatable. It may go like this:
>
>         [alias "lgF"]
>                 command = "log --oneline --boundary --first-parent"
>                 help = "show the first parent chain, one line per commit"

I'm not sure what value this adds. If I ever forget what my alias is called, I `git rp --help` to get the expansion and then look up the manpage. It would be ideal if I could `man git lgF` though: I'm sick of having to type out `man git for-each-ref` everytime I need the manpage for fer (obviously an unscripted `man` won't work: `git help` will do the translation).

>                 completion = log

Again, unsure what value it adds. I already have plenty of aliases that complete fine. The completion only fails if I have an !-command; in that case, this solution is a hack: we should work towards not requiring an !-command in the first place.

> so that not just alias.c code can take notice of alias.lgF.command
> to expand it,

How? Fundamentally, alias_lookup_cb() is a fired off by the config-parsing infrastructure which calls a tolower() on everything: alias.c has control over nothing, unless we re-implement the entire config-parsing infrastructure specifically for aliases (Bad idea). I don't see how changing from alias.<name> to alias.<name>.command helps anything, especially when the other alias.<name>.* keys aren't even useful.

> but we can later extend it to help "git help lgF"
Yeah, this is a good idea.
> and
> bash/zsh completion (i.e. they would learn "lgF parameter would
> complete in a way similar to 'log'" from alias.lgF.completion).
Solved problem: see __git_aliased_command() in git-completion.bash.
Previous: Junio C HamanoNext: Thomas Rast
Message 11 of 12 in “What's cooking in git.git (Jun 2013, #07; Thu, 20)”
  1. Junio C HamanoJun 21, 2013
  2. Ramkumar RamachandraJun 21, 2013
  3. Junio C HamanoJun 21, 2013
  4. Ramkumar RamachandraJun 21, 2013
  5. Junio C HamanoJun 21, 2013
  6. Ramkumar RamachandraJun 21, 2013
  7. Antoine PelisseJun 21, 2013
  8. Junio C HamanoJun 21, 2013
  9. Ramkumar RamachandraJun 21, 2013
  10. Junio C HamanoJun 21, 2013
  11. Ramkumar RamachandraJun 22, 2013
  12. Thomas RastJun 23, 2013

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.