Re: [PATCH 6/6] completion: clarify ls-tree, archive, show completion

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

 



Ramkumar Ramachandra <artagnon@xxxxxxxxx> writes:

> Currently, the 'git ls-tree', 'git archive', and 'git show' completions
> use __git_complete_file (aliased to __git_complete_revlist_file).
>
> In the case of 'git ls-tree' and 'git archive', they necessarily require
> a tree-ish argument (and optionally a pathspec filter, or "file
> argument"):
>
>   $ git ls-tree hot-branch git.c
>   $ git archive HEAD~4 git.c
>
> So, __git_complete_file is a misleading name.
>
> In the case of 'git show', it can take a pathspec and default the
> revision to HEAD like:
>
>   $ git show git.c
>
> (which is useful if git.c was modified in HEAD)
>
> However, this usage is not idiomatic at all.

More idiomatic is after seeing "git show --stat" doing "git show dir/".

But I do not think it really matters.

Just like "diff" and "difftool", "show" optionally takes revs and
paths, and because the current completion code does not do anything
fancy like "we have seen enough revs and there will appear no revs
hence we only complete paths from here on", complete_revlist_file is
the right helper to use for all of them.
--
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]