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

From: Andreas Ericsson <[email-masked]>
Date: Wed, 18 Jan 2006 18:08:00 +0100

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 [email-masked]/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 [email-masked]/project--paul--0.1
> 
> or I cherry pick only one of them (here patch-6) with
> 
> $ tla replay  [email-masked]/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                   [email-masked]
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231