[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

[RFC] Extending/replacing changelists with stackable patches

From: Blair Zajac <blair_at_orcaware.com>
Date: Thu, 25 Jun 2009 19:46:58 -0700

I've recently been using stacked git (stg) to work in a git svn clone
of our Subversion repository. This has enabled me to replace my 10+
working copies, named foo-1 through foo-10, with a single working
copy. One problem with 10 working copies is that I forget which one
has what work in it and also finding a new clean working copy when I
need to start new work. With stg, I get a feature similar to svn
changeslists, but I get named patches that form a stack of patches,
that I can push, pop and reorder, before committing. I also get the
ability to have a single file be modified in separate patches and

The typical workflow is

stg new my-new-patch-1 # make a new empty patch
vi foobar
fi barfoo
stg refresh # now my-new-patch-1 contains those changes
vi foobar # new changes don't exist in a patch yet
stg new my-new-patch-2 # make a new empty patch
stg refresh # now the second edit of foobar is in the 2nd
patch
stg pop -a # pop all patches, wc now contains no changes
vi bazbaz # boss called, work on something else
stg new fix-bazbaz # start new patch
stg refresh # fix-bazbaz now contains fix for bazbaz
stg commit # commit fix-bazbaz into git
git svn dcommit # commit fix-bazbaz into svn
stg push -n 2 # push the first two patches onto the stack and
into wc
vi foobar # put more changes into foobar
stg refresh # refresh my-new-patch-2
stg commit # commit my-new-patch-1 and my-new-patch-2 into
git
git svn dcommit # commit my-new-patch-1 and my-new-patch-2 into
svn

I've found this to be very useful and nice and has made my life much
easier.

Notable differences between svn changelists:

1) There is no act of having to put each file into a changelist. The
refresh command just associated any outstanding diffs with the patch
on the top of the stack.
2) The same file can be modified in different patches.

I think the second one is the big one. Changelists do not work around
the issue of multiple separate logical changes modifying the same
file, so you still can end up with multiple working copies.

Without getting into the DVCS issue this idea based on, I think this
feature could be nicely implemented in svn to give a sense of offline-
commits.

When the user runs an 'svn update' the client could pop all patches,
do the update, then push the patches onto the stack and into the wc
one by one, at which point conflicts could be handled.

I understand stg is similar to quilt, which I haven't used.

Blair

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2365567
Received on 2009-06-26 04:48:31 CEST

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.