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

Re: Questions about branches in git

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 28, 2010, 23:33 UTC
Message-ID
<7v636lls8d.fsf@alter.siamese.dyndns.org>
In-Reply-To
<69b754db1001281044y39e52f77hcc8f83144776c78f@mail.gmail.com>
Mike Linck <mgl@absolute-performance.com> writes:
Show 7 quoted lines
> I understand that there are mechanism kind of available to address
> this problem.  If we (all developers in my company) remember always to
> rebase -i before they merge their topic branches back in, then it
> could be squashed making it easier to identify and cherry pick onto
> other branches, or *if* we always remember to rebase before we merge
> and then create a patch set and store that on the topic branch, we
> could kind of organize our change sets that way.

On the quite contrary, probably an easier way is to pick a the oldest commit that a fix or enhancement would apply, build a topic that deals with only the fix or enhancement in question without doing anything else on top of it, and merge the resulting topic. The choice of the fork point needs to be made wisely in such a way that the resulting topic would not cause too much undue conflicts when merged to a modern mainline but old enough that you _could_ merge the result to any older maintenance branch if you choose to.

One implication is that you do _not_ rebase the series to newer codebase because doing so would make the result unmergeable to older releases even if you later realize that the fix/enhancement would be suitable to them.

And if you fork from older commit than tip, you will automatically get a non-ff merge when you merge it back to the mainline, which would delineate the history of the side branch from the integration branches rather nicely.

Previous: Martin LanghoffNext: Mike Linck
Message 19 of 21 in “Questions about branches in git”
  1. Mike LinckJan 28, 2010
  2. Michael WittenJan 28, 2010
  3. Michael WittenJan 28, 2010
  4. Michael WittenJan 28, 2010
  5. Mike LinckJan 28, 2010
  6. Jens LehmannJan 28, 2010
  7. Mike LinckJan 28, 2010
  8. Heiko VoigtJan 28, 2010
  9. Nanako ShiraishiJan 29, 2010
  10. Junio C HamanoJan 29, 2010
  11. Nicolas PitreJan 28, 2010
  12. Eugene SajineJan 28, 2010
  13. David AguilarJan 28, 2010
  14. Michael WittenJan 28, 2010
  15. Mike LinckJan 28, 2010
  16. Michael WittenJan 28, 2010
  17. Peter KreftingJan 29, 2010
  18. Martin LanghoffJan 28, 2010
  19. Junio C HamanoJan 28, 2010
  20. Mike LinckJan 29, 2010
  21. Peter KreftingJan 29, 2010

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.