cornelius.weig@xxxxxxxxxxx writes: > From: Cornelius Weig <cornelius.weig@xxxxxxxxxxx> > > Git-checkout completes words starting with '--' as options and other > words as refs. Even after specifying a ref, further words not starting > with '--' are completed as refs, which is invalid for git-checkout. > > This commit ensures that after specifying a ref, further non-option > words are completed as paths. Four cases are considered: > > - If the word contains a ':', do not treat it as reference and use > regular revlist completion. > - If no ref is found on the command line, complete non-options as refs > as before. > - If the ref is HEAD or @, complete only with modified files because > checking out unmodified files is a noop. > This case also applies if no ref is given, but '--' is present. Please at least do not do this one; a completion that is or pretends to be more clever than the end users will confuse them at best and annoy them. Maybe the user does not recall if she touched the path or not, and just trying to be extra sure that it matches HEAD or index by doing "git checkout [HEAD] path<TAB>". Leave the "make it a noop" to Git, but just allow her do so. I personally feel that "git checkout <anything>... foo<TAB>" should just fall back to the normal "path on the filesystem" without any cleverness, instead of opening a tree object or peek into the index.