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

git blame completion add <rev> completion?

From
Jacob Keller <jacob.keller@gmail.com>
Date
Apr 12, 2018, 22:18 UTC
Message-ID
<CA+P7+xrQhGdifOGVKCqw3bEBp-YVQwNNQiXzvECJfFpMRipu2g@mail.gmail.com>
Hi,

I use git blame sometimes to blame against specific revisions, i.e. "git blame <branch> -- <file>" and it would be nice if blame could figure out how to complete the <branch> or revision reference..

I tried to take a stab at adding support for this, but I couldn't figure out which completion function to use...

I want "git blame <TAB>" to complete files like normal, (as this is the most general use case), but to have "git blame xyz<TAB>" to complete revisions if there's any that match, (while still also completing files). Additionally, it should only complete a revision for the first argument, and go back to strict file names after.

In an *ideal* world, it'd be nice if it could figure out say:
git blame <branch> xyz<TAB>

and complete xyz as a file found in branch, not actually checking local files but the ls-files of that branch instead. (i.e. it should be able to complete a file that was deleted in the current checkout but exists on that ref).

any ideas on where to start with that?

Thanks, Jake

Message 1 of 1 in “git blame completion add <rev> completion?”
  1. Jacob KellerApr 12, 2018

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.