Re: [PATCH 1/2] Allow __git_ps1 to be used in PROMPT_COMMAND

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

 



Simon Oosthoek <s.oosthoek@xxxxxxxxx> writes:

>  __git_ps1 ()
>  {
> +	local pcmode=no
> +	#defaults/examples:
> +	local ps1pc_start='\u@\h:\w '
> +	local ps1pc_end='\$ '
> +	local printf_format='(%s)'
> + ...

This conversion is wrong, given that ...

> @@ -284,6 +317,12 @@ __git_ps1 ()
>  		fi
>  
>  		local f="$w$i$s$u"
> -		printf -- "${1:- (%s)}" "$c${b##refs/heads/}${f:+ $f}$r$p"

... the original has a SP in front.  I've tentatively queued a
fix-up patch on the topic branch before merging it to 'pu'.

> +		if [ $pcmode = yes ]; then
> +			PS1="$ps1pc_start("
> +			PS1="$PS1$c${b##refs/heads/}${f:+ $f}$r$p"
> +			PS1="$PS1)$ps1pc_end"
> +		else
> +			printf -- "$printf_format" "$c${b##refs/heads/}${f:+ $f}$r$p"
> +		fi
>  	fi
>  }
--
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]