Thread (2 messages) flat view 2 messages, 2 authors, 2016-06-15

Re: [PATCH v4 1/3] user-manual: Reorganize the reroll sections, adding 'git rebase -i'

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:56:12

"W. Trevor King" [off-list ref] writes:
From: "W. Trevor King" <redacted>

I think this interface is often more convenient than extended cherry
picking or using 'git format-patch'.  In fact, I removed the
cherry-pick section entirely.  The entry-level suggestions for
rerolling are now:

1. git commit --amend
2. git format-patch origin
   git reset --hard origin
   ...edit and reorder patches...
   git am *.patch
3. git rebase -i origin

Signed-off-by: W. Trevor King <redacted>
---
Thanks.
+Sometimes you want to edit a commit deeper in your history.  One
+approach is to use `git format-patch` to create a series of patches,
+then reset the state to before the patches:
 
 -------------------------------------------------
+$ git format-patch origin
+$ git reset --hard origin
 -------------------------------------------------
Technically speaking, this does not "reset to before the patches".
You would need "git reset --hard $(git merge-base origin HEAD)" or
something like that.

I think this is fine as-is in the flow of text, where we haven't
taught the readers the use of merge-base to find the fork point.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help