Git development
 help / color / mirror / Atom feed
From: Johannes Schindelin <Johannes.Schindelin@gmx.de>
To: Daniel Barkalow <barkalow@iabervon.org>
Cc: Junio C Hamano <gitster@pobox.com>, git@vger.kernel.org
Subject: Re: [PATCH] builtin-clone: fix for new unpack_trees() semantics
Date: Mon, 10 Mar 2008 00:05:39 +0100 (CET)	[thread overview]
Message-ID: <alpine.LSU.1.00.0803100005060.3975@racer.site> (raw)
In-Reply-To: <alpine.LNX.1.00.0803091857540.19665@iabervon.org>

Hi,

On Sun, 9 Mar 2008, Daniel Barkalow wrote:

> On Sun, 9 Mar 2008, Johannes Schindelin wrote:
> 
> > On Sun, 9 Mar 2008, Daniel Barkalow wrote:
> > 
> > > On Sun, 9 Mar 2008, Johannes Schindelin wrote:
> > > 
> > > > In git.git's "next" branch, unpack_trees() must specify source and target 
> > > > index.
> > > > 
> > > > Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
> > > > ---
> > > > 
> > > > 	To be squashed into 10/11
> > > > 
> > > >  builtin-clone.c |    2 ++
> > > >  1 files changed, 2 insertions(+), 0 deletions(-)
> > > > 
> > > > diff --git a/builtin-clone.c b/builtin-clone.c
> > > > index e4047ed..3890e12 100644
> > > > --- a/builtin-clone.c
> > > > +++ b/builtin-clone.c
> > > > @@ -534,6 +534,8 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
> > > >  		opts.verbose_update = !option_quiet;
> > > >  		opts.merge = 1;
> > > >  		opts.fn = twoway_merge;
> > > > +		opts.src_index = &the_index;
> > > > +		opts.dst_index = &the_index;
> > > 
> > > Actually, I think the sensible thing is to just not do a merge here, since 
> > > we know there's no index beforehand and the two trees are the same.
> > > 
> > > I think the odd twoway merge of two copies of HEAD is just an artifact of 
> > > clone originally just doing "git checkout HEAD", and that got translated 
> > > various times failing to notice the special cases.
> > 
> > Okay, but would oneway_merge not want to write the index, too (rightfully 
> > so)?
> 
> I'm thinking:
> 
>   memset(&opts, 0, sizeof opts);
>   opts.update = 1;
>   opts.verbose_update = !option_quiet;
>   opts.dst_index = &the_index;
> 
>   init_tree_desc(&t[0], tree->buffer, tree->size);
>   unpack_trees(1, t, &opts);
> 
> That is, write it, but not read it, and only have one tree.

Yes.  And this sets dst_index (what I tried to hint at with my patch).

Ciao,
Dscho

  reply	other threads:[~2008-03-09 23:06 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-08 23:04 [PATCH 10/11] Build in clone Daniel Barkalow
2008-03-09 21:30 ` [PATCH] builtin-clone: fix for new unpack_trees() semantics Johannes Schindelin
2008-03-09 22:35   ` Daniel Barkalow
2008-03-09 22:55     ` Johannes Schindelin
2008-03-09 23:02       ` Daniel Barkalow
2008-03-09 23:05         ` Johannes Schindelin [this message]
2008-03-09 23:14           ` Daniel Barkalow
2008-03-10 10:58             ` Johannes Schindelin

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=alpine.LSU.1.00.0803100005060.3975@racer.site \
    --to=johannes.schindelin@gmx.de \
    --cc=barkalow@iabervon.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox