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

Re: Default remote branch for local branch

From
PRPavel Roskin <proski@gnu.org>
Date
Apr 1, 2006, 04:18 UTC
Message-ID
<1143865123.14465.26.camel@dv>
In-Reply-To
<7vodzmngfp.fsf@assigned-by-dhcp.cox.net>
Hello, Junio!
On Fri, 2006-03-31 at 19:05 -0800, Junio C Hamano wrote:
Show 9 quoted lines
>  - Multiple subsystem maintainer trees tracked in the same local
>    repository.  Most generally, two local branches per each
>    remote head can be used (one tracking branch to fetch into,
>    another to build your changes based on it).  Alternatively,
>    you can use one local branch per each remote head without
>    using any tracking branch.
> 
> Your proposal to give default branch to pull from per the local
> branch would help only the last case.

Exactly. I tried to track the main Linus repository and Jeff Garzik's netdev in one place. Then I discovered that my repository if full of unintended merges made by "stg pull".

Show 14 quoted lines
> The first one you do not
> switch between local branches at all and pull from many
> different places; the second is to merge from different topic
> branches from time to time and does not benefit from fixed
> configuration; the third does not even need configuration.
> 
> Maybe you would want something like this.
>
> In $GIT_DIR/config:
> 
> 	[pull]
> 	origin = linus for master
>         origin = irq-pio of libata for ata-irq-pio
>         origin = pata-drivers of libata for ata-pata

First of all, using "origin" on every line carries to little information.

Secondly, I think the relationship should be between a local development branch and a local tracking branch. After all, all remote data is placed on a local tracking branch first. It's better not to jump over layers of abstraction. Suppose I want to update "masterB". I tell git to sync "originB" first. git already has rules what to do if it should sync "originB". Let's not supersede those rules.

I would write the config like this:

[branch-upstream] master = linus ata-irq-pio = irq-pio ata-pata = pata-drivers

Show 12 quoted lines
> While we are on the topic, it _might_ be worthwhile to think
> about revamping the syntax of $GIT_DIR/remotes file, maybe even
> breaking backward compatibility.  The Pull: lines can be
> independently specified which gives flexibility, but I suspect
> local tracking branches from the same remote tend to live in the
> same place; IOW, you would probably not do something like:
> 
> 	URL: git://git.kernel.org/.../jgarzik/libata-dev.git
> 	Pull: refs/heads/irq-pio:refs/remotes/libata/irq-pio
> 	Pull: refs/heads/pata-drivers:refs/heads/pata-drivers
> 
> in practice.
Sorry, I don't understand this part.
-- 
Regards,
Pavel Roskin
Previous: Junio C HamanoNext: Josef Weidendorfer
Message 3 of 15 in “Default remote branch for local branch”
  1. Pavel RoskinApr 1, 2006
  2. Junio C HamanoApr 1, 2006
  3. Pavel RoskinApr 1, 2006
  4. Josef WeidendorferApr 2, 2006
  5. Junio C HamanoApr 2, 2006
  6. Josef WeidendorferApr 2, 2006
  7. Andreas EricssonApr 3, 2006
  8. Josef WeidendorferApr 3, 2006
  9. Andreas EricssonApr 3, 2006
  10. Junio C HamanoApr 3, 2006
  11. Josef WeidendorferApr 3, 2006
  12. Petr BaudisApr 14, 2006
  13. Josef WeidendorferApr 14, 2006
  14. Jakub NarebskiApr 1, 2006
  15. Jakub NarebskiApr 1, 2006

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.