git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steven Walter <stevenrwalter@gmail.com>
To: Steven Grimm <koreth@midwinter.com>
Cc: Steven Walter <stevenrwalter@gmail.com>, 'git' <git@vger.kernel.org>
Subject: Re: StGIT (or guilt) + git-svn?
Date: Wed, 25 Jul 2007 18:25:09 -0400	[thread overview]
Message-ID: <20070725222509.GA21274@dervierte> (raw)
In-Reply-To: <46A6EF24.4040606@midwinter.com>

On Wed, Jul 25, 2007 at 02:35:16PM +0800, Steven Grimm wrote:
> Do you mix your public and private commits on the private branch, then 
> cherry-pick some of them over to the public branch before running 
> dcommit? Or do you have some other workflow?

Yes, what you describe is what I usually do.

> That was actually my first suggestion to him, but he pointed out (and I 
> had to agree) that that would mean he's always just one mistake away 
> from publishing his local changes. All it takes is getting interrupted 
> for a moment and mistakenly thinking he already switched to the public 
> branch. He wants some less human-error-prone way to tell the system that 
> a particular change and/or a particular file is not intended for 
> publication, and for the system to just honor that without further human 
> intervention.

If I wanted to be argumentative, you're still only one step from
disaster with stgit.  In order to build, you'd have to keep your local
changes applied.  If you forgot to pop them before a dcommit, they would
be published.

> Actually, one could argue that the above isn't a git-svn issue at all. 
> You could reasonably want the same thing from git-push too (and even 
> from pull, though that'd be trickier.) I guess it'd take the form of 
> marking a commit as local-only, and having the system automatically 
> rebase all the local-only commits on top of the public ones.
> 
> Maybe a wrapper than maintains a pair of underlying git branches for 
> each user-visible branch would work. If you have a branch "foo" with 
> some public and some private changes (private ones in lower case here):
> 
> A---B---C---D---e---f---g   foo
>            ^ foo-public
> 
> Now if you commit a new private revision, it's like normal:
> 
> A---B---C---D---e---f---g---h   foo
>            ^ foo-public
> 
> But if you commit a new public revision, we do something like
> 
> git commit
> git checkout foo-public
> git cherry-pick foo
> git checkout foo
> git rebase foo-public
> 
> to get
> 
> A---B---C---D---H---e---f---g   foo
>                ^ foo-public
> 
> Then, when it comes time to do the push / dcommit, we always switch to 
> the foo-public branch first. We push / dcommit, then checkout foo and 
> rebase it on foo-public again (since svn dcommit will leave foo-public 
> pointing at a different revision.)
> 
> This seems like it should work in the context of git-svn with its 
> mostly-linear history. Not sure if it'd fall flat on its face in the 
> presence of lots of branching and merging.
> 
> I also suspect I've more or less just described StGIT and this would be 
> a big waste of time to reinvent from scratch.

This actually sounds fairly useful, as it's mostly the automation of my
existing workflow.  Let me know if you follow up on this.
-- 
-Steven Walter <stevenrwalter@gmail.com>
"A human being should be able to change a diaper, plan an invasion,
butcher a hog, conn a ship, design a building, write a sonnet, balance
accounts, build a wall, set a bone, comfort the dying, take orders,
give orders, cooperate, act alone, solve equations, analyze a new
problem, pitch manure, program a computer, cook a tasty meal, fight
efficiently, die gallantly. Specialization is for insects."
   -Robert Heinlein

      reply	other threads:[~2007-07-25 22:25 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-24 10:20 StGIT (or guilt) + git-svn? Steven Grimm
2007-07-24 11:27 ` Steven Walter
2007-07-24 12:19   ` Steven Grimm
2007-07-24 19:39     ` Josef Sipek
2007-07-24 23:48     ` Steven Walter
2007-07-25  6:35       ` Steven Grimm
2007-07-25 22:25         ` Steven Walter [this message]

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=20070725222509.GA21274@dervierte \
    --to=stevenrwalter@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=koreth@midwinter.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.
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).