Re: [PATCH 3/3] rebase -i: handle core.commentChar=auto
- From
Johannes Sixt <j6t@kdbg.org>
- Date
- Nov 21, 2016, 18:26 UTC
- Message-ID
- <975c0002-8afe-efa6-d967-72f2a0d21169@kdbg.org>
- In-Reply-To
- <9ef529a4fbb60990a91d7bbfdd49c6d20d49e442.1479737858.git.johannes.schindelin@gmx.de>
Am 21.11.2016 um 15:18 schrieb Johannes Schindelin:
Show 11 quoted lines
> -comment_char=$(git config --get core.commentchar 2>/dev/null | cut -c1)
> -: ${comment_char:=#}
> +comment_char=$(git config --get core.commentchar 2>/dev/null)
> +case "$comment_char" in
> +''|auto)
> + comment_char=#
> + ;;
> +?)
> + ;;
> +*)
> + comment_char=$(comment_char | cut -c1)comment_char is a command? Did you mean
comment_char=$(echo "$comment_char" | cut -c1)
It could be written without forking a process:
comment_char=${comment_char%${comment_char#?}}(aka "remove from the end what remains after removing the first character")
-- Hannes