Re: [PATCH v3] git-completion.bash: add support for path completion
- From
Manlio Perillo <manlio.perillo@gmail.com>
- Date
- Dec 19, 2012, 23:43 UTC
- Message-ID
- <50D2511D.3020705@gmail.com>
- In-Reply-To
- <7vzk1995mx.fsf@alter.siamese.dyndns.org>
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Il 19/12/2012 20:57, Junio C Hamano ha scritto:
> [...]
I just found a serious bug with "git commit" path completion.
When doing the first commit on an empty repository, completion will cause an error:
$git commit -m init <TAB>fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree. Use '--' to separate paths from revisions, like this: 'git <command> [<revision>...] -- [<file>...]'
The problem is that for a newly created repository there is no HEAD.
If HEAD does not exists, code must use ls-files instead of diff-index to get the completion list.
Another change is to always call git commands with stderr redirected to /dev/null.
By the way, this is also a bug of current bash completion code:
$ git show does-not-exists:<TAB>fatal: Not a valid object name
does-not-existsI will write a patch (based on master) to fix this.
> [...]
Regards Manlio -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAlDSUR0ACgkQscQJ24LbaUSkRwCfVKk9JhSD4sKDFm4heAkVbN0o KAAAn3paTXyUiFlfY/UBpnkwiARegLsE =7Q5s -----END PGP SIGNATURE-----