From: Johannes Schindelin <Johannes.Schindelin@gmx.de>
To: VMiklos <vmiklos@frugalware.org>
Cc: Fredrik Tolf <fredrik@dolda2000.com>, git@vger.kernel.org
Subject: Re: Volume of commits
Date: Thu, 12 Jul 2007 14:59:53 +0100 (BST) [thread overview]
Message-ID: <Pine.LNX.4.64.0707121451290.4516@racer.site> (raw)
In-Reply-To: <20070712132937.GQ19386@genesis.frugalware.org>
Hi,
On Thu, 12 Jul 2007, VMiklos wrote:
> Na Thu, Jul 12, 2007 at 03:16:47PM +0200, Fredrik Tolf <fredrik@dolda2000.com> pisal(a):
> > So what I'm wondering is how you people manage to do this? Do you
> > actually always commit changes this way (and, in that case, how do you
> > switch between branches)? Or do you somehow aggregate the smaller
> > commits into larger patches and recommit them? Or is there some third
> > possibility that I'm missing?
>
> you can cherry-pick the relevan patches to a separate branch and commit
> then at once (cherry-pick -n), or can merge --squash to archive
> something similar
What I do these days is committing early, and often, and then rearrange
with "git rebase -i". Beware: this is a 1.5.3 feature! But IMHO it is
really something you can look forward to.
A little diagram hopefully explains what you can do with it:
- upstream
\
A - B - C - D - E - F - G - HEAD with a messy history
In this case, "messy history" means that there are tiny patches which are
often in the wrong order, or should be squashed into one commit. "git
rebase -i upstream" presents you with the list of A - HEAD, and you can
reorder the patches. If you want to, you can combine ("squash") some
into one commit, or you can skip it, by removing the corresponding line.
The result can look like this:
- upstream
\
B+C+F - A - G+E
Note that D is missing, which can be desirable, for example when you made
a commit only introducing lots and lots of debug output. See, nobody has
to know what you did. The end result will look elegant.
This demonstration of why distributed SCM is good ("it lowers the
embarrasment factor") was brought to you by Git.
Ciao,
Dscho
next prev parent reply other threads:[~2007-07-12 14:00 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-12 13:16 Volume of commits Fredrik Tolf
2007-07-12 13:29 ` VMiklos
2007-07-12 13:59 ` Johannes Schindelin [this message]
2007-07-13 10:30 ` Sven Verdoolaege
2007-07-13 12:46 ` Alex Riesen
2007-07-21 17:09 ` [PATCH] rebase -i: call editor just once for a multi-squash Johannes Schindelin
2007-07-21 17:12 ` Volume of commits Johannes Schindelin
2007-07-12 13:49 ` Karl Hasselström
2007-07-12 14:03 ` Karl Hasselström
2007-07-12 14:51 ` Fredrik Tolf
2007-07-12 16:09 ` Joshua N Pritikin
2007-07-12 16:21 ` Karl Hasselström
2007-07-12 16:46 ` Linus Torvalds
2007-07-13 0:40 ` Jakub Narebski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Pine.LNX.4.64.0707121451290.4516@racer.site \
--to=johannes.schindelin@gmx.de \
--cc=fredrik@dolda2000.com \
--cc=git@vger.kernel.org \
--cc=vmiklos@frugalware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).