Re: [RFC] Add "edit" action for interactive rebase?
- From
Andrew Wong <andrew.kw.w@gmail.com>
- Date
- Sep 10, 2012, 20:13 UTC
- Message-ID
- <CADgNjakmRsfqBajpeob0e2pA9tSj5KSS+0m6rkR+9bdBV+ZepA@mail.gmail.com>
- In-Reply-To
- <504E3145.9070006@kdbg.org>
On Mon, Sep 10, 2012 at 2:28 PM, Johannes Sixt <j6t@kdbg.org> wrote:
Show 5 quoted lines
> 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 BIf 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 DOT: 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. :)