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

Re: Dangers of working on a tracking branch

From
SBSanti Béjar <sbejar@gmail.com>
Date
Feb 16, 2007, 16:10 UTC
Message-ID
<8aa486160702160810i3d92ba6fy390674dfcc9c584@mail.gmail.com>
In-Reply-To
<17877.52593.509791.685008@lisa.zopyra.com>
On 2/16/07, Bill Lear <rael@zopyra.com> wrote:
Show 26 quoted lines
> On Friday, February 16, 2007 at 10:21:30 (-0500) Jeff King writes:
> >On Fri, Feb 16, 2007 at 09:13:22AM -0600, Bill Lear wrote:
> >
> >> % git pull ../peer_repo topic:topic
> >> [...]
> >> * refs/heads/topic: not updating to non-fast forward branch 'topic' of ../peer_repo
> >> [...]
> >> So, why does it say "not updating to non-fast forward branch", yet
> >> it does the merge and gets the changes anyway?
> >
> >Because your pull command really means "merge in the topic branch from
> >peer_repo, and while you're at it, store it in my local tracking branch
> >topic". Remember that pull is really a fetch+merge. But the fetch is
> >actually doing _two_ things: putting the fetched branch into FETCH_HEAD,
> >and putting it in into refs/heads/topic. The latter fails (because of a
> >non-fastforward), but pull actually uses the FETCH_HEAD results to
> >do the merge.
> >
> >Yes, this seems overly complex for what you're doing, but the reason for
> >FETCH_HEAD is to support pulls when you _don't_ have a tracking branch
> >at all (i.e., 'git pull ../peer_repo topic').
>
> Ok, fair enough, but then I guess I'm back to my original question:
> how can I give a concrete demonstration to our developers that this is
> a bad thing?
>

It no longer works with recent git, as of v1.4.4.1-37-gd25c26e. Now git-fetch exit with a non-zero status when fast-forward check fails, so the merge does not happen.

Santi
Previous: Jeff KingNext: Nicolas Pitre
Message 19 of 22 in “Dangers of working on a tracking branch”
  1. Bill LearFeb 15, 2007
  2. Nicolas PitreFeb 15, 2007
  3. Bill LearFeb 15, 2007
  4. Bill LearFeb 15, 2007
  5. Jeff KingFeb 15, 2007
  6. Bill LearFeb 15, 2007
  7. Jeff KingFeb 15, 2007
  8. Bill LearFeb 15, 2007
  9. Shawn O. PearceFeb 15, 2007
  10. Bill LearFeb 15, 2007
  11. Shawn O. PearceFeb 15, 2007
  12. Jeff KingFeb 15, 2007
  13. Bill LearFeb 15, 2007
  14. Jakub NarebskiFeb 16, 2007
  15. Bill LearFeb 16, 2007
  16. Jeff KingFeb 16, 2007
  17. Bill LearFeb 16, 2007
  18. Jeff KingFeb 16, 2007
  19. Santi BéjarFeb 16, 2007
  20. Nicolas PitreFeb 16, 2007
  21. Bill LearFeb 16, 2007
  22. Nicolas PitreFeb 15, 2007

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.