threads / discuss / 17123

rebase-merge/done: No such file or directory

Subject: rebase-merge/done: No such file or directory

## tl;dr

5 messages between Jan 12, 2009 and Jan 13, 2009.

replies: 4people: 5as markdown or json

jidanni@jidanni.org· Jan 12, 2009, 19:13 UTC · lore
Bug at git-rebase--interactive.sh:107: count=$(grep -c '^[^#]' < "$DONE")
$DONE might not exist. Do test -f $DONE before you grep it.
This will happen if the user gave a wrong squash choice.

$ git rebase --interactive ... Waiting for Emacs... grep: .git/rebase-merge/done: No such file or directory Cannot 'squash' without a previous commit

Johannes Schindelin· Jan 12, 2009, 22:47 UTC · re: jidanni@jidanni.org · lore

Re: rebase-merge/done: No such file or directory

Hi,
On Tue, 13 Jan 2009, jidanni@jidanni.org wrote:
> Bug at git-rebase--interactive.sh:107: count=$(grep -c '^[^#]' < "$DONE")
Woohoo.  Buuuug.
> $DONE might not exist. Do test -f $DONE before you grep it.

I cannot reproduce here. Since all the files in .git/rebase-merge/ are internal files to rebase--interactive, I think we do not have to guard against any possible user action rendering assumptions about internals invalid.

Wasting a minute, I seem to understand why I cannot reproduce. Just looking all of _two_ lines above the line you mentioned:

	sed -e 1q < "$TODO" >> "$DONE"

Hrmpf. You're right. The user could have removed "$DONE"e between the two lines ;-)

Hth, Dscho

Adeodato Simó· Jan 12, 2009, 23:02 UTC · re: Johannes Schindelin · lore

Re: rebase-merge/done: No such file or directory

* Johannes Schindelin [Mon, 12 Jan 2009 23:47:47 +0100]:
> > $DONE might not exist. Do test -f $DONE before you grep it.
> I cannot reproduce here.  Since all the files in .git/rebase-merge/ are 
> internal files to rebase--interactive, I think we do not have to guard 
> against any possible user action rendering assumptions about internals 
> invalid.
> Wasting a minute, I seem to understand why I cannot reproduce.  Just 
> looking all of _two_ lines above the line you mentioned:
> 	sed -e 1q < "$TODO" >> "$DONE"
> Hrmpf.  You're right.  The user could have removed "$DONE"e between the 
> two lines ;-)

No, not really. Start a rebase -i. Change the *first* "pick" to a "squash". Save and exit the editor. You'll see the output jidanni mentioned:

  grep: .git/rebase-merge/done: No such file or directory
  Cannot 'squash' without a previous commit

The second line tells the user what happened (what their error was), but I guess we could do without the first one.

-- 
Adeodato Simó                                     dato at net.com.org.es
Debian Developer                                  adeodato at debian.org
 
Debugging is twice as hard as writing the code in the first place. Therefore,
if you write the code as cleverly as possible, you are, by definition, not
smart enough to debug it.
                -- Brian W. Kernighan
Pierre Habouzit· Jan 12, 2009, 23:09 UTC · re: Adeodato Simó · lore

[PATCH] Avoid spurious error messages on error mistakes.

Prior to that, if the user chose "squash" as a first action, the stderr looked like:

    grep: /home/madcoder/dev/scm/git/.git/rebase-merge/done: No such file or directory
    Cannot 'squash' without a previous commit
Now the first line is gone.
Signed-off-by: Pierre Habouzit <madcoder@debian.org>
---
 git-rebase--interactive.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh
index c8b0861..8ed2244 100755
--- a/git-rebase--interactive.sh
+++ b/git-rebase--interactive.sh
@@ -349,7 +349,7 @@ do_next () {
 	squash|s)
 		comment_for_reflog squash
 
-		has_action "$DONE" ||
+		test -f "$DONE" && has_action "$DONE" ||
 			die "Cannot 'squash' without a previous commit"
 
 		mark_action_done
-- 
1.6.1.161.g5e07b.dirty
Junio C Hamano· Jan 13, 2009, 08:20 UTC · re: Pierre Habouzit · lore

Re: [PATCH] Avoid spurious error messages on error mistakes.

Pierre Habouzit <madcoder@debian.org> writes:
Show 28 quoted lines
> Prior to that, if the user chose "squash" as a first action, the stderr
> looked like:
>
>     grep: /home/madcoder/dev/scm/git/.git/rebase-merge/done: No such file or directory
>     Cannot 'squash' without a previous commit
>
> Now the first line is gone.
>
> Signed-off-by: Pierre Habouzit <madcoder@debian.org>
> ---
>  git-rebase--interactive.sh |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh
> index c8b0861..8ed2244 100755
> --- a/git-rebase--interactive.sh
> +++ b/git-rebase--interactive.sh
> @@ -349,7 +349,7 @@ do_next () {
>  	squash|s)
>  		comment_for_reflog squash
>  
> -		has_action "$DONE" ||
> +		test -f "$DONE" && has_action "$DONE" ||
>  			die "Cannot 'squash' without a previous commit"
>  
>  		mark_action_done
> -- 
> 1.6.1.161.g5e07b.dirty
Make sense.  Will apply to maint.

← back to recent threads