Re: "tla missing -s" equivalent with git/cogito

From: Petr Baudis <pasky@suse.cz>
Date: 2006-01-19 05:55:42
Dear diary, on Wed, Jan 18, 2006 at 06:56:38PM CET, I got a letter
where Martin Langhoff <martin.langhoff@gmail.com> said that...
> Andreas' response is good is you're into pure git. Let me add some
> cogito tricks ;-)
> 
> On 1/19/06, Belmar-Letelier <luis@itaapy.com> wrote:
> > arch-tla equivalent of
> >
> > $ cd project--luis--0.1
> > $ tla missing -sD paul@mail.com--public/project--paul--0.1
> 
>  $ cd project-luis
>  # only if have to do cg-branch-add the first time!
>  $ cg-branch-add paul http://server/git/project.git
>  $ cg-fetch paul
>  # show what paul has that we don't
>  $ cg-log -r master:paul
>  $ cg-diff -r master:paul

I usually do this as

	$ cg-log -m -r paul

which is shorter (and in some situations more accurately describes which
commits are actually going to get merged).

But I believe that Belmar-Letelier might be happier with git-cherry,
since he wants to do cherrypicking (and wrapping that in cg-log might
not be bad idea).

> > or I cherry pick only one of them (here patch-6) with
> >
> > $ tla replay  somefriend@mail.com--public/project--branchA--0.1--patch-6
> 
>   # export the patches paul has that we don't
>   $ mkdir .patchesfrompaul
>   $ git-format-patch --mbox --signoff -o .patchesfrompaul master paul
>   # review the contents of .patchesfrompaul and decide what patches you want
>   $ git-am -3 .patchesfrompaul/0006-fix-frob-invocation.txt

If you just want to pick one commit, it shouldn't be more difficult than

	$ cg-diff -p -r commitid | cg-patch
	$ cg-commit -c commitid

but I was actually thinking about wrapping this up to something like
cg-cherrypick or cg-pick. Perhaps I will just overload cg-patch, though
- I want to add support for autocommitting the patches there anyway.

> When you cherry pick patches, if the patch applies cleanly, the next
> time you do a merge from that branch it will be skipped automagically.
> If the patch needs serious editing, there's a good chance that git
> will try to apply it again.

No, it will not be skipped automagically - GIT really does not properly
support merging  of branch you've cherrypicked before. It might work,
but that's just luck - very similar to the luck you might have when
re-merging branches in CVS using the original merge base.

Imagine having branch with two patches 1 and 2. There is a file X:

	a

Ppatch1:

	-a
	+b
	+c

Patch2:

	-b
	+a
	c

Resulting file:

	a
	c

Now, you've cherrypicked patch1, so your file is:

	b
	c

Now you want to merge the branch as a whole. Cherrypicking-aware VCS
would just merge the patch2, but you are taking the whole diff:

	a
	+c

And you get a conflict instead of b\nc.

-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
Of the 3 great composers Mozart tells us what it's like to be human,
Beethoven tells us what it's like to be Beethoven and Bach tells us
what it's like to be the universe.  -- Douglas Adams
-
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
Received on Thu Jan 19 05:55:00 2006

This archive was generated by hypermail 2.1.8 : 2006-01-19 05:55:10 EST