Skip to content

fix(finish): Use the start point branch when finishing#76

Open
dermojo wants to merge 1 commit intogittower:mainfrom
dermojo:main
Open

fix(finish): Use the start point branch when finishing#76
dermojo wants to merge 1 commit intogittower:mainfrom
dermojo:main

Conversation

@dermojo
Copy link
Copy Markdown

@dermojo dermojo commented Feb 20, 2026

When finishing a branch, check the (stored) start point used to create the branch. If it differs from the configured start point, merge back to this branch instead. This ensures that e.g. creating releases from another branch works as expected.

Resolves #71
Refs #36

Remarks

  • No tests added yet
  • Docs not updated yet

Review focus:

  • Current tests suggest to me that the changed behavior is NOT intended
  • However, the current test (TestFinishUsesConfiguredParent) still passes and should be adapted
  • I want to start a discussion for this changed behavior nevertheless because I need this fix

When finishing a branch, check the (stored) start point used to create
the branch. If it differs from the configured start point, merge back
to this branch instead. This ensures that e.g. creating releases from
another branch works as expected.

Resolves gittower#71
Refs gittower#36
@dermojo dermojo changed the title fix(finish): Use the start point when finishing fix(finish): Use the start point branch when finishing Feb 20, 2026
@bmcdonnell-fb
Copy link
Copy Markdown

#71 (comment)

@alexrinass
Copy link
Copy Markdown
Contributor

Thanks for the PR and for the detailed discussion in #71 — this is a real workflow need and we want to support it properly.

That said, we'd like to think this through a bit more before merging. As discussed in #71, we want to explicitly differentiate between the starting point (where a branch is created from) and the parent (where it merges back into). Your fix uses the stored start point as the merge target, which works for your use case but may not be the right default for all scenarios (e.g., stacked feature branches where finish should target the configured parent, not the branch it was created from).

We're leaning toward introducing an explicit --parent override on start that gets stored and used by finish, rather than implicitly deriving the merge target from the start point. This makes the intent clearer and avoids surprising behavior for users who start from one branch but want to finish to another.

We'll keep this PR open as a reference while we work on the design. Appreciate the contribution and the patience!

@bmcdonnell-fb
Copy link
Copy Markdown

We're leaning toward introducing an explicit --parent override on start that gets stored and used by finish

I think a better name for the override parameter would be --target, or --merge-target? Since the existing [base] parameter is the "parent" (ancestor) of the commits the user will be creating in the release branch, in the Git sense.

@dermojo
Copy link
Copy Markdown
Author

dermojo commented Apr 13, 2026

Thanks for the feedback, your time investment in this is appreciated!

I like the proposed solution :)
If I may add a suggestion: It would be handy to have a config switch to automatically use the start point as merge target (that would avoid specifying the base branch 2x during start).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Creating releases from support branches

3 participants