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

Re: Dangers of working on a tracking branch

From
Jeff King <peff@peff.net>
Date
Feb 16, 2007, 15:52 UTC
Message-ID
<20070216155251.GA7183@coredump.intra.peff.net>
In-Reply-To
<17877.52593.509791.685008@lisa.zopyra.com>
On Fri, Feb 16, 2007 at 09:27:45AM -0600, Bill Lear wrote:
> 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?

I think it will always work with the example you gave, because you are simultaneously fetching into the tracking branch (which fails) and merging from FETCH_HEAD (which succeeds) into that same tracking branch.

At best, though, the tracking branch you have is pointless (since you immediately overwrite it anyway). The point of a tracking branch generally is to allow you to do operations against your peer's idea of the branch (e.g., diffing against upstream's version of "topic"). But you can't do that, because "topic" always contains your topic, not upstream's. In effect, your pull becomes one without a tracking branch at all.

This will also get you on a push, where there is no merging at all, just a fast-forward (or failure). IIRC, you ran into problems before because you were trying to push into your public repo from your private, but the two had divergent branches. So I think to illustrate the problem you had before, you actually need an intermediate repo which has you fetch from and push to.

-Peff
Previous: Bill LearNext: Santi Béjar
Message 18 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.