From: Junio C Hamano <junkio@cox.net>
To: "Michael S. Tsirkin" <mst@mellanox.co.il>
Cc: git@vger.kernel.org
Subject: Re: RFC: git pull <remote> making an octopus?
Date: Mon, 14 Aug 2006 14:45:48 -0700 [thread overview]
Message-ID: <7vk65bdm9f.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: 20060814175523.GC16821@mellanox.co.il
"Michael S. Tsirkin" <mst@mellanox.co.il> writes:
> Quoting r. Michael S. Tsirkin <mst@mellanox.co.il>:
>> So it seems git pull behaves differently depending on whether
>> the origin pull line is first or not?
>
> Where do I find the code that decides whether to make an octopus
> or many fetches?
After "git fetch" that is called from "git pull",
$GIT_DIR/FETCH_HEAD lists all the refs that were fetched, and
each line has not-for-merge marker (or empty) in the second
column (SHA1 <TAB> marker <TAB> description of what the remote
ref is). The ones not marked with the not-for-merge marker are
merged into the current head, so if you have more than one that
lack not-for-merge marker, you end up with an octopus.
The rule (the implementation might be broken but nobody other
than you found the breakage so far) to mark not-for-merge is:
- the refspecs are either given on the command line, or from
shorthand file (.git/remotes/, or .git/branches/) but never
from both at the same time;
- when dealing with the refspecs from the command line all of
them are for merge;
- when dealing with the refspecs from the shorthand
(.git/remotes), the one on the first "Pull: " line is for
merge and everything else is not.
The case statement in the loop you were touching in your patch
we discussed earlier had four arms (+ref, .+ref, .ref, and ref).
Pluses come from the original refspec given by the user, either
from short-hand file or command line. Dot is prepended when
reflist is prepared by get_remote_refs_for_fetch which in turn
calls canon_refs_list_for_fetch (git-fetch sources
git-parse-remote and these shell functions are defined there).
next prev parent reply other threads:[~2006-08-14 21:46 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-08-14 6:43 RFC: git pull <remote> making an octopus? Michael S. Tsirkin
2006-08-14 7:00 ` Junio C Hamano
2006-08-14 7:53 ` Michael S. Tsirkin
2006-08-14 17:55 ` Michael S. Tsirkin
2006-08-14 21:45 ` Junio C Hamano [this message]
2006-08-15 7:40 ` Alex Riesen
2006-08-15 7:45 ` Junio C Hamano
2006-08-17 9:08 ` Junio C Hamano
2006-08-17 9:18 ` Alex Riesen
2006-08-17 9:46 ` Michael S. Tsirkin
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=7vk65bdm9f.fsf@assigned-by-dhcp.cox.net \
--to=junkio@cox.net \
--cc=git@vger.kernel.org \
--cc=mst@mellanox.co.il \
/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