All of lore.kernel.org
 help / color / mirror / Atom feed
From: Darren Hart <dvhart@linux.intel.com>
To: "poky@yoctoproject.org" <poky@yoctoproject.org>
Subject: fetch2/git: questions on read-tree and checkout-index
Date: Fri, 20 May 2011 16:40:18 -0700	[thread overview]
Message-ID: <4DD6FBE2.4080403@linux.intel.com> (raw)

Hi Ke,

As I ran into http://bugzilla.yoctoproject.org/show_bug.cgi?id=1089 today
working with Saul to validate bug 1029, I spent some time reading through the
fetch2/git source and the commit history. I had a couple questions regarding the
rationale for the use of "read-tree" and "checkout-index" in the unpack routine:

runfetchcmd("git clone -s -n %s %s" % (ud.clonedir, destdir), d)
if not ud.nocheckout:
    os.chdir(destdir)
    runfetchcmd("%s read-tree %s%s" % (ud.basecmd, ud.revisions[ud.names[0]], readpathspec), d)
    runfetchcmd("%s checkout-index -q -f -a" % ud.basecmd, d)

As I understand it this would be equivalent to checking out HEAD and then
overwriting everything in the tree with the contents of the repository at
ud.revisions[ud.names[0]]. This results in all the modifications listed with git
status but doesn't add any of the changes back to the index, so the log still
appears to be at HEAD (with a lot of local changes). This seems unnecessary for
the majority of use cases. The one where it seems potentially useful would be
the subdir case. Is that the only motivator for using this method?

If so, what is the motivation for checkout out of a subdir - as opposed to just
changing the recipe to build within that subdir?

From what I could tell we were not using the ability to merge multiple trees
with the read-tree, which I could see as being useful to generate a tree like
the linux-yocto tree with the meta branch included in the bsp source - but even
that could be done using standard merge commands.

Unless I'm missing a use-case (quite likely as there are next to no comments
articulating the rationale and approach taken) I think it would make more sense
to just checkout the required hash into a detached head for the build and update
any recipes that make use of the subdir option to build within than subdir.
Alternatively, doing a checkout for the non subdir case would make most of the
recipes get this behavior while allowing the subdir users to remain untouched.

Thanks,

-- 
Darren Hart
Intel Open Source Technology Center
Yocto Project - Linux Kernel


             reply	other threads:[~2011-05-20 23:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-20 23:40 Darren Hart [this message]
2011-05-21  8:49 ` fetch2/git: questions on read-tree and checkout-index Richard Purdie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4DD6FBE2.4080403@linux.intel.com \
    --to=dvhart@linux.intel.com \
    --cc=poky@yoctoproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.