Re: [PATCH] completion: complete "git diff ...branc<TAB>"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



SZEDER GÃbor <szeder@xxxxxxxxxx> 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 "<tree>:<path>" 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 <tree>:<path> to it may
make "git log HEAD:bar<TAB>" 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:<something to follow>", 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?


--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]