All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <junkio@cox.net>
To: Daniel Barkalow <barkalow@iabervon.org>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 4/5] Add --remote option to send-pack
Date: Sat, 05 May 2007 00:54:14 -0700	[thread overview]
Message-ID: <7vr6pvln89.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: <Pine.LNX.4.64.0705050235210.28708@iabervon.org> (Daniel Barkalow's message of "Sat, 5 May 2007 02:52:55 -0400 (EDT)")

Daniel Barkalow <barkalow@iabervon.org> writes:

> Wouldn't it be better to to this as:
>
> [remote "origin"]
> 	url = git.kernel.org:/pub/scm/git/git.git/
> [branch "master"]
> 	remote = origin
> 	merge = refs/heads/master

As I am likely to pull from other people, and I happen to expect
the old fashioned "git pull gfi" without explicit refspec on the
command line to get the first Pull: line from remotes file to
tell which one to merge from, I am in favor of _not_ having that
[branch "master"] stuff in my repository.

remote.*.fetch is about what remote branches are fetched;
tracking may or may not happen as a side effect.  What I do with
the resulting .git/FETCH_HEAD is my business and branch.*.merge
should _not_ be the only way to access it.

> Merging without tracking is fine, in general; the "without tracking" was 
> intentionally parenthetical. 

Actually, fetching with or without tracking are both valid
options, and it does not make much sense to say which one is
norm and which one is exception.

> I just don't think always merging a 
> particular remote head into the current branch, regardless of what branch 
> is current, is a good idea.

Exactly.  That's why I do not think [branch "master"] for
toplevel maintainer usage is not very useful.

There are a few improvements we probably would want.

One is the interaction between the config "fetch =..." refspecs
and the command line ones.  Currently the rule is:

 - If you do not say refspecs on the command line, fetch config
   (or Pull: lines from remotes/* file) are used.

 - If you do have refspecs on the command line, fetch config are
   not used (they are ignored).

Which is fine when we talk about "git fetch", but if you _are_
using remote tracking, and if you are running "git fetch" as an
implementation detail of running "git pull" (IOW, you said "git
pull origin next"), it is less than optimum.  Instead of "only
fetch 'next' without tracking and then merge it", we would
certainly want "fetch to track everything as usual, and then
merge 'next' instead of what is usually merged".

Another thing is that which branch is merged into the current
branch should not be a function of the current branch, as the
current configuration mechanism suggests.  The current way maps
the current branch to "which repository's which branch".  In
addition to that, I think it should be a function of ("current
branch", "remote repository") pair.  IOW, allow you to say "If I
pull from this remote without saying which one to merge, merge
that branch.  If I pull from this other remote, merge that other
branch".  Something like:

        [branch "master"]
                ; Use this when "git pull" did not say which remote
                remote = origin

                ; Use this when "git pull origin" did not say which
                ; branch(es) to merge
                merge = refs/heads/master
                ; the above should be a synonym for
		; merge = refs/heads/master for origin

                ; "git pull fast-import" while on my "master"
                ; would merge 'for-junio' branch there.
                merge = refs/heads/for-junio for fast-import

                ; similarly, but use subtree strategy.
                merge = refs/heads/for-junio with subtree for git-gui

        [remote "origin"]
                url = git://git.kernel.org/pub/scm/git/git.git/
                fetch = refs/heads/*:remotes/origin/*
        [remote "fast-import"]
                url = git://repo.or.cz/git/fastimport.git/
                fetch = refs/heads/*:remotes/gfi/*
        [remote "git-gui"]
                url = git://repo.or.cz/git-gui.git/
                fetch = refs/heads/*:refs/remotes/git-gui/*

  reply	other threads:[~2007-05-05  7:54 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-28 17:05 [PATCH 4/5] Add --remote option to send-pack Daniel Barkalow
2007-04-29  5:49 ` Junio C Hamano
2007-04-29  6:01   ` Daniel Barkalow
2007-04-29  6:10     ` Shawn O. Pearce
2007-04-29  6:28     ` Junio C Hamano
2007-05-03  4:04       ` Daniel Barkalow
2007-05-03  5:35         ` Junio C Hamano
2007-05-03  5:45           ` Daniel Barkalow
2007-05-03  6:13             ` Junio C Hamano
2007-05-05  5:21               ` Daniel Barkalow
2007-05-05  6:33                 ` Junio C Hamano
2007-05-05  6:52                   ` Daniel Barkalow
2007-05-05  7:54                     ` Junio C Hamano [this message]
2007-05-05 17:56                       ` Daniel Barkalow
2007-05-07 20:08                       ` Loeliger Jon-LOELIGER

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=7vr6pvln89.fsf@assigned-by-dhcp.cox.net \
    --to=junkio@cox.net \
    --cc=barkalow@iabervon.org \
    --cc=git@vger.kernel.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.