threads / discuss / 51662

git diff autocomplete

Subject: git diff autocomplete

## tl;dr

4 messages between Aug 18, 2019 and Aug 26, 2019.

replies: 3people: 3as markdown or json

Dhaval Patel· Aug 18, 2019, 02:44 UTC · lore
How to reproduce

git init touch abc.txt touch abd.txt git add a* git commit -m 'first commit' echo 'hello' > abc.txt git add a[PRESS TAB] (This will autocomplete 'git add abc.txt') git diff a[PRESS TAB] (This will not give 'git diff abc.txt')

Suggested feature -
when I press tab, git diff should autocomplete just like git add.
Santiago Torres Arias· Aug 18, 2019, 02:47 UTC · re: Dhaval Patel · lore

Re: git diff autocomplete

On Sun, Aug 18, 2019 at 08:14:15AM +0530, Dhaval Patel wrote:
Show 6 quoted lines
> How to reproduce
> 
> [snip]
> Suggested feature -
> 
> when I press tab, git diff should autocomplete just like git add.

I think this is somewhat harder of a usecase, as git add generally takes paths and diff can compare revisions *and* paths. I see that if I do

    git diff -- [TAB]

I get all the paths as an autocomplete option, which I think is desired behavior.

Thanks, -Santiago.

Dhaval Patel· Aug 26, 2019, 15:48 UTC · lore

If it is only about files and revisions both being handled by git diff, would it not ne possible to do something like this?

For files
git diff -f a[PRESS TAB]
For revisions
git diff -r a[PRESS TAB]
Some sort of flag which says we are handling files or revisions.
Andreas Schwab· Aug 26, 2019, 17:09 UTC · re: Dhaval Patel · lore

Re: git diff autocomplete

On Aug 26 2019, Dhaval Patel <drdhaval2785@gmail.com> wrote:
Show 12 quoted lines
> If it is only about files and revisions both being handled by git
> diff, would it not ne possible to do something like this?
>
> For files
>
> git diff -f a[PRESS TAB]
>
> For revisions
>
> git diff -r a[PRESS TAB]
>
> Some sort of flag which says we are handling files or revisions.
That already exists, it is spelt `--'.
Andreas.
-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."

← back to recent threads