git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [BUG?] git rebase -i
@ 2007-12-14  1:21 Pieter de Bie
  2007-12-14  7:30 ` Johannes Sixt
  0 siblings, 1 reply; 7+ messages in thread
From: Pieter de Bie @ 2007-12-14  1:21 UTC (permalink / raw)
  To: git

Hi,

I was just toying with git rebase -i -p, when I found the following:

Tirana:~/git pieter$ /opt/local/bin/git --version
git version 1.5.3.5

Tirana:~/git pieter$ time /opt/local/bin/git rebase -p -i HEAD~100
Successfully rebased and updated refs/heads/master.

real    0m17.816s
user    0m3.927s
sys     0m10.381s

Tirana:~/git pieter$ git --version
git version 1.5.4.rc0
Tirana:~/git pieter$ time git rebase -p -i HEAD~100
cat: /Users/pieter/git/.git/.dotest-merge/rewritten/ 
1e8df762b38e01685f3aa3613e2d61f73346fcbe: No such file or directory

real    0m20.427s
user    0m4.449s
sys     0m14.028s

The rebase in 1.5.4.rc0 exists with an error. Another thing to note  
is that the 1.5.4.rc0 tries to apply 215 patches, while the 1.5.3.5  
tries to apply 206 patches. This test was done on the git master  
branch (tagged 1.5.4.rc0). I did not change anything in the  
interactive rebase editor (just hit :wq in vim).

- Pieter

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [BUG?] git rebase -i
  2007-12-14  1:21 [BUG?] git rebase -i Pieter de Bie
@ 2007-12-14  7:30 ` Johannes Sixt
  2007-12-17 16:04   ` Pieter de Bie
  0 siblings, 1 reply; 7+ messages in thread
From: Johannes Sixt @ 2007-12-14  7:30 UTC (permalink / raw)
  To: Pieter de Bie; +Cc: git

Pieter de Bie schrieb:
> Another thing to note is
> that the 1.5.4.rc0 tries to apply 215 patches, while the 1.5.3.5 tries
> to apply 206 patches.

This is to be expected: 1.5.3.5 counts the comment lines at the top of the
action file, of which there are exactly 9, 1.5.4.rc0 does not count them.

-- Hannes

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [BUG?] git rebase -i
  2007-12-14  7:30 ` Johannes Sixt
@ 2007-12-17 16:04   ` Pieter de Bie
  2007-12-17 16:59     ` [PATCH] rebase -p -i: handle "no changes" gracefully Johannes Schindelin
  0 siblings, 1 reply; 7+ messages in thread
From: Pieter de Bie @ 2007-12-17 16:04 UTC (permalink / raw)
  To: Johannes Sixt, git

Hi,

On Dec 14, 2007, at 8:30 AM, Johannes Sixt wrote:
> Pieter de Bie schrieb:
>> Another thing to note is
>> that the 1.5.4.rc0 tries to apply 215 patches, while the 1.5.3.5  
>> tries
>> to apply 206 patches.
>
> This is to be expected: 1.5.3.5 counts the comment lines at the top  
> of the
> action file, of which there are exactly 9, 1.5.4.rc0 does not count  
> them.
>

Ok, but what about the error in the rebase?

On Dec 14, 2007, at 2:21 AM, Pieter de Bie wrote:
> Tirana:~/git pieter$ time git rebase -p -i HEAD~100
> cat: /Users/pieter/git/.git/.dotest-merge/rewritten/ 
> 1e8df762b38e01685f3aa3613e2d61f73346fcbe: No such file or directory


- Pieter

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH] rebase -p -i: handle "no changes" gracefully
  2007-12-17 16:04   ` Pieter de Bie
@ 2007-12-17 16:59     ` Johannes Schindelin
  2007-12-17 20:23       ` Junio C Hamano
  0 siblings, 1 reply; 7+ messages in thread
From: Johannes Schindelin @ 2007-12-17 16:59 UTC (permalink / raw)
  To: Pieter de Bie; +Cc: Johannes Sixt, git, gitster


Since commit 376ccb8cbb453343998e734d8a1ce79f57a4e092, unchanged
SHA-1s are no longer mapped via $REWRITTEN.  But the updating
phase was not prepared for the old head not being rewritten.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---

	On Mon, 17 Dec 2007, Pieter de Bie wrote:

	> Ok, but what about the error in the rebase?
	> 
	> On Dec 14, 2007, at 2:21 AM, Pieter de Bie wrote:
	> > Tirana:~/git pieter$ time git rebase -p -i HEAD~100
	> > cat:
	> > /Users/pieter/git/.git/.dotest-merge/rewritten/1e8df762b38e01685f3aa3613e2d61f73346fcbe:
	> > No such file or directory

	This buglet was not caught earlier, probably because a 
	non-rewriting rebase is not really interesting ;-)

 git-rebase--interactive.sh |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh
index f83e00f..cd7e43f 100755
--- a/git-rebase--interactive.sh
+++ b/git-rebase--interactive.sh
@@ -322,7 +322,12 @@ do_next () {
 		test -f "$DOTEST"/current-commit &&
 			current_commit=$(cat "$DOTEST"/current-commit) &&
 			git rev-parse HEAD > "$REWRITTEN"/$current_commit
-		NEWHEAD=$(cat "$REWRITTEN"/$OLDHEAD)
+		if test -f "$REWRITTEN"/$OLDHEAD
+		then
+			NEWHEAD=$(cat "$REWRITTEN"/$OLDHEAD)
+		else
+			NEWHEAD=$OLDHEAD
+		fi
 	else
 		NEWHEAD=$(git rev-parse HEAD)
 	fi &&
-- 
1.5.4.rc0.59.g1d10d

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] rebase -p -i: handle "no changes" gracefully
  2007-12-17 16:59     ` [PATCH] rebase -p -i: handle "no changes" gracefully Johannes Schindelin
@ 2007-12-17 20:23       ` Junio C Hamano
  2007-12-17 21:01         ` [PATCH w/ test] " Johannes Schindelin
  0 siblings, 1 reply; 7+ messages in thread
From: Junio C Hamano @ 2007-12-17 20:23 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: Pieter de Bie, Johannes Sixt, git, gitster

Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:

> Since commit 376ccb8cbb453343998e734d8a1ce79f57a4e092, unchanged
> SHA-1s are no longer mapped via $REWRITTEN.  But the updating
> phase was not prepared for the old head not being rewritten.
>
> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
> ---
>
> 	On Mon, 17 Dec 2007, Pieter de Bie wrote:
>
> 	> Ok, but what about the error in the rebase?
> 	> 
> 	> On Dec 14, 2007, at 2:21 AM, Pieter de Bie wrote:
> 	> > Tirana:~/git pieter$ time git rebase -p -i HEAD~100
> 	> > cat:
> 	> > /Users/pieter/git/.git/.dotest-merge/rewritten/1e8df762b38e01685f3aa3613e2d61f73346fcbe:
> 	> > No such file or directory
>
> 	This buglet was not caught earlier, probably because a 
> 	non-rewriting rebase is not really interesting ;-)

Hmph, care to add a test to t3404?

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH w/ test] rebase -p -i: handle "no changes" gracefully
  2007-12-17 20:23       ` Junio C Hamano
@ 2007-12-17 21:01         ` Johannes Schindelin
  2007-12-18 20:24           ` Junio C Hamano
  0 siblings, 1 reply; 7+ messages in thread
From: Johannes Schindelin @ 2007-12-17 21:01 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Pieter de Bie, Johannes Sixt, git


Since commit 376ccb8cbb453343998e734d8a1ce79f57a4e092, unchanged
SHA-1s are no longer mapped via $REWRITTEN.  But the updating
phase was not prepared for the old head not being rewritten.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---

	On Mon, 17 Dec 2007, Junio C Hamano wrote:

	> Hmph, care to add a test to t3404?

	How about this?

 git-rebase--interactive.sh    |    7 ++++++-
 t/t3404-rebase-interactive.sh |    6 ++++++
 2 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh
index f83e00f..cd7e43f 100755
--- a/git-rebase--interactive.sh
+++ b/git-rebase--interactive.sh
@@ -322,7 +322,12 @@ do_next () {
 		test -f "$DOTEST"/current-commit &&
 			current_commit=$(cat "$DOTEST"/current-commit) &&
 			git rev-parse HEAD > "$REWRITTEN"/$current_commit
-		NEWHEAD=$(cat "$REWRITTEN"/$OLDHEAD)
+		if test -f "$REWRITTEN"/$OLDHEAD
+		then
+			NEWHEAD=$(cat "$REWRITTEN"/$OLDHEAD)
+		else
+			NEWHEAD=$OLDHEAD
+		fi
 	else
 		NEWHEAD=$(git rev-parse HEAD)
 	fi &&
diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh
index 907c7f9..74a7eb3 100755
--- a/t/t3404-rebase-interactive.sh
+++ b/t/t3404-rebase-interactive.sh
@@ -184,6 +184,12 @@ test_expect_success 'retain authorship when squashing' '
 	git show HEAD | grep "^Author: Twerp Snog"
 '
 
+test_expect_success '-p handles "no changes" gracefully' '
+	HEAD=$(git rev-parse HEAD) &&
+	git rebase -i -p HEAD^ &&
+	test $HEAD = $(git rev-parse HEAD)
+'
+
 test_expect_success 'preserve merges with -p' '
 	git checkout -b to-be-preserved master^ &&
 	: > unrelated-file &&
-- 
1.5.4.rc0.59.g1d10d

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH w/ test] rebase -p -i: handle "no changes" gracefully
  2007-12-17 21:01         ` [PATCH w/ test] " Johannes Schindelin
@ 2007-12-18 20:24           ` Junio C Hamano
  0 siblings, 0 replies; 7+ messages in thread
From: Junio C Hamano @ 2007-12-18 20:24 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: Pieter de Bie, Johannes Sixt, git

Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:

> Since commit 376ccb8cbb453343998e734d8a1ce79f57a4e092, unchanged
> SHA-1s are no longer mapped via $REWRITTEN.  But the updating
> phase was not prepared for the old head not being rewritten.
>
> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
> ---
>
> 	On Mon, 17 Dec 2007, Junio C Hamano wrote:
>
> 	> Hmph, care to add a test to t3404?
>
> 	How about this?

Looks good.  Thanks.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2007-12-18 20:25 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-14  1:21 [BUG?] git rebase -i Pieter de Bie
2007-12-14  7:30 ` Johannes Sixt
2007-12-17 16:04   ` Pieter de Bie
2007-12-17 16:59     ` [PATCH] rebase -p -i: handle "no changes" gracefully Johannes Schindelin
2007-12-17 20:23       ` Junio C Hamano
2007-12-17 21:01         ` [PATCH w/ test] " Johannes Schindelin
2007-12-18 20:24           ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).