Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Add completions for git blame command #3094
For all the options that take a file, you'll want to replace the "-f" with a "-r" - they require an argument, and it can be a file - see
These are "-S" and "--contents", for "--date" you'll probably want "-x" (no files but a required argument). Though that's another shared option (with
What more stuff do you want to add? I will look at the TODO to improve the completions for git. I read somewhere that fish shell's auto-completion uses man pages, is it true? If so why it doesn't work for git (or the other commands).
You possibly read it on fishshell.com - it is true. We have a python script that tries to parse man pages and generate completion scripts from that. For simple stuff (commands that take files and only have long and short options that don't take arguments) it works, but for something like git man pages just aren't written in a precise enough format that it could do much. Even for simple stuff the descriptions are often "Something something something...[See the man page for details]".
So we have a lot of hand-written completions, which includes git (as you've probably seen).
Well, the arguments. From the man page, it appears git blame takes a "rev" and also files. We're not currently completing the "rev" part (which, in simplified terms, is a git-ism for those commit hashes you see all over the place).
Then we have the options that take arguments we're not completing yet, like "--encoding". We're also not yet sharing the shared options.
This is complicated stuff, and some of it might well be impossible with our current system - e.g. completing "dates", because there's an infinite number of them.