Re: [PATCH v2] bash: support pretty format aliases

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

 



On Mon, Oct 11, 2010 at 12:06:22AM +0200, SZEDER Gábor wrote:
> diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
> index 6756990..4d54c32 100755
> --- a/contrib/completion/git-completion.bash
> +++ b/contrib/completion/git-completion.bash
> @@ -750,6 +750,19 @@ __git_compute_porcelain_commands ()
>  	: ${__git_porcelain_commands:=$(__git_list_porcelain_commands)}
>  }
>  
> +__git_pretty_aliases ()
> +{
> +	local i IFS=$'\n'
> +	for i in $(git --git-dir="$(__gitdir)" config --get-regexp "pretty\..*" 2>/dev/null); do
> +		case "$i" in
> +		pretty.*)
> +			i="${i#pretty.}"
> +			echo "${i/ */}"
> +			;;
> +		esac
> +	done
> +}
> +
>  __git_aliases ()
>  {
>  	local i IFS=$'\n'
 
If you look at this new __git_pretty_aliases() function and the old
__git_aliases(), then you'll see that it's quite a code duplication.
So, how about the following two patches instead?

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