Re: [PATCH] git-completion.bash: update obsolete code.

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

 



Manlio Perillo <manlio.perillo@xxxxxxxxx> writes:

> The git-completion.bash script was using the git ls-tree command
> without the --name-only option, with a sed filter to parse path names;
> use the --name-only option, instead.
>
> Signed-off-by: Manlio Perillo <manlio.perillo@xxxxxxxxx>
> ---

Did you miss the different handling between blobs and trees the
latter gets trailing slash in the completion)?

>  contrib/completion/git-completion.bash | 15 +--------------
>  1 file changed, 1 insertion(+), 14 deletions(-)
>
> diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
> index 0b77eb1..85d9051 100644
> --- a/contrib/completion/git-completion.bash
> +++ b/contrib/completion/git-completion.bash
> @@ -397,20 +397,7 @@ __git_complete_revlist_file ()
>  		*)   pfx="$ref:$pfx" ;;
>  		esac
>  
> -		__gitcomp_nl "$(git --git-dir="$(__gitdir)" ls-tree "$ls" \
> -				| sed '/^100... blob /{
> -				           s,^.*	,,
> -				           s,$, ,
> -				       }
> -				       /^120000 blob /{
> -				           s,^.*	,,
> -				           s,$, ,
> -				       }
> -				       /^040000 tree /{
> -				           s,^.*	,,
> -				           s,$,/,
> -				       }
> -				       s/^.*	//')" \
> +		__gitcomp_nl "$(git --git-dir="$(__gitdir)" ls-tree --name-only "$ls")" \
>  			"$pfx" "$cur_" ""
>  		;;
>  	*...*)
--
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]