[bug] interactive rebase

12 views
Skip to first unread message

Stephan Hennig

unread,
Apr 16, 2008, 6:02:45 PM4/16/08
to msy...@googlegroups.com
Receipe:
1. git rebase -i HEAD~3
2. (Editor opens.) "Squash" the last commit.
3. Save and exit editor.

Symptoms:
1. The editor now opens again with an empty file named $@.
2. After git-rebase is finished there remains a dangling file $@ in the
working copy.

Expected behaviour:
1. The editor opens with a file showing both commit messages of the two
merged commits as Git-preview20080301.exe did.
2. Working copy has no temporary files after git-rebase.

The bug can be observed with Git 1.5.5.1015.g9d258
(Git-1.5.5-preview20080413.exe).

Thanks,
Stephan Hennig

Steffen Prohaska

unread,
Apr 17, 2008, 1:32:29 AM4/17/08
to mailin...@arcor.de, msy...@googlegroups.com

On Apr 17, 2008, at 12:02 AM, Stephan Hennig wrote:

> Receipe:
> 1. git rebase -i HEAD~3
> 2. (Editor opens.) "Squash" the last commit.
> 3. Save and exit editor.
>
> Symptoms:
> 1. The editor now opens again with an empty file named $@.
> 2. After git-rebase is finished there remains a dangling file $@ in
> the
> working copy.

I cannot reproduce the behavior you describe. Could you send a more
detailed test case? A sequence of simple commands that starts from a
freshly initialized repository would be best. Something like:

git init
echo "a" >>a
git add a
git commit -m "a"
...

Steffen

Stephan Hennig

unread,
Apr 17, 2008, 6:17:05 AM4/17/08
to msy...@googlegroups.com
Steffen Prohaska schrieb:

> On Apr 17, 2008, at 12:02 AM, Stephan Hennig wrote:
>>
>> Symptoms:
>> 1. The editor now opens again with an empty file named $@.
>> 2. After git-rebase is finished there remains a dangling file $@ in
>> the
>> working copy.
>
> I cannot reproduce the behavior you describe. Could you send a more
> detailed test case?

I can reproduce it with different repositories.


> A sequence of simple commands that starts from a
> freshly initialized repository would be best. Something like:

Ok, attached is a short script that initializes a new repository, makes
three commits and then calls git rebase -i to melt the last two commits.
Additionally, I've found another symptom that is probably caused by
this bug.

Receipe:
1. Run the attached script bug-rebase-i.


2. (Editor opens.) Squash the last commit.

3. Save file.
4. Exit editor.
5. (Editor opens with empty file @$.) Type "melted commit".
6. Save file.
7. Exit editor.
8. (Git does rebasing.)
9. (Git shows log message of the melted commit.)

Symptoms:
1. The file opened for choosing a new commit message is empty.


2. After git-rebase is finished there remains a dangling file $@ in the
working copy.

3. The commit message of the melted commit is not

melted commit

but

2

3

That is, the newly typed-in commit message had been discarded and both
old commit messages were appended to form the new commit message.


System:
$ git version
git version 1.5.5.1015.g9d258

Git was installed to run from Msys shell only.

Best regards,
Stephan Hennig

bug-rebase-i

Juanma Barranquero

unread,
Apr 18, 2008, 10:07:10 AM4/18/08
to msysGit
> > On Apr 17, 2008, at 12:02 AM, Stephan Hennig wrote:

> >> Symptoms:
> >> 1. The editor now opens again with an empty file named $@.

With Git-1.5.5-preview20080413.exe, if the editor configured to edit
commit messages contains additional arguments, like

[core]
editor = C:/windows/system32/notepad2.exe /p0

the editor is called with $@ as filename. After removing the " /p0"
above it works (I mean, it edits COMMIT_EDITMSG).

The bug happens for other editors/arguments (for example,
"emacsclient.exe --server-file=server"), and also when using an
environment variable (EDITOR, etc.) instead of the core.editor
configuration option.

Juanma

Steffen Prohaska

unread,
Apr 19, 2008, 3:19:53 AM4/19/08
to Stephan Hennig, msysGit
Stephan,
Please do not cull CC to the list.

On Apr 17, 2008, at 12:17 PM, Stephan Hennig wrote:

> Steffen Prohaska schrieb:
>> On Apr 17, 2008, at 12:02 AM, Stephan Hennig wrote:
>>>
>>> Symptoms:
>>> 1. The editor now opens again with an empty file named $@.
>>> 2. After git-rebase is finished there remains a dangling file $@ in
>>> the
>>> working copy.
>>
>> I cannot reproduce the behavior you describe. Could you send a more
>> detailed test case?
>
> I can reproduce it with different repositories.

Unfortunately, I still cannot reproduce the behavior you describe.

Could someone else try to reproduce the problem?

Steffen

> #!/bin/sh
> mkdir bug-rebase-i-dir
> cd bug-rebase-i-dir
> git init
> echo "1" >> a
> git add a
> git commit -m "1"
> echo "2" >> a
> git add a
> git commit -m "2"
> echo "3" >> a
> git add a
> git commit -m "3"
> git rebase -i HEAD~2
> git log -1


Clifford Caoile

unread,
Apr 19, 2008, 3:42:08 AM4/19/08
to proh...@zib.de, Stephan Hennig, msysGit, Juanma Barranquero
Steffen Prohaska:

On Sat, Apr 19, 2008 at 4:19 PM, Steffen Prohaska <proh...@zib.de> wrote:
> Unfortunately, I still cannot reproduce the behavior you describe.
>
> Could someone else try to reproduce the problem?

Did you see Juanma Barranquero's comment [1]? "With


Git-1.5.5-preview20080413.exe, if the editor configured to edit commit

messages contains additional arguments..."

References:
[1] http://groups.google.com/group/msysgit/msg/6d7cae066f07f47e

Best regards,
Clifford Caoile

Stephan Hennig

unread,
Apr 19, 2008, 8:29:19 AM4/19/08
to msy...@googlegroups.com
Juanma Barranquero schrieb:

> With Git-1.5.5-preview20080413.exe, if the editor configured to edit
> commit messages contains additional arguments, like
>
> [core]
> editor = C:/windows/system32/notepad2.exe /p0
>
> the editor is called with $@ as filename. After removing the " /p0"
> above it works (I mean, it edits COMMIT_EDITMSG).
>
> The bug happens for other editors/arguments (for example,
> "emacsclient.exe --server-file=server"),

My settings are

[core]
editor = c:/programme/wscite/scite.exe -check.if.already.open=0

Indeed, removing the argument to the scite call seems to make msysGit happy.

Best regards,
Stephan Hennig

Reply all
Reply to author
Forward
0 new messages