git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Petr Baudis <pasky@suse.cz>
Date
Jan 18, 2006, 18:55 UTC
Message-ID
<20060118185542.GT28365@pasky.or.cz>
In-Reply-To
<46a038f90601180956r69ba5dffl2106f697a6be4750@mail.gmail.com>

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...

Show 16 quoted lines
> 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).

Show 9 quoted lines
> > 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
Previous: Martin LanghoffNext: Martin Langhoff
Message 8 of 10 in “"tla missing -s" equivalent with git/cogito”
  1. Belmar-LetelierJan 18, 2006
  2. Andreas EricssonJan 18, 2006
  3. Junio C HamanoJan 18, 2006
  4. Martin LanghoffJan 18, 2006
  5. Petr BaudisJan 18, 2006
  6. Martin LanghoffJan 18, 2006
  7. Martin LanghoffJan 18, 2006
  8. Petr BaudisJan 18, 2006
  9. Martin LanghoffJan 18, 2006
  10. Petr BaudisJan 18, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.