git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Andreas Ericsson <ae@op5.se>
To: Russ Brown <pickscrape@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: Workflow question
Date: Tue, 25 Sep 2007 21:09:00 +0200	[thread overview]
Message-ID: <46F95CCC.4080209@op5.se> (raw)
In-Reply-To: <46F93A99.5080707@gmail.com>

Russ Brown wrote:
> Hi,
> 
> I've been trying to think of a git workflow that we could use to replace
> our current svn/svk setup without simply using git in exactly the same
> way that we use svn/svk.
> 
> Basically, we develop, maintain and enhance a website. On the central
> repo is trunk which represents live, and any number of project branches.
> Developers don't use local branches: they check out the project branches
> they're working on and commit to those. Developers merge from trunk to
> project branch from time to time to keep them current, and when a
> project rolls out the branch is merged to trunk.
> 
> In addition to the obvious advantages that git would give us (such as
> properly tracking that code author as opposed to the person who did the
> merge), I'm wanting to gain the following benefits:
> 
>  * The repository is very large (multiple gigabytes) and mirroring using
> svk obviously takes a lot of time and space, so I'm keen to bring that
> down, most likely by the developer not needing to mirror branches he
> doesn't care about, or by being able to throw away branches he's done with.
>  * The repository is full of revisions that fail review (or break
> things) and are fixed by subsequent revisions. We'd much rather be able
> to have the developer fix his revisions before they get committed
> 'upstream' (whatever that ends up meaning).
> 
> I asked earlier about the email-based model that git itself uses, and
> while it appears to work very well for a widely-dispersed open-source
> project, I think it will be too cumbersome and slow for a fast-paced
> internal development team who make a number of live releases every day.
> 

We came to the same conclusion at our workplace. Email works great, but
it's faster and better to just walk over to your colleague and ask what
he/she thinks about something.

> So, I've been thinking and have come up with this, which I'd appreciate
> comments about:
> 
>  1. On a server we stick a git repository which contains the master
> branch, which represents what trunk did (i.e. the live platform). This
> branch contains the full history for the live platform.

A must-have for any more-than-two-developers setup, so so far so good ;-)

>  2. On the same server we clone that repo to create a second repository
> which is the developer area. In this we track master from the live repo,
> and also create project branches.

This isn't necessary. Branches in git are very nearly zero-cost, so having
them in the same repo as the master branch won't hurt a bit. You can add
an update-hook on the mothership repo to restrict access to the master
branch if you like, but creating two separate repos will likely give
more headache than it's worth.

>  3. Developers clone this developer repo, but I'd like them to be able
> to decide which branches they actually want to clone from that
> repository rather than simply cloning them all. Is this possible?

Yes, although I'd actually recommend you to clone the full repo anyway.
Since the various branches are likely to share quite a lot of history
the added overhead of a few extra branches will most likely be negligible.
git makes even very large codebases appear small and unobtrusive. The
linux kernel history since 2.6.12 contains 554853 objects and compresses
down to 178MiB.

I think KDE is the largest repo imported to git so far. I've forgotten
the exact numbers, but everyone was very impressed, and quite surprised,
at the vast difference between SVN and git storage requirements.


>  4. Developers create a local branch of the project they
> are working on and commit to that.
>  5. Once they think they're done, they publish their branch to the
> development repo and request for comments.

Using topic-branches is a much better strategy, usually, since that
allows each feature to be evaluated and improved on on its own, rather
than having to merge *all* of a particular developers changes just to
get desirable feature X. Note that cherry-pick provides ways of doing
that anyways, but in a much less elegant way, and your integrator/
release engineer will likely tear his hair out on a daily basis without
topic branches.

>  6. If all is not well, the developer creates a new local branch and
> moves good revisions from his previous one to the new one, modifying
> things as he goes, and republishes his new branch.
>  7. If all is well, their works gets merged or rebased onto the main
> project branch, and once that's ready it gets pushed to the master and
> rolled to live. The developer's individual branches get deleted from the
> dev repo since they're no longer required.

Topic branches would work the same, basically, except they can be pushed up
for review a lot faster.

If all the pushing gets cumbersome, it also makes it easy to send the patches
out as emails for discussion. It's usually easier to let git handle the
actual code transmissions, but discussing patches in emails works quite
well if it's intended for a wider audience.

>  8. From time to time the master branch gets merged to the project
> branches. Developer's local branches can be rebased against the project
> branch as they please.
> 

criss-cross merging can turn kinda nasty though, as you may have a hard time
finding *the* common point when you run into that rogue merge with conflict
markers everywhere (it happens for everyone sooner or later).

I'd suggest you rebase the developer/topic branches onto master with regular
intervals instead.

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

  reply	other threads:[~2007-09-25 19:09 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-25 16:43 Workflow question Russ Brown
2007-09-25 19:09 ` Andreas Ericsson [this message]
2007-09-25 19:34   ` Jeff King
2007-09-25 19:50     ` Wincent Colaiuta
2007-09-25 20:20       ` Jeff King
2007-09-25 20:37         ` Wincent Colaiuta
2007-09-25 19:42   ` Russ Brown
2007-09-25 20:17     ` Jeff King
2007-09-25 20:56       ` Russ Brown
2007-09-25 21:28         ` Junio C Hamano
2007-09-26  0:01           ` Russ Brown
2007-09-26  0:47         ` Jeff King
2007-09-26  1:51           ` Karl Hasselström
2007-09-26  2:55           ` Russ Brown
2007-09-26  5:29             ` Junio C Hamano
2007-09-26 12:42             ` Jeff King
2007-09-25 22:38     ` Andreas Ericsson
  -- strict thread matches above, loose matches on Subject: below --
2007-07-24 13:53 workflow question Patrick Doyle
2007-07-24 15:37 ` Alex Riesen
2007-07-24 16:30   ` Patrick Doyle
2007-07-24 16:35     ` Julian Phillips
2007-07-24 20:54       ` Alex Riesen
2007-07-24 20:57     ` Alex Riesen
2007-07-24 21:00       ` J. Bruce Fields
2007-07-24 21:38         ` Linus Torvalds

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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=46F95CCC.4080209@op5.se \
    --to=ae@op5.se \
    --cc=git@vger.kernel.org \
    --cc=pickscrape@gmail.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).