Re: [ANNOUNCE] pg - A patch porcelain for GIT
- From
Karl Hasselström <kha@treskal.com>
- Date
- Feb 14, 2006, 16:07 UTC
- Message-ID
- <20060214160747.GA6350@diana.vm.bytemark.co.uk>
- In-Reply-To
- <43F1F5CB.10402@citi.umich.edu>
On 2006-02-14 10:22:51 -0500, Chuck Lever wrote:
Show 23 quoted lines
> Karl Hasselström wrote: > > > One thing I would like to see in stgit is the opposite of "stg > > commit"; instead of converting patches to regular commits, take > > the topmost regular commits and convert them to patches. > > > > For example, "stg uncommit foo bar baz" would -- regardless of any > > existing patches, applied or not -- convert the top three regular > > commits, with comments and all, to stgit patches called foo, bar, > > and baz. These would be already applied, at the bottom of the > > stack. I imagine all one would have to do is to modify some stgit > > metadata, so the operation could be really cheap. > > > > Of course, "stg uncommit" is allowed to reject any commit with > > more than one parent, since those can't be represented as stgit > > patches. > > > > This would perhaps not add much power to an all-stgit workflow, > > but it would be a really convenient way to edit recent git > > history. Sort of like a more convenient rebase. And a great way to > > lure new users. :-) > > i think you want "stg pick --reverse" ?
No, I literally want the opposite of "stg commit", so that the sequence "stg commit; stg uncommit" has zero net effect.
Say we have the following situation (stack growing downward, of course):
:
|
a
|
b
|
c <- bases/master
|
d <- applied patch "foo"
|
e <- applied patch "bar"; HEAD
|
f <- unapplied patch "baz"
|
:In this situation, the hypothetical "stg uncommit" command would have the following effect:
$ stg uncommit goo baa
:
|
a <- bases/master
|
b <- applied patch "baa"
|
c <- applied patch "goo"
|
d <- applied patch "foo"
|
e <- applied patch "bar"; HEAD
|
f <- unapplied patch "baz"
|
:Note that HEAD is unchanged; the only thing that has happend is that stgit has taken over the topmost two commits, and turned them into patches. No git operations whatsoever have taken place; all stgit had to do was change the value of bases/master and add bookkeeping information for the two new patches.
--
Karl Hasselström, kha@treskal.com
www.treskal.com/kalle