Re: [PATCH 1/2] completion: add a helper function to get config variables

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

 



SZEDER Gábor <szeder@xxxxxxxxxx> writes:

> +	for i in $(git --git-dir="$(__gitdir)" config --get-regexp "$section\..*" 2>/dev/null); do
>  		case "$i" in
> -		pretty.*)
> -			i="${i#pretty.}"
> +		$section.*)
> +			i="${i#$section.}"

The case arm treats $section as a shell glob, --get-regexp treats it
as a regex fragment and then the shell expansion uses it as a
literal.

The current set of callers give simple single-token like pretty,
remote, etc. to it so this is safe, but you may want to give a
comment to the function to help future generation, perhaps?

Other than that, looks quite straight-forward.

Thanks.

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