[HOWTO] Using git for mtd

Jörn Engel joern at wohnheim.fh-wedel.de
Sat Apr 22 21:24:29 EDT 2006


On Sat, 22 April 2006 19:09:55 -0500, Josh Boyer wrote:
> On 4/22/06, Jörn Engel <joern at wohnheim.fh-wedel.de> wrote:
> > Next version with the FIXMEs filled in.  If anyone has comments, spots
> > errors, etc., please tell me.
> >
> > 1. Clone Linus' tree
> >
> >   $ git clone git://rsync.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git mtd
> >
> > 2. Change into soon-to-be mtd tree
> >
> >   $ cd mtd
> >
> > 3. Setup mtd remotes file
> >
> >   $ vi .git/remotes/mtd
> >   URL: git://git.infradead.org/mtd-2.6
> >   Pull: master:mtd
> >
> > 4. Fetch mtd tree
> >
> >   $ git fetch mtd
> >
> 
> Huh?
> 
> These look odd to me.  Here are the steps I use (note git 1.3.0 is required)
> 
> 1. git clone git://rsync.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
> linux-git
> 
> This clones the latest of Linus' tree.
> 
> 2. git clone --reference linux-git git://git.infradead.org/mtd-2.6.git mtd
> 
> This clones the MTD tree, however it uses the previous tree created as
> a reference to pull objects from so you don't have two copies of the
> exact some git objects lying around.
> 
> The reason I do this is two fold.  One is that I want to have the
> latest 2.6 tree available to me anyway.  If you don't want/need that,
> then just clone the mtd-2.6 tree outright.  The second reason is that
> I don't have to do wonky things like 'git fetch mtd'.  A fetch doesn't
> merge the changes into the tree.  It just gets the objects.
> 
> By using --reference, you get the benefit of sharing the bulk of the
> git objects and the simplicity of being able to just do 'git pull' in
> both trees to update them.  You also avoid having to locally merge in
> the mtd-2.6 changes, which is something David would really like to
> avoid.  That way he can pull directly from your tree and doesn't get
> extraneous merges.  Which also makes it easier for him to have Linus
> pull from _his_ tree, because Linus hates extraneous merges.

Well, we have two sets of weird and arcane command that basically do
the same.  Minor differences are:

Joern					Josh
o works well with "cp -lr"
  -linus and -mtd trees can share	-
  source files as well as git objects
o requires extra branch			+
o sequence of commands is longer	+
o works with older git versions		-

Everything else should be shared.  So people get to decide which of
the pros and cons are more important.  I happen to care a lot about
older git versions (until debian unstable has 1.3.0) and even more
about "cp -lr".  YMMV

So I guess we should have both versions in the howto.

> The rest of your steps seem fine.

Excellent.

Jörn

-- 
Fools ignore complexity.  Pragmatists suffer it.
Some can avoid it.  Geniuses remove it.
-- Perlis's Programming Proverb #58, SIGPLAN Notices, Sept.  1982




More information about the linux-mtd mailing list