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

Re: branch.pu.forcefetch

From
Junio C Hamano <junkio@cox.net>
Date
Dec 29, 2006, 02:30 UTC
Message-ID
<7v8xgrsabr.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<1167355326.15189.34.camel@dv>
Pavel Roskin <proski@gnu.org> writes:
Show 5 quoted lines
>> Are you talking about "remote.origin.fetch = +pu:refs/heads/pu"?
>
> Yes, I'm talking about that line.  And I don't like that I have to use a
> magic token "refs/heads/pu" that doesn't correspond to a real file to
> make it possible to keep git up-to-date.

I think we misunderstood each other. That line is inconsistent with what your config has, which is the separate-remote layout, which I did not know you were using. In separate-remote layout, you don't have refs/heads/pu so if we do not do the patches you are agreeing to, you would want to have something like:

	[remote "origin"]
                fetch = +refs/heads/pu:refs/remotes/origin/pu
        	fetch = refs/heads/*:refs/remotes/origin/*

In other words, "path does not correspond to a real file" problem does not exist. If you tell git to track 'pu' at refs/remotes/origin/pu, it will use that path -- so that path has a corresponding real file.

> Unfortunately, updating the current branch fails because pu is not
> fast-forwarding.  Why fail if I'm not even on pu?

Your being not on 'pu' does not have anything to do with it. In fact, you do not even want to be _on_ any of your tracking branches. In the separate-remote layout, you cannot even be on remotes/origin/pu branch.

What you are seeing is fetch's safety feature that stops and notifies you the situation when the remote rewinds/rebases the branch you are tracking with tracking branches. We have had it turned on by default for a long time, and you have it turned on in your config because that is the default. If you do not want to use that feature (and for git.git, you certainly don't), just turn it off. When you know you do not want to use a feature, you do not have to.

Turning it off by default was not a wise thing to do in general for a long time, because rewound/rebased tip loses information, and we did not have reflog enabled by default. Your message raised this issue to attention of the list, and I suggested two patches out of it, both of which I think are sane things to do. If the list agrees, we can turn it off by default now.

Previous: Pavel RoskinNext: Pavel Roskin
Message 12 of 14 in “branch.pu.forcefetch”
  1. Pavel RoskinDec 27, 2006
  2. Jakub NarebskiDec 27, 2006
  3. Junio C HamanoDec 27, 2006
  4. Jakub NarebskiDec 27, 2006
  5. Pavel RoskinDec 28, 2006
  6. Junio C HamanoDec 28, 2006
  7. 1/2 core.logallrefupdates: log remotes/ tracking branches.Junio C Hamano, Dec 29, 2006
  8. 2/2 Allow non-fast-forward of remote tracking branches in default cloneJunio C Hamano, Dec 29, 2006
  9. Shawn PearceDec 29, 2006
  10. Johannes SchindelinDec 29, 2006
  11. Pavel RoskinDec 29, 2006
  12. Junio C HamanoDec 29, 2006
  13. Pavel RoskinDec 29, 2006
  14. Shawn PearceDec 29, 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.