git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Daniel Barkalow <barkalow@iabervon.org>
To: "Shawn O. Pearce" <spearce@spearce.org>
Cc: Junio C Hamano <gitster@pobox.com>, git@vger.kernel.org
Subject: Re: [PATCH 3/5] Correct handling of branch.$name.merge in builtin-fetch
Date: Tue, 18 Sep 2007 11:05:37 -0400 (EDT)	[thread overview]
Message-ID: <Pine.LNX.4.64.0709181034300.5298@iabervon.org> (raw)
In-Reply-To: <20070918085453.GC5390@spearce.org>

On Tue, 18 Sep 2007, Shawn O. Pearce wrote:

> My prior bug fix for git-push titled "Don't configure remote "." to
> fetch everything to itself" actually broke t5520 as we were unable
> to evaluate a branch configuration of:
> 
>   [branch "copy"]
>     remote = .
>     merge = refs/heads/master
> 
> as remote "." did not have a "remote...fetch" configuration entry to
> offer up refs/heads/master as a possible candidate available to be
> fetched and merged.  In shell script git-fetch and prior to the above
> mentioned commit this was hardcoded for a url of "." to be the set of
> local branches.

Ah, right. When you removed that, I remembered there being some reason I'd 
put it in, but I couldn't remember what it was, and knew you'd turn it up 
before I would.

> Chasing down this bug led me to the conclusion that our prior behavior
> with regards to branch.$name.merge was incorrect.  In the shell script
> based git-fetch implementation we only fetched and merged a branch if
> it appeared both in branch.$name.merge *and* in remote.$r.fetch, where
> $r = branch.$name.remote.  In other words in the following config file:
> 
>   [remote "origin"]
>     url = git://git.kernel.org/pub/scm/git/git.git
>     fetch = refs/heads/master:refs/remotes/origin/master
>   [branch "master"]
>     remote = origin
>     merge = refs/heads/master
>   [branch "pu"]
>     remote = origin
>     merge = refs/heads/pu
> 
> Attempting to run `git pull` while on branch "pu" would always give
> the user "Already up-to-date" as git-fetch did not fetch pu and thus
> did not mark it for merge in .git/FETCH_HEAD.  The configured merge
> would always be ignored and the user would be left scratching her
> confused head wondering why merge did not work on "pu" but worked
> fine on "master".
> 
> If we are using the "default fetch" specification for the current
> branch and the current branch has a branch.$name.merge configured
> we now union it with the list of refs in remote.$r.fetch.  This
> way the above configuration does what the user expects it to do,
> which is to fetch only "master" by default but when on "pu" to
> fetch both "master" and "pu".

And store master, but don't store pu. This looks like the right solution 
to me.

> This uncovered some breakage in the test suite where old-style Cogito
> branches (.git/branches/$r) did not fetch the branches listed in
> .git/config for merging and thus did not actually merge them if the
> user tried to use `git pull` on that branch.  Junio and I discussed
> it on list and felt that the union approach here makes more sense to
> DWIM for the end-user than silently ignoring their configured request
> so the test vectors for t5515 have been updated to include for-merge
> lines in .git/FETCH_HEAD where they have been configured for-merge
> in .git/config.

Ah, okay. This is one of the things I'd changed, to make it obey the merge 
configuration (which meant that it didn't get anything to merge), which 
had previously been ignored. So there's nothing that's expecting exactly 
the behavior that you're changing away from, except for that test case.

This whole series looks good to me.

	-Daniel
*This .sig left intentionally blank*

      reply	other threads:[~2007-09-18 15:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-18  8:54 [PATCH 3/5] Correct handling of branch.$name.merge in builtin-fetch Shawn O. Pearce
2007-09-18 15:05 ` Daniel Barkalow [this message]

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=Pine.LNX.4.64.0709181034300.5298@iabervon.org \
    --to=barkalow@iabervon.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=spearce@spearce.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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).