Re: Newbie grief
- From
Andreas Ericsson <ae@op5.se>
- Date
- May 4, 2012, 14:09 UTC
- Message-ID
- <4FA3E31A.6060606@op5.se>
- In-Reply-To
- <4FA2D565.1080806@palm.com>
On 05/03/2012 08:58 PM, Rich Pixley wrote:
Show 7 quoted lines
> On 5/1/12 16:30 , Felipe Contreras wrote: >> Show all the hg commands of what you are trying to do, and we can show >> you how you can achieve the same in git, but much more easily. > hg init foo > for i in `yes | head -4000`; do (set -x ; d=`date +%s.%N` ; hg clone foo foo-$d; (cd foo-$d && date > bar && hg add bar && hg ci -m $d)); done > for i in foo-*; do (set -x ; (cd $i && hg push -f)); done >
Here's how that would look in git (though I got rid of the timestamp stuff and used seq instead):
git init foo for i in $(seq 1 4000); do git clone foo foo-$i; (cd foo-$i && date > bar && git add bar && git commit -m "$i"; done) for i in foo-*; do (set -x; (cd $i && git push master:$i/master)); done
The hg recipe creates 4000 branches which I for some reason can't find the names of so I have no idea how to interact with them. The git recipe names them explicitly to foo-$i/master in the foo/ repo, since git doesn't allow pushing of commits without a ref.
Having read further in the thread, I see you did "hg merge" to merge *all* the branches (which is impressive in itself, doing a 4000-way merge), but I still don't see how you'd go about merging just one of them. Perhaps that's not desirable.
-- Andreas Ericsson andreas.ericsson@op5.se OP5 AB www.op5.se Tel: +46 8-230225 Fax: +46 8-230231 Considering the successes of the wars on alcohol, poverty, drugs and terror, I think we should give some serious thought to declaring war on peace.