git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Multi-head pulling series

From
Junio C Hamano <junkio@cox.net>
Date
Aug 23, 2005, 05:37 UTC
Message-ID
<7virxxw6vv.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<200508221835.31275.Josef.Weidendorfer@gmx.de>
Josef Weidendorfer <Josef.Weidendorfer@gmx.de> writes:
> I think that both, default and non-default persistant
> mappings, are only a handy convenience issue for less
> typing. If GIT core is not doing this, some (most?) porcelains
> will invent their own way for storing these mappings.
Suppose I have something like this in $GIT_DIR/remotes/ko:
    URL: master.kernel.org:/pub/scm/git/git.git/
    Pull: master:ko-master rc:ko-rc pu:ko-pu
    Push: master:master pu:pu rc:rc
    Default-Pull: master rc

That is, "Pull/Push" describe only the default mappings, and "Default-Pull/Default-Push" names the refs pulled or pushed when only the shorthand (ko) is specified. I think that is what your proposal boils down to. Lack of "Default-Push" just means use the heads listed on "Push" line for the default.

Am I reading you right so far?

With that definition, what these would do would be intuitive and obvious:

    $ git push ko  ;# my master, rc, and pu goes there, under
                    # the same name.
    $ git fetch ko ;# their master comes to my ko-master, rc to my ko-rc
                    # pu is not touched.
But now, what should this do?
    $ git fetch ko master
(1) does it use "Pull" mappings and use their "master" to fast
    forward my "ko-master"?
or
(2) does it obey "the command line overrides the configuration
    file" principle and fetch their "master" but not touch my
    local refs (remember, refspec "master" without colon is
    equivalent to "master:" in fetch, which means "get the
    objects to complete it, but do not store the ref locally")?

If (1), then I would need to say "master:something" on the command line almost all the time, because the point of remotes/ configuration file is that I do not have to remember which remote head corresponds to my local head, and by definition I would not (and should not have to) know if "master" has the default mappings specified there and to which head, so even that "something" happens to be exactly what is in the remotes/ file, I would end up typing that explicitly. Which means that it defeats the point of having the configuration file to begin with.

If (2), then I would again need to say master:ko-master if I wanted to mean "usually I pull from some heads (I do not remember which ones offhand, but my .git/remotes/ file would know), but this time I want to only pull from master and update ko-master".

What this suggests to me is that making set of default refs to be pulled from and set of ref mappings orthgonal sounds like a good and clean way in theory, but would not be that much useful in practice.

Previous: Junio C Hamano
Message 9 of 9 in “Multi-head pulling series”
  1. Junio C HamanoAug 18, 2005
  2. 1/3 Start adding the $GIT_DIR/remotes/ support.Junio C Hamano, Aug 18, 2005
  3. 2/3 Multi-head fetch.Junio C Hamano, Aug 18, 2005
  4. 3/3 Update git-pull to match updated git-fetch.Junio C Hamano, Aug 18, 2005
  5. Josef WeidendorferAug 18, 2005
  6. Junio C HamanoAug 20, 2005
  7. Josef WeidendorferAug 22, 2005
  8. Junio C HamanoAug 23, 2005
  9. Junio C HamanoAug 23, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.