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

Re: [RFC/PATCH 3/3] push: add separate 'downstream' branch

From
Felipe Contreras <felipe.contreras@gmail.com>
Date
May 16, 2013, 14:53 UTC
Message-ID
<CAMP44s0DjCunjHHEs1SZoR502Uyk7LdGeBDz4nxqgG0GmdEDng@mail.gmail.com>
In-Reply-To
<CALkWK0my3kET2hdZre57NiNxiENoZ+XVLYjU-XMs+Xoche9QoQ@mail.gmail.com>

On Thu, May 16, 2013 at 8:52 AM, Ramkumar Ramachandra <artagnon@gmail.com> wrote:

Show 5 quoted lines
> Felipe Contreras wrote:
>> Does branch.<name>.merge overrides remote.<name>.fetch? No. They
>> complement each other.
>
> I often wonder if you are reading what you're responding to:
And I wonder if you care if what you say is actually true.
> remote.<name>.fetch is operated on by fetch, while branch.<name>.merge
> is operated on by merge; they are really orthogonal.

You keep saying they are orthogonal, but they are not. Read remote.c::branch_get().

And try this:
[remote "origin"]
	url = git@github.com:felipec/git.git
	# fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
	remote = origin
	merge = refs/heads/master
Can you merge? No. Can you do master@{u}? No. Several other things don't work.
Show 9 quoted lines
>> The same that 'git pull' does when both branch.<name>.merge and
>> remote.<name>.fetch are set.
>
> Are you reading this?
>
> git pull _fetches_ from remote.<name>.fetch and _merges_ from
> branch.<name>.merge.  What is "the same" in git push terms?  It's a
> simple question; which ref does push update: the one specified by
> remote.<name>.push or branch.<name>.push?
[remote]
	pushdefault = origin
[remote "origin"]
	push = refs/head/*:refs/heads/for/*
[branch "master"]
	pushremote = github
	push = refs/heads/new-master
[branch "next"]
	pushremote = origin
	push = refs/heads/new-next
% git checkout master && git push
Where should it go? github/new-master. Obviously.
% git checkout next && git push
Where should it go? origin/new-next. Obviously.
% git checkout main && git push
Where should it go? origin/for/maint. Obviously.
I don't see what the big deal is.
Show 5 quoted lines
>> Of course it would work. Does @{u} stop working when remote.<name>.fetch is set?
>
> It doesn't work when _only_ remote.<name>.fetch is set: you need
> branch.<name>.merge to determine @{u}, just like you would need
> branch.<name>.push to determine @{d}.
So? The answer is no.
>> It is a downstream branch.
>
> Which commit does git show @{d} show you?  There is no ref called
> refs/for/master.

The same commit 'git show @{-10000}' shows you. The fact it doesn't resolve to a commit doesn't mean @{-100} is not the nth-hundredth previous checkout.

-- 
Felipe Contreras
Previous: Ramkumar Ramachandra
Message 28 of 28 in “New kind of upstream branch: downstream branch”
  1. 0/3 New kind of upstream branch: downstream branchFelipe Contreras, May 16, 2013
  2. 1/3 remote: don't override default if cur head remote is '.'Felipe Contreras, May 16, 2013
  3. 2/3 pull: trivial cleanupsFelipe Contreras, May 16, 2013
  4. Ramkumar RamachandraMay 16, 2013
  5. Felipe ContrerasMay 16, 2013
  6. Ramkumar RamachandraMay 16, 2013
  7. Felipe ContrerasMay 16, 2013
  8. Ramkumar RamachandraMay 16, 2013
  9. Felipe ContrerasMay 16, 2013
  10. Ramkumar RamachandraMay 16, 2013
  11. Felipe ContrerasMay 16, 2013
  12. Antoine PelisseMay 16, 2013
  13. Felipe ContrerasMay 16, 2013
  14. 3/3 push: add separate 'downstream' branchFelipe Contreras, May 16, 2013
  15. Junio C HamanoMay 16, 2013
  16. Felipe ContrerasMay 16, 2013
  17. Junio C HamanoMay 16, 2013
  18. Junio C HamanoMay 16, 2013
  19. Ramkumar RamachandraMay 16, 2013
  20. Felipe ContrerasMay 16, 2013
  21. Ramkumar RamachandraMay 16, 2013
  22. Felipe ContrerasMay 16, 2013
  23. Ramkumar RamachandraMay 16, 2013
  24. Felipe ContrerasMay 16, 2013
  25. Ramkumar RamachandraMay 16, 2013
  26. Felipe ContrerasMay 16, 2013
  27. Ramkumar RamachandraMay 16, 2013
  28. Felipe ContrerasMay 16, 2013

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.