Re: [ANNOUNCE] pg - A patch porcelain for GIT

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Shawn Pearce
Date: Sunday, February 12, 2006 - 11:03 pm

Sam Vilain <sam@vilain.net> wrote:

Yea, that's not a bad idea.  If you are creating a new commit you
probably would want to edit the running description for the patch;
or at least be reminded of what it is.
 

Revisioning doesn't happen for the series, just the individual
patches.  But I've thought about series revisoning and keeping a
secondary GIT index/commit chain external to the main repository
for exactly this purpose.

Each change to a patch (pg-ci) is a new commit object in GIT with
the prior commit object as its parent; if you use pg-ci a few times
with the same patch on the stack then look at the log with git-log
or gitk you'll see the commits are chained together.

When you pop patches and reorder them in the series the resulting
merges are stored as commits with two parents: one for the HEAD
at the time of the merge and one for the commit which was the last
commit in the patch being pushed (HEAD^1 and HEAD^2 respectively).
For example:

	pg-new A
	echo a >>somefile
	pg-ci -m"This is a"
	pg-new B
	echo b >>somefile
	pg-ci -m"This is b"

	pg-pop -a
	pg-push B  # base used to be HEAD+A, now its HEAD
	pg-push A  # base used to be HEAD, now its HEAD+B

The challenge then becomes walking through the merge history.
If you look at pg's own history you'll see an interesting knot
in gitk at a7e73545e511c5c2daea1f6c7bf06cf3179e7f0da (Refreshed
patch Create-Rebase-Tool).  This was produced because I reorded
the patches in the stack and thus had to merge them.  It was an
automatic merge, but it still generated merge commit objects.

Good suggestion about including some details about it in the
tutorial.


pg doesn't currently invoke any user code when an automatic merge
fails during pg-push or pg-rebase.  It does attempt to produce
a 3 way merge and leaves the resulting portions for you in the
filesystem.  If you look at MERGING.txt you'll see that up to 5
files can come out of a merge (here I'm using the tracked file X.c):

	X.c
	X.c-head
	X.c-last
	X.c-pbase
	X.c-rej

These just get left in the filesystem for you to use as you want;
in your case it sounds like you'd want to invoke:

	emacs --eval "(ediff-merge-files-with-ancestor
		\"X.c-head\"
		\"X.c-last\"
		\"X.c-pbase\"
		nil
		\"X.c\"
		)"

X.c already contains the result of performing:

	diff X.c-pbase X.c-last | patch X.c

so it already has any hunks which were part of your patch and
which applied cleanly to X.c-head (which is the file coming in as
the new base).  Thus you are left only with the rejecting hunks,
which are in X.c-rej.

Personally I've always preferred being given the rejects from
patch to work out a merge problem then to be given the mess that
RCS merge leaves you with.  (I've _never_ been able to decipher
what I want from an RCS merge conflict.)

What is the desired behavior when multiple files have conflicts?
Stop and let the user work on one file before moving to the next?
Open all merge editors in parallel?  Neither seems right to me in
all situations, which is why I just left the `mess' in the filesystem
for the user to resolve at their own pace.


I like what you are suggesting and will try to incorporate these
improvements this week.

-- 
Shawn.
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[ANNOUNCE] pg - A patch porcelain for GIT, Shawn Pearce, (Fri Feb 10, 12:59 pm)
Re: [ANNOUNCE] pg - A patch porcelain for GIT, Greg KH, (Fri Feb 10, 1:41 pm)
Re: [ANNOUNCE] pg - A patch porcelain for GIT, Shawn Pearce, (Fri Feb 10, 2:04 pm)
Re: [ANNOUNCE] pg - A patch porcelain for GIT, Petr Baudis, (Fri Feb 10, 2:17 pm)
Re: [ANNOUNCE] pg - A patch porcelain for GIT, Shawn Pearce, (Fri Feb 10, 2:38 pm)
Re: [ANNOUNCE] pg - A patch porcelain for GIT, Petr Baudis, (Fri Feb 10, 2:47 pm)
Re: [ANNOUNCE] pg - A patch porcelain for GIT, Junio C Hamano, (Fri Feb 10, 3:07 pm)
Re: [ANNOUNCE] pg - A patch porcelain for GIT, Greg KH, (Fri Feb 10, 4:20 pm)
Re: [ANNOUNCE] pg - A patch porcelain for GIT, Sam Vilain, (Sun Feb 12, 7:49 pm)
Re: [ANNOUNCE] pg - A patch porcelain for GIT, Shawn Pearce, (Sun Feb 12, 8:29 pm)
Re: [ANNOUNCE] pg - A patch porcelain for GIT, Sam Vilain, (Sun Feb 12, 9:40 pm)
Re: [ANNOUNCE] pg - A patch porcelain for GIT, Shawn Pearce, (Sun Feb 12, 11:03 pm)
Re: [ANNOUNCE] pg - A patch porcelain for GIT, Catalin Marinas, (Mon Feb 13, 7:40 am)
Re: [ANNOUNCE] pg - A patch porcelain for GIT, Petr Baudis, (Mon Feb 13, 2:00 pm)
Re: [ANNOUNCE] pg - A patch porcelain for GIT, Shawn Pearce, (Mon Feb 13, 9:56 pm)
Re: [ANNOUNCE] pg - A patch porcelain for GIT, Shawn Pearce, (Mon Feb 13, 11:14 pm)
Re: [ANNOUNCE] pg - A patch porcelain for GIT, Catalin Marinas, (Tue Feb 14, 2:26 am)
Re: [ANNOUNCE] pg - A patch porcelain for GIT, Karl , (Tue Feb 14, 3:08 am)
Re: [ANNOUNCE] pg - A patch porcelain for GIT, Chuck Lever, (Tue Feb 14, 8:22 am)
Re: [ANNOUNCE] pg - A patch porcelain for GIT, Karl , (Tue Feb 14, 9:07 am)
Re: [ANNOUNCE] pg - A patch porcelain for GIT, Chuck Lever, (Tue Feb 14, 1:58 pm)
Re: [ANNOUNCE] pg - A patch porcelain for GIT, Petr Baudis, (Tue Feb 14, 3:29 pm)
Re: [ANNOUNCE] pg - A patch porcelain for GIT, Sam Vilain, (Tue Feb 14, 5:22 pm)
Re: [ANNOUNCE] pg - A patch porcelain for GIT, Shawn Pearce, (Tue Feb 14, 5:35 pm)
Re: [ANNOUNCE] pg - A patch porcelain for GIT, Petr Baudis, (Tue Feb 14, 6:14 pm)
Re: [ANNOUNCE] pg - A patch porcelain for GIT, J. Bruce Fields, (Tue Feb 14, 9:11 pm)
Re: [ANNOUNCE] pg - A patch porcelain for GIT, Shawn Pearce, (Tue Feb 14, 11:54 pm)
Re: [ANNOUNCE] pg - A patch porcelain for GIT, Karl , (Wed Feb 15, 3:11 am)
Re: [ANNOUNCE] pg - A patch porcelain for GIT, Andreas Ericsson, (Wed Feb 15, 3:42 am)
Re: [ANNOUNCE] pg - A patch porcelain for GIT, Karl , (Wed Feb 15, 4:25 am)
Re: [ANNOUNCE] pg - A patch porcelain for GIT, Karl , (Wed Feb 15, 4:27 am)
Re: [ANNOUNCE] pg - A patch porcelain for GIT, Catalin Marinas, (Wed Feb 15, 10:12 am)
Re: [ANNOUNCE] pg - A patch porcelain for GIT, Catalin Marinas, (Wed Feb 15, 10:20 am)
Re: [ANNOUNCE] pg - A patch porcelain for GIT, Catalin Marinas, (Wed Feb 15, 10:25 am)
Re: [ANNOUNCE] pg - A patch porcelain for GIT, Shawn Pearce, (Wed Feb 15, 10:55 am)
Re: [ANNOUNCE] pg - A patch porcelain for GIT, J. Bruce Fields, (Wed Feb 15, 12:45 pm)
Re: [ANNOUNCE] pg - A patch porcelain for GIT, Karl , (Thu Feb 16, 12:54 am)
Re: [ANNOUNCE] pg - A patch porcelain for GIT, Junio C Hamano, (Thu Feb 16, 3:24 am)
Re: [ANNOUNCE] pg - A patch porcelain for GIT, Catalin Marinas, (Thu Feb 16, 3:33 am)
Re: [ANNOUNCE] pg - A patch porcelain for GIT, Fernando J. Pereda, (Thu Feb 16, 3:42 am)
Re: [ANNOUNCE] pg - A patch porcelain for GIT, Junio C Hamano, (Thu Feb 16, 3:52 am)
Re: [ANNOUNCE] pg - A patch porcelain for GIT, Catalin Marinas, (Thu Feb 16, 4:10 am)
[PATCH 0/2] stg uncommit, Karl , (Thu Feb 16, 9:27 pm)
[PATCH 2/2] Add 'stg uncommit' command, Karl , (Thu Feb 16, 9:31 pm)
Re: [ANNOUNCE] pg - A patch porcelain for GIT, Catalin Marinas, (Fri Feb 17, 2:57 pm)
Re: [PATCH 2/2] Add 'stg uncommit' command, Catalin Marinas, (Sun Feb 19, 3:51 am)
Re: [PATCH 2/2] Add 'stg uncommit' command, Karl , (Sun Feb 19, 6:45 am)
Re: [PATCH 2/2] Add 'stg uncommit' command, Karl , (Sun Feb 19, 7:47 am)
Re: [PATCH 2/2] Add 'stg uncommit' command, Sam Vilain, (Sun Feb 19, 2:15 pm)
Re: [PATCH 2/2] Add 'stg uncommit' command, Catalin Marinas, (Mon Feb 20, 10:20 am)
Re: [PATCH 2/2] Add 'stg uncommit' command, Karl , (Mon Feb 20, 10:30 am)
Re: [PATCH 2/2] Add 'stg uncommit' command, Catalin Marinas, (Mon Feb 20, 3:49 pm)
Re: [PATCH 2/2] Add 'stg uncommit' command, Karl , (Tue Feb 21, 12:55 am)