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

Re: [PATCH v3 3/3] rebase-merges: try and use branch names as labels

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 9, 2024, 17:57 UTC
Message-ID
<xmqqr08ptb0e.fsf@gitster.g>
In-Reply-To
<ca5f7ce3-f3ec-4627-b503-6b43695c9439@gmail.com>
Phillip Wood <phillip.wood123@gmail.com> writes:
Show 41 quoted lines
> Hi Nicolas
>
> On 09/10/2024 08:58, Nicolas Guichard via GitGitGadget wrote:
>> From: Nicolas Guichard <nicolas@guichard.eu>
>> When interactively rebasing merge commits, the commit message is
>> parsed to
>> extract a probably meaningful label name. For instance if the merge commit
>> is “Merge branch 'feature0'”, then the rebase script will have thes lines:
>> ```
>> label feature0
>> merge -C $sha feature0 # “Merge branch 'feature0'
>> ```
>> This heuristic fails in the case of octopus merges or when the merge
>> commit
>> message is actually unrelated to the parent commits.
>> An example that combines both is:
>> ```
>> *---.   967bfa4 (HEAD -> integration) Integration
>> |\ \ \
>> | | | * 2135be1 (feature2, feat2) Feature 2
>> | |_|/
>> |/| |
>> | | * c88b01a Feature 1
>> | |/
>> |/|
>> | * 75f3139 (feat0) Feature 0
>> |/
>> * 25c86d0 (main) Initial commit
>> ```
>> yields the labels Integration, Integration-2 and Integration-3.
>> Fix this by using a branch name for each merge commit's parent that
>> is the
>> tip of at least one branch, and falling back to a label derived from the
>> merge commit message otherwise.
>> In the example above, the labels become feat0, Integration and feature2.
>
> This looks like a nicely described useful improvement, thank you for
> working on it. The way the code is structured means we always
> calculate the fallback label before seeing if there is a branch name
> we could use instead but as calculating the fallback is cheap I don't
> think that's a problem in practice.
Thanks, both of you.
Will queue.
Previous: Phillip WoodNext: Phillip Wood
Message 17 of 18 in “rebase-merges: try and use branch names for labels”
  1. 0/2 rebase-merges: try and use branch names for labelsNicolas Guichard via GitGitGadget, Sep 21, 2024
  2. 1/2 sequencer.c: extract load_branch_decorationsNicolas Guichard via GitGitGadget, Sep 21, 2024
  3. Junio C HamanoSep 23, 2024
  4. 2/2 rebase-merges: try and use branch names as labelsNicolas Guichard via GitGitGadget, Sep 21, 2024
  5. Junio C HamanoSep 23, 2024
  6. 0/3 rebase-merges: try and use branch names for labelsNicolas Guichard via GitGitGadget, Oct 4, 2024
  7. 1/3 load_branch_decorations: fix memory leak with non-static filtersNicolas Guichard via GitGitGadget, Oct 4, 2024
  8. Eric SunshineOct 5, 2024
  9. 2/3 rebase-update-refs: extract load_branch_decorationsNicolas Guichard via GitGitGadget, Oct 4, 2024
  10. Eric SunshineOct 5, 2024
  11. 3/3 rebase-merges: try and use branch names as labelsNicolas Guichard via GitGitGadget, Oct 4, 2024
  12. 0/3 rebase-merges: try and use branch names for labelsNicolas Guichard via GitGitGadget, Oct 9, 2024
  13. 1/3 load_branch_decorations: fix memory leak with non-static filtersNicolas Guichard via GitGitGadget, Oct 9, 2024
  14. 2/3 rebase-update-refs: extract load_branch_decorationsNicolas Guichard via GitGitGadget, Oct 9, 2024
  15. 3/3 rebase-merges: try and use branch names as labelsNicolas Guichard via GitGitGadget, Oct 9, 2024
  16. Phillip WoodOct 9, 2024
  17. Junio C HamanoOct 9, 2024
  18. Phillip WoodOct 9, 2024

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.