When developing on a long-running branch (here defined as living longer than one release), what's the most accepted practice(s) to keeping the branch current with its origin while keeping the history relatively clean prior to merging back?
As an example, consider the origin branch (
m) and a (topic) branch (
t) with the following history graph:
A--------F--H--J (m) \ \ \ B----C-D-E--G-----I-----K (t)  - Release 1.0  - Release 2.0  - Hotfix 2.1  - Hotfix 2.2
t I've been merging from master (
m) periodically to keep my topic branch up to date, but there are many small commits between
K that I'd like to squash with a rebase.
I'm concerned if I squash those commits that I will change the hash of the merged commits from master and create problems for others when I merge my branch back into master for Release 3.0.
rebase -i the topic branch, I expect the graph would look like this:
A---------F---H---J (m) \ B-----------------K (t)
K contains all the squashed commits between
K including the merged changes from master (
H). If I then merge
t back to master
m I'm wondering if there likely be conflicts from
H. The graph should look like this then:
A---------F---H---J---L (m) \ / B-----------------K (t)
t can now be deleted because it's no longer used. I'd like to keep the history of where
t was branched from, so rebasing
J would lose that information and probably solve my problem but the graph would look like:
Is this a valid concern? What is the commonly-accepted practice to keep one's feature branch current with its origin while keeping a relatively clean history?
Note: the example here is simplified, there are actually hundreds of commits from the branch point to HEAD on the topic branch - over 300 - many of which could be squashed out of existence