* "tla missing -s" equivalent with git/cogito @ 2006-01-18 14:53 Belmar-Letelier 2006-01-18 17:08 ` Andreas Ericsson 2006-01-18 17:56 ` "tla missing -s" equivalent with git/cogito Martin Langhoff 0 siblings, 2 replies; 11+ messages in thread From: Belmar-Letelier @ 2006-01-18 14:53 UTC (permalink / raw) To: git Hello, Could someone say me how we do in cogito or git the arch-tla equivalent of $ cd project--luis--0.1 $ tla missing -sD paul@mail.com--public/project--paul--0.1 so I get the information like what are the interesting patch to get and then I take all of them with $ tla star-merge -t paul@mail.com--public/project--paul--0.1 or I cherry pick only one of them (here patch-6) with $ tla replay somefriend@mail.com--public/project--branchA--0.1--patch-6 tks -- Luis ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: "tla missing -s" equivalent with git/cogito 2006-01-18 14:53 "tla missing -s" equivalent with git/cogito Belmar-Letelier @ 2006-01-18 17:08 ` Andreas Ericsson 2006-01-18 17:46 ` Junio C Hamano 2006-01-18 17:56 ` "tla missing -s" equivalent with git/cogito Martin Langhoff 1 sibling, 1 reply; 11+ messages in thread From: Andreas Ericsson @ 2006-01-18 17:08 UTC (permalink / raw) To: luis; +Cc: git Belmar-Letelier wrote: > Hello, > > Could someone say me how we do in cogito or git the > > arch-tla equivalent of > > $ cd project--luis--0.1 > $ tla missing -sD paul@mail.com--public/project--paul--0.1 > > so I get the information like what are the interesting patch to get > > and then I take all of them with > > $ tla star-merge -t paul@mail.com--public/project--paul--0.1 > > or I cherry pick only one of them (here patch-6) with > > $ tla replay somefriend@mail.com--public/project--branchA--0.1--patch-6 > Not that I'm even half aware of how arch does this, but if the two repos are cloned from the same one (which they seem to be), you could just do $ git checkout -b paul $ git pull <path-to-pauls-repo> <branch-from-pauls-repo> The "pull" above will do the merging nessecary. You can merge several branches at once if you like (known as "doing an octopus" in gittish. I imagine that's a star-merge in arch). Then, if you want to cherry-pick commits from Paul's repo to your master-branch, you do $ git checkout master $ git cherry-pick -r paul~3 to replay the commit 3 steps below the tip of Paul's latest commit in the branch you just pulled from. If you want to import all of them into your own master branch you can do $ git checkout master $ git pull . paul You can also do $ cd pauls-repo $ git format-patch --mbox -k HEAD~10 -o /your/repo $ cd /your/repo $ git am -k 00*.txt but that has the feel of doing things the wrong way around (exporting from a repo to import to another should be done by a fetch or, if you want to merge them into whatever branch you're currently on, a pull). Two things worth noting: * git repositories are damn near indestructible, so long as you don't run "git prune" while mucking around doing very strange things or suffer hardware failure. Don't be afraid to experiment. * gitk is your friend for finding out where you are in the repo and what actually happens when you merge, reset, revert, rebase, commit, pull, fetch, branch, tag or does something else entirely. Use it. You'll be glad you did. -- Andreas Ericsson andreas.ericsson@op5.se OP5 AB www.op5.se Tel: +46 8-230225 Fax: +46 8-230231 ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: "tla missing -s" equivalent with git/cogito 2006-01-18 17:08 ` Andreas Ericsson @ 2006-01-18 17:46 ` Junio C Hamano 2006-01-18 18:06 ` Martin Langhoff 0 siblings, 1 reply; 11+ messages in thread From: Junio C Hamano @ 2006-01-18 17:46 UTC (permalink / raw) To: Andreas Ericsson; +Cc: git Andreas Ericsson <ae@op5.se> writes: > The "pull" above will do the merging nessecary. You can merge several > branches at once if you like (known as "doing an octopus" in > gittish. I imagine that's a star-merge in arch). Arch star-merge is not an octopus. They have different "merge strategy" just like we have more than one. No, I do not remember the details of how they do it. ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: "tla missing -s" equivalent with git/cogito 2006-01-18 17:46 ` Junio C Hamano @ 2006-01-18 18:06 ` Martin Langhoff 2006-01-17 3:29 ` Cogito wishlist: ability to set merge strategy H. Peter Anvin 0 siblings, 1 reply; 11+ messages in thread From: Martin Langhoff @ 2006-01-18 18:06 UTC (permalink / raw) To: Junio C Hamano; +Cc: Andreas Ericsson, git On 1/19/06, Junio C Hamano <junkio@cox.net> wrote: > Arch star-merge is not an octopus. They have different "merge > strategy" just like we have more than one. No, I do not > remember the details of how they do it. In Arch, star-merge is roughly equivalent to git-merge. When I was an Arch user, I could go out and take a walk under the stars while it tried to work its magic on my 10K file tree -- so the name was quite fitting ;-) The main difference with git is that it has explicit rename tracking and explicit "patches already applied" tracking. We detect those things at merge time, and in my projects it has so far worked better than tla's explicit tracking of things -- but only when I merge with git-merge. One of these days I'll convince Pasky to use git-merge for cg-merge's internals. cheers, martin ^ permalink raw reply [flat|nested] 11+ messages in thread
* Cogito wishlist: ability to set merge strategy @ 2006-01-17 3:29 ` H. Peter Anvin 2006-01-18 19:32 ` Petr Baudis 0 siblings, 1 reply; 11+ messages in thread From: H. Peter Anvin @ 2006-01-17 3:29 UTC (permalink / raw) To: Petr Baudis, Git Mailing List It would be nice if Cogito would let one override the default merge strategy, i.e. to use the recursive merge strategy. I've had some moderate luck with using recursive merge for the klibc trees recently. -hpa ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Cogito wishlist: ability to set merge strategy 2006-01-17 3:29 ` Cogito wishlist: ability to set merge strategy H. Peter Anvin @ 2006-01-18 19:32 ` Petr Baudis 2006-01-18 20:14 ` Martin Langhoff 0 siblings, 1 reply; 11+ messages in thread From: Petr Baudis @ 2006-01-18 19:32 UTC (permalink / raw) To: H. Peter Anvin, Martin Langhoff Cc: Git Mailing List, Junio C Hamano, Andreas Ericsson Dear diary, on Tue, Jan 17, 2006 at 04:29:49AM CET, I got a letter where "H. Peter Anvin" <hpa@zytor.com> said that... > It would be nice if Cogito would let one override the default merge > strategy, i.e. to use the recursive merge strategy. I've had some > moderate luck with using recursive merge for the klibc trees recently. Dear diary, on Wed, Jan 18, 2006 at 07:06:07PM CET, I got a letter where Martin Langhoff <martin.langhoff@gmail.com> said that... > One of these days I'll convince Pasky to use git-merge for > cg-merge's internals. For the record, I acknowledge that the merge strategies are useful and I plan to make cg-merge use them, but I'm unable to tell when that will happen. I would still like to keep the current Cogito merging the default merge strategy at least for a while until the dust settles down, though. From the Git merge strategies, I guess only recursive is useful for Cogito... Patches welcome. ;-) -- 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 ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Cogito wishlist: ability to set merge strategy 2006-01-18 19:32 ` Petr Baudis @ 2006-01-18 20:14 ` Martin Langhoff 0 siblings, 0 replies; 11+ messages in thread From: Martin Langhoff @ 2006-01-18 20:14 UTC (permalink / raw) To: Petr Baudis Cc: H. Peter Anvin, Git Mailing List, Junio C Hamano, Andreas Ericsson On 1/19/06, Petr Baudis <pasky@suse.cz> wrote: > though. From the Git merge strategies, I guess only recursive is > useful for Cogito... I haven't had time to figure out where the problem is, I do have some cases where git-merge does the right thing, and cg-merge gets it wrong. And without renames. An example from yesterday: http://locke.catalyst.net.nz/gitweb?p=moodle.git;a=commit;h=b69d60a5141dfe22a073dd9931e6c8ff5dded0b9 (the repo is accessble via http://locke.catalyst.net.nz/git/moodle.org if anyone is interested) > Patches welcome. ;-) I know I promised patches in that direction, but I haven't had the time to look into it. Sorry! (and, as a user, I just cheat and fall back to git-merge) cheers, martin ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: "tla missing -s" equivalent with git/cogito 2006-01-18 14:53 "tla missing -s" equivalent with git/cogito Belmar-Letelier 2006-01-18 17:08 ` Andreas Ericsson @ 2006-01-18 17:56 ` Martin Langhoff 2006-01-18 18:55 ` Petr Baudis 1 sibling, 1 reply; 11+ messages in thread From: Martin Langhoff @ 2006-01-18 17:56 UTC (permalink / raw) To: luis; +Cc: git 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 # show what we have that paul doesn't $ cg-log -r paul:master $ cg-diff -r master:paul You can also do $ cg-diff -r master:paul > so I get the information like what are the interesting patch to get > > and then I take all of them with > > $ tla star-merge -t paul@mail.com--public/project--paul--0.1 # if you've done cg-fetch paul and reviewed it what you're about to merge, just do cg-merge paul # otherwise, for a shortcut of cg-fetch <branch> && cg-merge <branch> do $ cg-update paul > 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 Note that git does not track patch application _explicitly_ like Arch does, it tracks them only indirectly. Merges (tla star-merge type of merges) are recorded explicitly. This work surprisingly well. If you do a cg-update, cg-merge or git-merge, git will keep a good record of what points of the history have been merged. 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. cheers. martin ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: "tla missing -s" equivalent with git/cogito 2006-01-18 17:56 ` "tla missing -s" equivalent with git/cogito Martin Langhoff @ 2006-01-18 18:55 ` Petr Baudis 2006-01-18 19:07 ` Martin Langhoff 0 siblings, 1 reply; 11+ messages in thread From: Petr Baudis @ 2006-01-18 18:55 UTC (permalink / raw) To: Martin Langhoff; +Cc: luis, git 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 ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: "tla missing -s" equivalent with git/cogito 2006-01-18 18:55 ` Petr Baudis @ 2006-01-18 19:07 ` Martin Langhoff 2006-01-18 19:26 ` Petr Baudis 0 siblings, 1 reply; 11+ messages in thread From: Martin Langhoff @ 2006-01-18 19:07 UTC (permalink / raw) To: Petr Baudis; +Cc: luis, git On 1/19/06, Petr Baudis <pasky@suse.cz> wrote: > 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: ... > And you get a conflict instead of b\nc. While I haven't tested your particular example, it looks to me like git-cherry would identify it correctly. So far my experience has been that git-cherry's strategy detects my cherry-picked patches pretty well. Why would it not work in your example? Patch 1 has clearly been applied in both branches, and git-cherry would normally detect that alright. btw, when is cg-merge switching to use git-merge? :-p martin ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: "tla missing -s" equivalent with git/cogito 2006-01-18 19:07 ` Martin Langhoff @ 2006-01-18 19:26 ` Petr Baudis 0 siblings, 0 replies; 11+ messages in thread From: Petr Baudis @ 2006-01-18 19:26 UTC (permalink / raw) To: Martin Langhoff; +Cc: luis, git Dear diary, on Wed, Jan 18, 2006 at 08:07:27PM CET, I got a letter where Martin Langhoff <martin.langhoff@gmail.com> said that... > On 1/19/06, Petr Baudis <pasky@suse.cz> wrote: > > 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: > ... > > And you get a conflict instead of b\nc. > > While I haven't tested your particular example, it looks to me like > git-cherry would identify it correctly. So far my experience has been > that git-cherry's strategy detects my cherry-picked patches pretty > well. > > Why would it not work in your example? Patch 1 has clearly been > applied in both branches, and git-cherry would normally detect that > alright. It probably would. So? We are talking about git-merge and cg-merge here. Now, it might be interesting to have a cherry-aware merge strategy, but I suspect that the conflicts handling there would be quite non-trivial. -- 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 ^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2006-01-18 20:14 UTC | newest] Thread overview: 11+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2006-01-18 14:53 "tla missing -s" equivalent with git/cogito Belmar-Letelier 2006-01-18 17:08 ` Andreas Ericsson 2006-01-18 17:46 ` Junio C Hamano 2006-01-18 18:06 ` Martin Langhoff 2006-01-17 3:29 ` Cogito wishlist: ability to set merge strategy H. Peter Anvin 2006-01-18 19:32 ` Petr Baudis 2006-01-18 20:14 ` Martin Langhoff 2006-01-18 17:56 ` "tla missing -s" equivalent with git/cogito Martin Langhoff 2006-01-18 18:55 ` Petr Baudis 2006-01-18 19:07 ` Martin Langhoff 2006-01-18 19:26 ` Petr Baudis
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).