Re: [PATCH 3/3] rebase -i: handle core.commentChar=auto

2016-11-22 Thread Johannes Schindelin
Hi Hannes, On Mon, 21 Nov 2016, Johannes Sixt wrote: > Am 21.11.2016 um 15:18 schrieb Johannes Schindelin: > > -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

Re: [PATCH 3/3] rebase -i: handle core.commentChar=auto

2016-11-22 Thread Duy Nguyen
On Mon, Nov 21, 2016 at 9:18 PM, Johannes Schindelin wrote: > When 84c9dc2 (commit: allow core.commentChar=auto for character auto > selection, 2014-05-17) extended the core.commentChar functionality to > allow for the value 'auto', it forgot that rebase -i was already

Re: [PATCH 3/3] rebase -i: handle core.commentChar=auto

2016-11-21 Thread Junio C Hamano
Junio C Hamano writes: > @@ -93,8 +93,17 @@ eval ' > GIT_CHERRY_PICK_HELP="$resolvemsg" > export GIT_CHERRY_PICK_HELP > > -comment_char=$(git config --get core.commentchar 2>/dev/null | cut -c1) > -: ${comment_char:=#} > +comment_char=$(git config --get core.commentchar

Re: [PATCH 3/3] rebase -i: handle core.commentChar=auto

2016-11-21 Thread Johannes Sixt
Am 21.11.2016 um 20:07 schrieb Junio C Hamano: Setting comment-char to multi-letter sequence is not supported at all, and this code is protecting itself from that nonsense---it does not need to be fast, and Dscho already gives a fast path for a single letter case in his patch. Fair enough, no

Re: [PATCH 3/3] rebase -i: handle core.commentChar=auto

2016-11-21 Thread Junio C Hamano
Johannes Sixt writes: > Am 21.11.2016 um 19:40 schrieb Junio C Hamano: >> Johannes Sixt writes: >>> It could be written without forking a process: >>> >>> comment_char=${comment_char%${comment_char#?}} >>> >>> (aka "remove from the end what remains after

[PATCH 3/3] rebase -i: handle core.commentChar=auto

2016-11-21 Thread Junio C Hamano
From: Johannes Schindelin When 84c9dc2 (commit: allow core.commentChar=auto for character auto selection, 2014-05-17) extended the core.commentChar functionality to allow for the value 'auto', it forgot that rebase -i was already taught to handle core.commentChar, and

Re: [PATCH 3/3] rebase -i: handle core.commentChar=auto

2016-11-21 Thread Johannes Sixt
Am 21.11.2016 um 19:40 schrieb Junio C Hamano: Johannes Sixt writes: 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") Hopefully nobody would

Re: [PATCH 3/3] rebase -i: handle core.commentChar=auto

2016-11-21 Thread Junio C Hamano
Johannes Sixt writes: > 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

Re: [PATCH 3/3] rebase -i: handle core.commentChar=auto

2016-11-21 Thread Johannes Sixt
Am 21.11.2016 um 15:18 schrieb Johannes Schindelin: -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=# + ;; +?) + ;;

[PATCH 3/3] rebase -i: handle core.commentChar=auto

2016-11-21 Thread Johannes Schindelin
When 84c9dc2 (commit: allow core.commentChar=auto for character auto selection, 2014-05-17) extended the core.commentChar functionality to allow for the value 'auto', it forgot that rebase -i was already taught to handle core.commentChar, and in turn forgot to let rebase -i handle that new value