abhinav / git-spice

Manage stacked Git branches
https://abhinav.github.io/git-spice/
GNU General Public License v3.0
227 stars 14 forks source link

Merge instead of rebase for restacking #454

Open vvanirudh opened 1 day ago

vvanirudh commented 1 day ago

Thanks for the wonderful tool! We have had a great time using it so far.

Currently, we primarily use a merge-based workflow, i.e. if there are any changes down the stack, then rather than rebasing branches upstack, we would like to merge the downstack into upstack to get these changes.

Is there a way to configure git-spice to use merges instead of rebases when restacking?

abhinav commented 5 hours ago

I'd like to understand the motivations more, please.

There's nothing stopping PRs from being merged into the trunk with merge commits. Only the in-flight branches are rebased to get a linear pre-merge history. If in-flight branches used merges instead of rebases, they would constantly introduce a large number of "merge feat1 into feat2", "merge main into feat1" commits before things can merged back into trunk.

So could you elaborate on the reasoning here a bit more?