Git development
 help / color / mirror / Atom feed
* [PATCH] Note the use of "rebase -i" to squash consecutive commits into one.
@ 2008-08-17 22:32 Eric Hanchrow
  2008-08-19  3:32 ` Junio C Hamano
  0 siblings, 1 reply; 2+ messages in thread
From: Eric Hanchrow @ 2008-08-17 22:32 UTC (permalink / raw)
  To: git; +Cc: Eric Hanchrow

---
 Documentation/git-rebase.txt |   24 +++++++++++++++++++++++-
 1 files changed, 23 insertions(+), 1 deletions(-)

diff --git a/Documentation/git-rebase.txt b/Documentation/git-rebase.txt
index 59c1b02..074f38b 100644
--- a/Documentation/git-rebase.txt
+++ b/Documentation/git-rebase.txt
@@ -341,7 +341,29 @@ was HEAD~4 becomes the new HEAD. To achieve that, you would call
 $ git rebase -i HEAD~5
 ----------------------
 
-And move the first patch to the end of the list.
+And move the first patch to the end of the list.  Similarly, you can
+squash a bunch of consecutive commits into one commit.  If you start
+with this:
+
+------------
+    Q---R---S---T---U master
+------------
+
+then the command
+
+----------------------
+$ git rebase -i HEAD~3
+----------------------
+
+would let you edit the last three commits -- S, T, and U; if you
+edit the lines corresponding to T and U by changing "pick" to
+"squash", the result will be
+
+------------
+    Q---R---S' master
+------------
+
+where S' contains all the changes that were in S, T, and U.
 
 You might want to preserve merges, if you have a history like this:
 
-- 
1.6.0.rc3.6.gf8030

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

* Re: [PATCH] Note the use of "rebase -i" to squash consecutive commits into one.
  2008-08-17 22:32 [PATCH] Note the use of "rebase -i" to squash consecutive commits into one Eric Hanchrow
@ 2008-08-19  3:32 ` Junio C Hamano
  0 siblings, 0 replies; 2+ messages in thread
From: Junio C Hamano @ 2008-08-19  3:32 UTC (permalink / raw)
  To: Eric Hanchrow; +Cc: git

This is missing sign-off.

More importantly, I do not think adding an extra illustration that starts
talking about an example history that is _different_ from what was being
discussed is a good idea.  The end result lacks coherence and forces the
reader to reset his mind for each example.

I'd suggest you to rewrite the example part that begins a few lines before
you touched.  Present the example "original" history with illustration
first (and call it A---B---C---D---E---F---G, not QRSTU), and clarify the
existing example of reordering the last 5 commits, and show the history
after such reordering.

Then you talk about squashing, with before-and-after illustrations, but
base that illustration on the same example history.  That way, the reader
has to understand the original scene only once to grok both examples.

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

end of thread, other threads:[~2008-08-19  3:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-17 22:32 [PATCH] Note the use of "rebase -i" to squash consecutive commits into one Eric Hanchrow
2008-08-19  3:32 ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox