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

Re: Rebasing a branch with merges

From
RDRobert Dailey <rcdailey.lists@gmail.com>
Date
Jan 9, 2017, 18:52 UTC
Message-ID
<CAHd499CuZBXF0AddP7AfqtzvA8rBArwqtktRmNdD-kwGUCruLg@mail.gmail.com>
In-Reply-To
<49C0981FE7D04AE2AC0BBB011FD74B90@PhilipOakley>
On Fri, Jan 6, 2017 at 3:28 PM, Philip Oakley <philipoakley@iee.org> wrote:
Show 27 quoted lines
> From: "Robert Dailey" <rcdailey.lists@gmail.com>
>>
>> Here's the scenario:
>>
>> I create a topic branch so one other developer and myself can work on
>> a feature that takes 2 weeks to complete. During that 2 week period,
>> changes are occurring on master that I need in my topic branch. Since
>> I have a collaborator on the branch, I opt for merges instead of
>> rebase.
>>
>> Each day I merge from master to the topic branch, which changes code
>> I'm actively working in and requires semantic changes (functions
>> renamed, moved, etc).
>>
>> Once I'm ready to merge the topic branch back into master, I have two
>> options (bearing in mind the goal is to keep history as clean as
>> possible. Furthermore this implies that the constant merging into
>> topic from master has made the topic branch look unwieldy and
>> difficult to audit):
>
>
> a broader question zero;
> 0. Is the merge always clean? Do you always do a preparatory fixup! to
> ensure that the merge will be clean?
>
> Ensuring that the merge will be clean should greatly simplify your decision
> about process.

I don't understand what you're asking. How would I do a fixup with merges? Can you explain a bit? Normally the only time I use fixup! or squash! is for local changes prior to pushing.

Show 16 quoted lines
>> 1. Do a squash merge, which keeps history clean but we lose context
>> for the important bits (the commits representing units of work that
>> contribute to the topic itself).
>>
>> 2. Do a final rebase prior to merging.
>>
>> #2 doesn't seem to be possible due to patch ordering. For example, if
>> I have real commits after merge commits that depend on those changes
>> from master being present as a base at that point in time, the rebase
>> will cause the patch before it to no longer include those changes from
>> master.
>
>
> How much of the historic fixups to cover changes on master do you want to
> keep visible? i.e. how many fork-points are truly needed (a. by you, b. by
> the project - personal knowledge vs corporate knowledge).?

Again, I do not understand. Maybe the first question you asked needs to be understood before I can answer this one. Sorry for the trouble.

Previous: Philip OakleyNext: Philip Oakley
Message 3 of 4 in “Rebasing a branch with merges”
  1. Robert DaileyJan 6, 2017
  2. Philip OakleyJan 6, 2017
  3. Robert DaileyJan 9, 2017
  4. Philip OakleyJan 9, 2017

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.