From: Daniel Barkalow <barkalow@iabervon.org>
To: Chase Venters <chase.venters@clientec.com>
Cc: linux-kernel@vger.kernel.org, git@vger.kernel.org
Subject: Re: Question about your git habits
Date: Fri, 22 Feb 2008 23:10:48 -0500 (EST) [thread overview]
Message-ID: <alpine.LNX.1.00.0802222249480.19024@iabervon.org> (raw)
In-Reply-To: <200802221837.37680.chase.venters@clientec.com>
On Fri, 22 Feb 2008, Chase Venters wrote:
> I've been making myself more familiar with git lately and I'm curious what
> habits others have adopted. (I know there are a few documents in circulation
> that deal with using git to work on the kernel but I don't think this has
> been specifically covered).
>
> My question is: If you're working on multiple things at once, do you tend to
> clone the entire repository repeatedly into a series of separate working
> directories and do your work there, then pull that work (possibly comprising
> a series of "temporary" commits) back into a separate local master
> respository with --squash, either into "master" or into a branch containing
> the new feature?
>
> Or perhaps you create a temporary topical branch for each thing you are
> working on, and commit arbitrary changes then checkout another branch when
> you need to change gears, finally --squashing the intermediate commits when a
> particular piece of work is done?
I find that the sequence of changes I make is pretty much unrelated to the
sequence of changes that end up in the project's history, because my
changes as I make them involve writing a lot of stubs (so I can build) and
then filling them out. It's beneficial to have version control on this so
that, if I screw up filling out a stub, I can get back to where I was.
Having made a complete series, I then generate a new series of commits,
each of which does one thing, without any bugs that I've resolved, such
that the net result is the end of the messy history, except with any
debugging or useless stuff skipped. It's this series that gets merged into
the project history, and I discard the other history.
The real trick is that the early patches in a lot of series often refactor
existing code in ways that are generally good and necessary for your
eventual outcome, but which you'd never think of until you've written more
of the series. Generating a new commit sequence is necessary to end up
with a history where it looks from the start like you know where you're
going and have everything done that needs to be done when you get to the
point of needing it. Furthermore, you want to be able to test these
commits in isolation, without the distraction of the changes that actually
prompted them, which means that you want to have your working tree is a
state that you never actually had it in as you were developing the end
result.
This means that you'll usually want to rewrite commits for any series that
isn't a single obvious patch, so it's not a big deal to commit any time
you want to work on some different branch.
-Daniel
*This .sig left intentionally blank*
next prev parent reply other threads:[~2008-02-23 4:11 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-23 0:37 Chase Venters
2008-02-23 1:36 ` J.C. Pizarro
2008-02-23 1:37 ` Jan Engelhardt
2008-02-23 1:44 ` Al Viro
2008-02-23 1:51 ` Junio C Hamano
2008-02-23 2:09 ` Al Viro
2008-02-23 2:23 ` J.C. Pizarro
2008-02-23 8:44 ` Alexey Dobriyan
[not found] ` <998d0e4a0802221847m431aa136xa217333b0517b962@mail.gmail.com>
[not found] ` <20080223113952.GA4936@hashpling.org>
2008-02-23 13:08 ` J.C. Pizarro
2008-02-23 13:17 ` Charles Bailey
2008-02-23 13:36 ` J.C. Pizarro
2008-02-23 14:01 ` Charles Bailey
2008-02-23 17:10 ` J.C. Pizarro
2008-02-23 18:19 ` J.C. Pizarro
2008-02-23 4:10 ` Daniel Barkalow [this message]
2008-02-23 5:03 ` Jeff Garzik
2008-02-23 9:18 ` Mike Hommey
2008-02-23 4:39 ` Rene Herman
2008-02-23 8:56 ` Willy Tarreau
2008-02-23 9:10 ` Sam Ravnborg
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=alpine.LNX.1.00.0802222249480.19024@iabervon.org \
--to=barkalow@iabervon.org \
--cc=chase.venters@clientec.com \
--cc=git@vger.kernel.org \
--cc=linux-kernel@vger.kernel.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
all inboxes | Powered by JetHome®