Re: multiple-commit cherry-pick?

3 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: multiple-commit cherry-pick?

From: Miles Bader <hidden>
Date: 2016-06-15 22:45:37

Björn Steinbrink [off-list ref] writes:
quoted
quoted
git reset --hard C
git rebase --onto ORIG_HEAD A^
Is that safe...?  Doesn't git-rebase also set ORIG_HEAD?
One of the first things rebase does is validating and resolving its
arguments. And that's happening before any actions that would touch
ORIG_HEAD.
Ah, I see.

Hmm, I guess using rebase --abort isn't a very good idea in this case
though... :-/

Kind of a shame, since it's nice being to just abort the whole operation
if it turns out you did something wrong and aren't sure how to recover.

Thanks,

-Miles

-- 
Kilt, n. A costume sometimes worn by Scotchmen [sic] in America and Americans
in Scotland.

Re: multiple-commit cherry-pick?

From: Björn Steinbrink <hidden>
Date: 2016-06-15 22:45:37

On 2008.11.07 14:09:07 +0900, Miles Bader wrote:
Björn Steinbrink [off-list ref] writes:
quoted
quoted
quoted
git reset --hard C
git rebase --onto ORIG_HEAD A^
Is that safe...?  Doesn't git-rebase also set ORIG_HEAD?
One of the first things rebase does is validating and resolving its
arguments. And that's happening before any actions that would touch
ORIG_HEAD.
Ah, I see.

Hmm, I guess using rebase --abort isn't a very good idea in this case
though... :-/
Why not? I mean, ok, you end up at C, and not where you have been before
the reset --hard, but there's the reflog to help you get back to
whatever previous state of the branch it is that you want.

Björn

Re: multiple-commit cherry-pick?

From: Miles Bader <hidden>
Date: 2016-06-15 22:45:37

quoted
quoted
quoted
quoted
git reset --hard C
git rebase --onto ORIG_HEAD A^
quoted
Hmm, I guess using rebase --abort isn't a very good idea in this case
though... :-/
Why not? I mean, ok, you end up at C, and not where you have been before
the reset --hard, but there's the reflog to help you get back to
whatever previous state of the branch it is that you want.
I just mean it's not a trivial way to get back to the state before the
multi-cherry-pick -- you need to know the details of what's going on,
and handle the rest of the cleanup manually.

So, for instance, if you were to package up the above commands in a
shell script, the abort issue is one of those rough edges which would
prevent it from being as convenient as a real git command.  [A
hypothetical extension of the cherry-pick command to handle multiple
commits would presumably offer a "cherry-pick --abort" option that did
everything magically.]

-Miles

-- 
Do not taunt Happy Fun Ball.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help