From: Manlio Perillo Date: Wed, 19 Dec 2012 23:43:25 GMT Subject: Re: [PATCH v3] git-completion.bash: add support for path completion 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 fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree. Use '--' to separate paths from revisions, like this: 'git [...] -- [...]' 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:fatal: Not a valid object name does-not-exists I 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-----