Re: [PATCH 2/5] completion: complete REVERT_HEAD and BISECT_HEAD

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

 



"Philippe Blain via GitGitGadget" <gitgitgadget@xxxxxxxxx> writes:

> From: Philippe Blain <levraiphilippeblain@xxxxxxxxx>
>
> The pseudorefs REVERT_HEAD and BISECT_HEAD are not suggested
> by the __git_refs function. Add them there.
>
> Signed-off-by: Philippe Blain <levraiphilippeblain@xxxxxxxxx>
> ---
>  contrib/completion/git-completion.bash | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
> index dc95c34cc85..bcda376735c 100644
> --- a/contrib/completion/git-completion.bash
> +++ b/contrib/completion/git-completion.bash
> @@ -767,7 +767,7 @@ __git_refs ()
>  			track=""
>  			;;
>  		*)
> -			for i in HEAD FETCH_HEAD ORIG_HEAD MERGE_HEAD REBASE_HEAD CHERRY_PICK_HEAD; do
> +			for i in HEAD FETCH_HEAD ORIG_HEAD MERGE_HEAD REBASE_HEAD CHERRY_PICK_HEAD REVERT_HEAD BISECT_HEAD; do
>  				case "$i" in
>  				$match*|$umatch*)
>  					if [ -e "$dir/$i" ]; then

This does obvious change to add two completion possibilities reusing
exactly the same logic we have been using.

A tangent related to my earlier "didn't we plan to limit them to
*_HEAD at some point?" is that we could turn the loop around and do
something like

		for i in HEAD $(cd "$dir" && echo *_HEAD)
		do
			case "$i" in
			$match*|$umatch*)
				if test -f "$dir/$i"
				then
					...

which could be a lot more future-proof, once we have such a rule.

But that is a tangent that we should wait until the current series
settles.

Thanks.




[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]

  Powered by Linux