Smart auto-completition for staged git file names, used with difftool

Posted by piobyz on Stack Overflow See other posts from Stack Overflow or by piobyz
Published on 2010-06-04T10:21:09Z Indexed on 2010/06/05 20:02 UTC
Read the original article Hit count: 346

Filed under:
|
|
|

I'd like to have a smart auto-completition of currently staged file names when using git diff.

Example:

modified:   DIR1/LongCamelCaseFileName.h
modified:   DIR1/AnotherLongCamelCaseFileName.m
modified:   DIR1/AndThereAreALotOfThemInDir1.m
modified:   DIR2/file4.m

and here, using bash tab-auto-complete functionality I'd like to use it with

git diff

where by smart I mean that after typing git diff I'd need to type only a short part of the staged file name that I want to diff, and without a dirname, so for example

git diff And<TAB>

would result in

git diff AndThereAreALotOfThemInDir1.m

Actually, without a dir-ommiting-part it would be still useful (auto-completing using only staged files pool).

© Stack Overflow or respective owner

Related posts about git

Related posts about bash