git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* git rebase +
@ 2011-10-13 11:48 Adam Piatyszek
  2011-10-13 13:21 ` Johannes Sixt
  0 siblings, 1 reply; 7+ messages in thread
From: Adam Piatyszek @ 2011-10-13 11:48 UTC (permalink / raw
  To: git

Hi,

In the middle of "git rebase --continue" process I hit Ctrl+C today to break
this operation. When I tried to replay the same command it errors out with the 
following problem:

ediap@stsrdt1:src/toolfiles: git rebase --continue
Rebasing (2/3)

[Ctrl+C was hit here]

ediap@stsrdt1:src/toolfiles: git rebase --continue
/project/dfttools/libexec/git-core/git-rebase--interactive: line 650: 
/home/ediap/project.git/.git/rebase-merge/author-script: No such file or 
directory

Is this an expected behavior?

Thanks,
/Adam

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

* Re: git rebase +
  2011-10-13 11:48 git rebase + Adam Piatyszek
@ 2011-10-13 13:21 ` Johannes Sixt
  2011-10-14  5:26   ` interrupting "git rebase" (Re: git rebase +) Jonathan Nieder
  0 siblings, 1 reply; 7+ messages in thread
From: Johannes Sixt @ 2011-10-13 13:21 UTC (permalink / raw
  To: Adam Piatyszek; +Cc: git

Am 10/13/2011 13:48, schrieb Adam Piatyszek:
> In the middle of "git rebase --continue" process I hit Ctrl+C today to break
> this operation. When I tried to replay the same command it errors out with the 
> following problem:
> /project/dfttools/libexec/git-core/git-rebase--interactive: line 650: 
> /home/ediap/project.git/.git/rebase-merge/author-script: No such file or 
> directory
> 
> Is this an expected behavior?

Hitting Ctrl-C during git-rebase results undefined behavior. git-rebase is
a shell script and was never designed to operate in any form of atomicity.

You should have let it run until it stopped. Then you could have said 'git
rebase --abort' (if it didn't complete) or 'git reset --hard ORIG_HEAD'
(if it completed).

-- Hannes

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

* interrupting "git rebase" (Re: git rebase +)
  2011-10-13 13:21 ` Johannes Sixt
@ 2011-10-14  5:26   ` Jonathan Nieder
  2011-10-14  5:29     ` Jonathan Nieder
  2011-10-15 15:23     ` Martin von Zweigbergk
  0 siblings, 2 replies; 7+ messages in thread
From: Jonathan Nieder @ 2011-10-14  5:26 UTC (permalink / raw
  To: Johannes Sixt; +Cc: Adam Piatyszek, git, Martin von Zweigbergk

Johannes Sixt wrote:

> Hitting Ctrl-C during git-rebase results undefined behavior. git-rebase is
> a shell script and was never designed to operate in any form of atomicity.
>
> You should have let it run until it stopped.

Wait, really?  That's bad, and unlike most git commands.

> Then you could have said 'git
> rebase --abort' (if it didn't complete) or 'git reset --hard ORIG_HEAD'
> (if it completed).

If interrupting the rebase leaves the repository in a state that

	rm -fr .git/rebase-apply
	git reset --hard <appropriate commit name>

cannot recover from, I'd consider it a serious problem.

By the way, what happened to the "git rebase --abort-softly" synonym
for "rm -fr .git/rebase-apply" discussed a while ago?

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

* Re: interrupting "git rebase" (Re: git rebase +)
  2011-10-14  5:26   ` interrupting "git rebase" (Re: git rebase +) Jonathan Nieder
@ 2011-10-14  5:29     ` Jonathan Nieder
  2011-10-15 15:23     ` Martin von Zweigbergk
  1 sibling, 0 replies; 7+ messages in thread
From: Jonathan Nieder @ 2011-10-14  5:29 UTC (permalink / raw
  To: Johannes Sixt; +Cc: Adam Piatyszek, git, Martin von Zweigbergk

Jonathan Nieder wrote:

> By the way, what happened to the "git rebase --abort-softly" synonym
> for "rm -fr .git/rebase-apply" discussed a while ago?

(Here's a pointer I should have included[1].  Sorry for the noise.)

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

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

* Re: interrupting "git rebase" (Re: git rebase +)
  2011-10-14  5:26   ` interrupting "git rebase" (Re: git rebase +) Jonathan Nieder
  2011-10-14  5:29     ` Jonathan Nieder
@ 2011-10-15 15:23     ` Martin von Zweigbergk
  2011-10-15 19:44       ` Jonathan Nieder
  1 sibling, 1 reply; 7+ messages in thread
From: Martin von Zweigbergk @ 2011-10-15 15:23 UTC (permalink / raw
  To: Jonathan Nieder; +Cc: Johannes Sixt, Adam Piatyszek, git

On Thu, Oct 13, 2011 at 10:26 PM, Jonathan Nieder <jrnieder@gmail.com> wrote:
> Johannes Sixt wrote:
>
>> Hitting Ctrl-C during git-rebase results undefined behavior. git-rebase is
>> a shell script and was never designed to operate in any form of atomicity.
>>
>> You should have let it run until it stopped.
>
> Wait, really?  That's bad, and unlike most git commands.

If Ctrl-C is pressed while the state is being written, it could be
left with incomplete information, yes. It has been like that forever I
think. I'll put it on my todo list, but it will not be my top priority
(and I have very little git time now anyways).

> If interrupting the rebase leaves the repository in a state that
>
>        rm -fr .git/rebase-apply
>        git reset --hard <appropriate commit name>
>
> cannot recover from, I'd consider it a serious problem.

I agree, but I don't know of any way that can happen. Even "git rebase
--abort" should always work (in the sense that
.git/rebase-[apply|merge] would be deleted), although it will not
return to the original branch if some state is missing.

> By the way, what happened to the "git rebase --abort-softly" synonym
> for "rm -fr .git/rebase-apply" discussed a while ago?

I think we simply did not agree on a syntax, but here was also some
discussion about future plans for the sequencer. I remember seeing
some discussions about making "git reset --hard" remove the sequencer
state, but I don't remember the conclusion. It is not clear to me what
is ok to implement in git-rebase nowadays and what would just be
double work if it needs to be re-implemented in the sequencer.

Martin

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

* Re: interrupting "git rebase" (Re: git rebase +)
  2011-10-15 15:23     ` Martin von Zweigbergk
@ 2011-10-15 19:44       ` Jonathan Nieder
  2011-10-17 10:03         ` Ramkumar Ramachandra
  0 siblings, 1 reply; 7+ messages in thread
From: Jonathan Nieder @ 2011-10-15 19:44 UTC (permalink / raw
  To: Martin von Zweigbergk
  Cc: Johannes Sixt, Adam Piatyszek, git, Ramkumar Ramachandra

(+cc: Ram)
Martin von Zweigbergk wrote:
> On Thu, Oct 13, 2011 at 10:26 PM, Jonathan Nieder <jrnieder@gmail.com> wrote:
>> Johannes Sixt wrote:

>>> Hitting Ctrl-C during git-rebase results undefined behavior.
[...]
>> Wait, really?  That's bad, and unlike most git commands.
>
> If Ctrl-C is pressed while the state is being written, it could be
> left with incomplete information, yes. It has been like that forever I
> think. I'll put it on my todo list, but it will not be my top priority
> (and I have very little git time now anyways).

Sorry for the lack of clarity.  That actually sounds fine to me
already, as long as the intermediate state is easy to recover from
(which doesn't match what I usually think of as "undefined behavior").

So it sounds like I was worrying needlessly.

[...]
>> By the way, what happened to the "git rebase --abort-softly" synonym
>> for "rm -fr .git/rebase-apply" discussed a while ago?
>
> I think we simply did not agree on a syntax, but here was also some
> discussion about future plans for the sequencer. I remember seeing
> some discussions about making "git reset --hard" remove the sequencer
> state, but I don't remember the conclusion. It is not clear to me what
> is ok to implement in git-rebase nowadays and what would just be
> double work if it needs to be re-implemented in the sequencer.

I believe a good rule of thumb is that you can always pretend the
sequencer just doesn't exist, and cc Ram when you are unsure. :)

Certainly, a lot of sequencer features were inspired by "git rebase".
Improvements to "git rebase" are only likely to make future
improvements to "git sequencer" easier.  Part of what helps here is
that "git rebase" is a shell script, so it is a little easier to
prototype features there.

Thanks!
Jonathan

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

* Re: interrupting "git rebase" (Re: git rebase +)
  2011-10-15 19:44       ` Jonathan Nieder
@ 2011-10-17 10:03         ` Ramkumar Ramachandra
  0 siblings, 0 replies; 7+ messages in thread
From: Ramkumar Ramachandra @ 2011-10-17 10:03 UTC (permalink / raw
  To: Jonathan Nieder; +Cc: Martin von Zweigbergk, Johannes Sixt, Adam Piatyszek, git

Hi,

Jonathan Nieder writes:
> Martin von Zweigbergk wrote:
>> On Thu, Oct 13, 2011 at 10:26 PM, Jonathan Nieder <jrnieder@gmail.com> wrote:
>>> Johannes Sixt wrote:
>
>>>> Hitting Ctrl-C during git-rebase results undefined behavior.
> [...]
>>> Wait, really?  That's bad, and unlike most git commands.
>>
>> If Ctrl-C is pressed while the state is being written, it could be
>> left with incomplete information, yes. It has been like that forever I
>> think. I'll put it on my todo list, but it will not be my top priority
>> (and I have very little git time now anyways).
> [...]

Ah, yes.  I've been bitten by this behavior several times myself :)

>>> By the way, what happened to the "git rebase --abort-softly" synonym
>>> for "rm -fr .git/rebase-apply" discussed a while ago?
>>
>> I think we simply did not agree on a syntax, but here was also some
>> discussion about future plans for the sequencer. I remember seeing
>> some discussions about making "git reset --hard" remove the sequencer
>> state, but I don't remember the conclusion. It is not clear to me what
>> is ok to implement in git-rebase nowadays and what would just be
>> double work if it needs to be re-implemented in the sequencer.
> [...]
> Certainly, a lot of sequencer features were inspired by "git rebase".
> Improvements to "git rebase" are only likely to make future
> improvements to "git sequencer" easier.  Part of what helps here is
> that "git rebase" is a shell script, so it is a little easier to
> prototype features there.

I concur.  Work on `git rebase` should continue independently of the
sequencer because that's where we pick up ideas from!  I don't see it
as double-work: simply a translation of ideas.  Apart from the fixup
mini-series, the overall interface of the sequencer is still very
unclear to me (see long discussion with Junio, Jonathan).

Yes, 95eb88 (reset: Make reset remove the sequencer state, 2011-08-04)
is merged.  But it's pretty unrelated to the main issue at hand: sure,
"reset --hard" is a great hammer, but that shouldn't prevent us from
developing tools and interfaces that are more sophisticated and
elegant, no?  In other words, I think "--abort-softly" is a great
idea: we should pour ideas into our shell scripts!

Thanks.

-- Ram

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

end of thread, other threads:[~2011-10-17 10:03 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-13 11:48 git rebase + Adam Piatyszek
2011-10-13 13:21 ` Johannes Sixt
2011-10-14  5:26   ` interrupting "git rebase" (Re: git rebase +) Jonathan Nieder
2011-10-14  5:29     ` Jonathan Nieder
2011-10-15 15:23     ` Martin von Zweigbergk
2011-10-15 19:44       ` Jonathan Nieder
2011-10-17 10:03         ` Ramkumar Ramachandra

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).