* Incorrect branch information after fetching (local branch != remote branch)
@ 2022-05-03 4:58 Bagas Sanjaya
2022-05-03 5:51 ` Junio C Hamano
0 siblings, 1 reply; 4+ messages in thread
From: Bagas Sanjaya @ 2022-05-03 4:58 UTC (permalink / raw)
To: git
Hi,
I have a copy of linux.git (Linux kernel) repository, with following
branch mapping:
* master -> torvalds/master (Linus' mainline tree)
* linux-5.*.y -> stable/linux-5.*.y (Stable tree)
* net-next -> net-next/master (net-next tree)
When I fetch the mainline tree (torvalds/master), I get the expected
branch fetching info:
From https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux
672c0c5173427e..9050ba3a61a4b5 master -> torvalds/master
When I fetch net-next, I get possibly incorrect branch name instead:
From https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next
6e28f56c0d1d97..0530a683fc858a master -> net-next/master
I expected that net-next (local branch name) is displayed instead of
master in this case.
Thanks.
--
An old man doll... just what I always wanted! - Clara
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Incorrect branch information after fetching (local branch != remote branch)
2022-05-03 4:58 Incorrect branch information after fetching (local branch != remote branch) Bagas Sanjaya
@ 2022-05-03 5:51 ` Junio C Hamano
2022-05-03 6:42 ` Bagas Sanjaya
0 siblings, 1 reply; 4+ messages in thread
From: Junio C Hamano @ 2022-05-03 5:51 UTC (permalink / raw)
To: Bagas Sanjaya; +Cc: git
Bagas Sanjaya <bagasdotme@gmail.com> writes:
> I have a copy of linux.git (Linux kernel) repository, with following
> branch mapping:
>
> * master -> torvalds/master (Linus' mainline tree)
> * linux-5.*.y -> stable/linux-5.*.y (Stable tree)
> * net-next -> net-next/master (net-next tree)
>
> When I fetch the mainline tree (torvalds/master), I get the expected
> branch fetching info:
>
> From https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux
> 672c0c5173427e..9050ba3a61a4b5 master -> torvalds/master
>
> When I fetch net-next, I get possibly incorrect branch name instead:
>
> From https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next
> 6e28f56c0d1d97..0530a683fc858a master -> net-next/master
>
> I expected that net-next (local branch name) is displayed instead of
> master in this case.
>
> Thanks.
I may be entirely missing what you are raising as a problem, but visiting
https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/
shows that their primary branch is called 'master'.
The verbose report left by "git fetch" tells us what branch they
have is used to update what branch we have, so I think this is
pretty much expected.
I am puzzled by your mention of 'net-next' (local).
You may have
[branch "net-next"]
remote = net-next
merge = master
and that is where your expectation on the local may be coming from,
but it wouldn't be all that relevant to "git fetch". The update of
the local branch will happen long after "git fetch" is done.
Besides, you may have more than one local branch that is forked from
the same remotes/net-next/master remote-tracking branch and at that
point "git fetch" wouldn't be able to tell which one of these
multiple local branches to show.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Incorrect branch information after fetching (local branch != remote branch)
2022-05-03 5:51 ` Junio C Hamano
@ 2022-05-03 6:42 ` Bagas Sanjaya
2022-05-03 6:49 ` Junio C Hamano
0 siblings, 1 reply; 4+ messages in thread
From: Bagas Sanjaya @ 2022-05-03 6:42 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
On 5/3/22 12:51, Junio C Hamano wrote:
> The verbose report left by "git fetch" tells us what branch they
> have is used to update what branch we have, so I think this is
> pretty much expected.
>
> I am puzzled by your mention of 'net-next' (local).
>
> You may have
>
> [branch "net-next"]
> remote = net-next
> merge = master
>
> and that is where your expectation on the local may be coming from,
> but it wouldn't be all that relevant to "git fetch". The update of
> the local branch will happen long after "git fetch" is done.
>
Ah I see.
So the left-hand side of verbose report (local branch) is actually
the value of branch."net-next".merge, right?
--
An old man doll... just what I always wanted! - Clara
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Incorrect branch information after fetching (local branch != remote branch)
2022-05-03 6:42 ` Bagas Sanjaya
@ 2022-05-03 6:49 ` Junio C Hamano
0 siblings, 0 replies; 4+ messages in thread
From: Junio C Hamano @ 2022-05-03 6:49 UTC (permalink / raw)
To: Bagas Sanjaya; +Cc: git
Bagas Sanjaya <bagasdotme@gmail.com> writes:
> On 5/3/22 12:51, Junio C Hamano wrote:
>> The verbose report left by "git fetch" tells us what branch they
>> have is used to update what branch we have, so I think this is
>> pretty much expected.
>>
>> I am puzzled by your mention of 'net-next' (local).
>>
>> You may have
>>
>> [branch "net-next"]
>> remote = net-next
>> merge = master
>>
>> and that is where your expectation on the local may be coming from,
>> but it wouldn't be all that relevant to "git fetch". The update of
>> the local branch will happen long after "git fetch" is done.
>>
>
> Ah I see.
>
> So the left-hand side of verbose report (local branch) is actually
> the value of branch."net-next".merge, right?
Not really. It comes from
[remote "net-next"]
remote = https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next
fetch = refs/heads/*:refs/remotes/net-next/*
and the fact that the remote happens to have only one branch under
its refs/heads/ hierarchy. Fetch does not care all that much about
"branch.*.merge" (which is what I said---the configuration is not
all that relevant to "git fetch").
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-05-03 6:49 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-03 4:58 Incorrect branch information after fetching (local branch != remote branch) Bagas Sanjaya
2022-05-03 5:51 ` Junio C Hamano
2022-05-03 6:42 ` Bagas Sanjaya
2022-05-03 6:49 ` Junio C Hamano
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).