From: Junio C Hamano Date: Thu, 24 Feb 2011 17:09:48 GMT Subject: Re: [PATCH] completion: complete "git diff ...branc" Message-ID: <7vfwrd2wbn.fsf@alter.siamese.dyndns.org> In-Reply-To: <20110224151328.GB14720@neumann> SZEDER Gábor writes: > There is this 'ref:file' notation (as in 'git show master:README', but > I don't know the proper term for it), which is understood by > __git_complete_file(), and can be useful for 'git diff', e.g. to > compare a file in two branches when the file was renamed in between: > > git diff branchA:old branchB:new > > However, __git_complete_revlist() doesn't understand this notation, If that is the case, I wonder if complete-revlist should learn it as well. The ":" notation is just one of the "extended SHA-1 expressions" to name an entry in a tree object and should be usable anywhere an object name is expected to occur. The users of complete-revlist seems to be "log" and their friends, and they don't expect arbitrary object names; they are only interested in commit objects and tags and then paths. Teaching : to it may make "git log HEAD:bar" to complete to "git log HEAD:bar/boz" that would be a nonsense, but anything that the original "git log HEAD:bar" would complete would be a nonsense to begin with (as soon as you said "HEAD:", you are naming either a blob or a tree object, and you cannot start log from them), so I don't see a harm done in doing so. IOW, shouldn't there be just one unified complete-rev-then-path that is a superset of the current complete-revlist and complete-file that all the current users of complete-revlist and complete-file should use?