# [PATCH v2 0/2] fix cases of rebase -i ignoring core.commentchar

5 messages from 2013-08-18 to 2013-08-19. Participants: Eric Sunshine, Junio C Hamano.
Thread: https://gitlist.dev/t/34722

## Eric Sunshine, 2013-08-18 17:12

Subject: [PATCH v2 0/2] fix cases of rebase -i ignoring core.commentchar
Message-ID: <1376845970-31204-1-git-send-email-sunshine@sunshineco.com>
URL: https://gitlist.dev/e/1376845970-31204-1-git-send-email-sunshine%40sunshineco.com

```
This is a reroll of [1] which fixes a couple cases where rebase -i
ignores core.commentchar. One case was an oversight from the original
patch which added core.commentchar support to rebase -i, and is already
in 'maint'. The other is a regression introduced by [2] which is still
in 'next'.

In this reroll, the single patch from v1 is split into two: patch 1/2 is
suitable for 'maint'; and patch 2/2 is for 'next'. There are no other
changes.

I wanted to add tests to t3404 for these bugs but couldn't figure out
how to do it using the external interface of rebase -i. I was able to
verify before and after behavior by adding temporary echo's to the code
in order to observe the "internal" functioning.

[1]: http://git.661346.n2.nabble.com/PATCH-rebase-i-fix-cases-ignoring-core-commentchar-td7593965.html
[2]: http://git.661346.n2.nabble.com/PATCH-0-3-fix-interactive-rebase-short-SHA-1-collision-bug-td7593673.html#a7593676

Eric Sunshine (2):
  rebase -i: fix skip_unnecessary_picks() to respect core.commentchar
  rebase -i: fix core.commentchar regression

 git-rebase--interactive.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

-- 
1.8.4.rc3.500.gc3113b0

```

## Eric Sunshine, 2013-08-18 17:12

Subject: [PATCH v2 1/2] rebase -i: fix skip_unnecessary_picks() to respect core.commentchar
Message-ID: <1376845970-31204-2-git-send-email-sunshine@sunshineco.com>
URL: https://gitlist.dev/e/1376845970-31204-2-git-send-email-sunshine%40sunshineco.com
In-Reply-To: <1376845970-31204-1-git-send-email-sunshine@sunshineco.com>

```
eff80a9fd990de36 (Allow custom "comment char", 2013-01-16) added general
core.commentchar support but forgot to update git-rebase--interactive to
respect it.  180bad3d10fe3a7f (rebase -i: respect core.commentchar,
2013-02-11) addressed this oversight but missed one instance of
hard-coded '#' comment character in skip_unnecessary_picks(). Fix this.

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
---

Suitable for 'maint'.

 git-rebase--interactive.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh
index ea11e62..3733312 100644
--- a/git-rebase--interactive.sh
+++ b/git-rebase--interactive.sh
@@ -671,7 +671,7 @@ skip_unnecessary_picks () {
 				;;
 			esac
 			;;
-		3,#*|3,)
+		3,"$comment_char"*|3,)
 			# copy comments
 			;;
 		*)
-- 
1.8.4.rc3.500.gc3113b0

```

## Eric Sunshine, 2013-08-18 17:12

Subject: [PATCH v2 2/2] rebase -i: fix core.commentchar regression
Message-ID: <1376845970-31204-3-git-send-email-sunshine@sunshineco.com>
URL: https://gitlist.dev/e/1376845970-31204-3-git-send-email-sunshine%40sunshineco.com
In-Reply-To: <1376845970-31204-1-git-send-email-sunshine@sunshineco.com>

```
9a46c25bdbf79744 (rebase: interactive: fix short SHA-1 collision,
2013-08-12) added transform_todo_ids() which assumes incorrectly that
the comment character is always '#', however, this has not been the case
since 180bad3d10fe3a7f (rebase -i: respect core.commentchar, 2013-02-11)
patched rebase -i to respect core.commentchar. Fix this regression.

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
---

Intended for 'next'.

 git-rebase--interactive.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh
index 3733312..f246810 100644
--- a/git-rebase--interactive.sh
+++ b/git-rebase--interactive.sh
@@ -693,7 +693,7 @@ transform_todo_ids () {
 	while read -r command rest
 	do
 		case "$command" in
-		'#'* | exec)
+		"$comment_char"* | exec)
 			# Be careful for oddball commands like 'exec'
 			# that do not have a SHA-1 at the beginning of $rest.
 			;;
-- 
1.8.4.rc3.500.gc3113b0

```

## Junio C Hamano, 2013-08-18 21:14

Subject: Re: [PATCH v2 2/2] rebase -i: fix core.commentchar regression
Message-ID: <7vr4dqn1ko.fsf@alter.siamese.dyndns.org>
URL: https://gitlist.dev/e/7vr4dqn1ko.fsf%40alter.siamese.dyndns.org
In-Reply-To: <1376845970-31204-3-git-send-email-sunshine@sunshineco.com>

```
Eric Sunshine <sunshine@sunshineco.com> writes:

> Intended for 'next'.

Thanks.

Will queue on top of es/rebase-i-no-abbrev, but we have a chance to
rebuild 'next' after 1.8.4 release, so we may want to squash this
into the problematic commit when it happens.


>
>  git-rebase--interactive.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh
> index 3733312..f246810 100644
> --- a/git-rebase--interactive.sh
> +++ b/git-rebase--interactive.sh
> @@ -693,7 +693,7 @@ transform_todo_ids () {
>  	while read -r command rest
>  	do
>  		case "$command" in
> -		'#'* | exec)
> +		"$comment_char"* | exec)
>  			# Be careful for oddball commands like 'exec'
>  			# that do not have a SHA-1 at the beginning of $rest.
>  			;;

```

## Eric Sunshine, 2013-08-19 00:29

Subject: Re: [PATCH v2 2/2] rebase -i: fix core.commentchar regression
Message-ID: <CAPig+cR71yjqQhir8nTHsWuGZX5dgjpRvgdGPd4VMUn+DZok0w@mail.gmail.com>
URL: https://gitlist.dev/e/CAPig%2BcR71yjqQhir8nTHsWuGZX5dgjpRvgdGPd4VMUn%2BDZok0w%40mail.gmail.com
In-Reply-To: <7vr4dqn1ko.fsf@alter.siamese.dyndns.org>

```
On Sun, Aug 18, 2013 at 5:14 PM, Junio C Hamano <gitster@pobox.com> wrote:
> Eric Sunshine <sunshine@sunshineco.com> writes:
>
>> Intended for 'next'.
>
> Thanks.
>
> Will queue on top of es/rebase-i-no-abbrev, but we have a chance to
> rebuild 'next' after 1.8.4 release, so we may want to squash this
> into the problematic commit when it happens.

That would be fine. Time permitting, I also would like to send out a
couple incremental patches atop 'next' which address your comments [1]
about es/rebase-i-no-abbrev. Those new patches should be suitable for
squashing if you want to go that route.

[1]: http://thread.gmane.org/gmane.comp.version-control.git/232146

>>
>>  git-rebase--interactive.sh | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh
>> index 3733312..f246810 100644
>> --- a/git-rebase--interactive.sh
>> +++ b/git-rebase--interactive.sh
>> @@ -693,7 +693,7 @@ transform_todo_ids () {
>>       while read -r command rest
>>       do
>>               case "$command" in
>> -             '#'* | exec)
>> +             "$comment_char"* | exec)
>>                       # Be careful for oddball commands like 'exec'
>>                       # that do not have a SHA-1 at the beginning of $rest.
>>                       ;;

```
