Re: [RFC] Add "edit" action for interactive rebase?

2012-09-10 Thread Andrew Wong
On Mon, Sep 10, 2012 at 2:28 PM, Johannes Sixt  wrote:
> Did you think about what can go wrong? For example, starting with this
> todo sheet:
>
>   exec false
>   pick 1234567

Ah, that's definitely a problem.

I was going to say we probably just to check the "done" file, same as
the one we do for a fresh "rebase -i", but it turns out the "exec
false" will fool the "has_action" check for a fresh "rebase -i" too.
Heh.

Maybe we should improve the check for a fresh "rebase -i" case, then
we can do the same check for this case. Maybe we can grep for a "pick"
in "done" file? Or we can check if there's anything in "rewritten"?
Though I'm not sure if any of those is really foolproof. Or should we
just ignore this case and assume the user knows what s/he's doing?

Incidentally, if the starting todo file is:
pick A
exec false
pick B

If the user then changes the "pick B" to "squash B", it should be a
valid I think, and "rebase -i" should handle that properly. It should,
because that's the same thing as:
pick C (which results in a conflict and stopped)
squash D

OT: That "exec false" !
I ran into numerous occasions where I wanted to manually do something
before the "first commit after upstream", such as creating a new
commit or merge.  And I only had two ways of doing it:
1. to rebase against "upstream^", and then mark the upstream as edit
2. insert a "exec bash" in front of the "first commit"
But "exec false" will work much much nicer. :)
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [RFC] Add "edit" action for interactive rebase?

2012-09-10 Thread Johannes Sixt
Am 10.09.2012 18:14, schrieb Andrew Wong:
> Occasionally, while I'm in the middle of an interactive rebase, I'd change my
> mind about the todo list and want to modify it.  This means manually digging
> out the todo file from the rebase directory, and invoking the editor.  So I
> thought it might be convenient to have an "edit" action that simply invokes 
> the
> editor on the todo file but do nothing else.
> 
> This should be safe to do in the middle of a rebase, since we don't preprocess
> the todo file and generate any state from it.  I've also been manually editing
> the todo file a while now, and I never ran into any issues.
> 
> I wonder if any others have ever ran into this situation, and would this be
> a useful feature to have in interactive rebase? Comments?

Applause! A very welcome addition. I've found myself editing the todo
list every now and then, and I'd like to do that more often. This new
feature would make it dead simple.

Did you think about what can go wrong? For example, starting with this
todo sheet:

  exec false
  pick 1234567

and then the user changes the 'pick' to 'squash' after rebase stopped at
the failed 'exec' command.

-- Hannes

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html