Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Supporting moving fixup commits be last commit in their branch #157

Open
2 tasks done
vlovich opened this issue Nov 9, 2021 · 4 comments
Open
2 tasks done

Supporting moving fixup commits be last commit in their branch #157

vlovich opened this issue Nov 9, 2021 · 4 comments
Labels
question Uncertainty is involved

Comments

@vlovich
Copy link

vlovich commented Nov 9, 2021

  • I have searched the discussions
  • I have searched the existing issues

Version

0.3

Use Case

Would be nice if git-stack could be taught to handle fixup commits for parent features by making them the new tips. For example, if I have

--- a commit 1
--- b commit 2
--- feature A commit 3
--- feature B commit 4
--- e commit 5
--- feature C fixup! commit 2

I would like git stack --rebase --fixup move to produce:

--- a commit 1
--- b commit 2
--- c commit 3
--- feature A fixup! commit 2
--- feature B commit 4
--- feature C commit 5

Currently the behavior appears to be very inconsistent and never what I want. Either the fixups are ignored or they end up in the wrong branch

--- a commit 1
--- b commit 2
--- feature A commit 3
--- d commit 4
--- feature B fixup! commit 2
--- feature C commit 5

Requirements

git stack --rebase --fixup move should move the fixup commits to be the new tips of the changed branches.

Possible Solutions

No response

@vlovich vlovich added the question Uncertainty is involved label Nov 9, 2021
@epage
Copy link
Collaborator

epage commented Nov 10, 2021

I think you are being affected by the bug that was fixed in 0.4.8. I just realized there are several more fixes in master (unrelated to this), so I'd recommend upgrading to the newly released 0.5.0.

@vlovich
Copy link
Author

vlovich commented Nov 12, 2021

I just tried & what I got was better but still not quite what I want. Our commit policy is to push a fixup commit before squashing so that we can see what changed in the PR. Thus I need the fixup commit to be moved to be the last commit of the branch containing the commit being fixed up, not beside the commit it's fixing up.

So:

⌽ fa131bc Speedup our CI build by 2x.
⌽ 5ba7434 More cleanup
⌽ c64fc1f Some piece of feature 1
⌽ 0d4f837 Some other piece of feature 1
⌽ vlovich/feature-1 (pushed) Final piece of feature 1.
⌽ 66b4dc6 moAR commits
⌽ 163fb6d more commits
⌽ 6aebbfd do something
⌽ 411b244 fixup! Speedup our CI build by 2x.
⌽ 163fb6d fixup! Some other piece of feature 1
⌽ vlovich/feature-2 fixup! Some piece of feature 1

rebased with a hypothetical --fixup move-tip would be:

⌽ fa131bc Speedup our CI build by 2x.
⌽ 5ba7434 More cleanup
⌽ c64fc1f Some piece of feature 1
⌽ 0d4f837 Some other piece of feature 1
⌽ 1c29876 (pushed) Final piece of feature 1.
⌽ 7b95e47 fixup! Speedup our CI build by 2x.
⌽ df1bf3f fixup! Some other piece of feature 1
⌽ vlovich/feature-1 fixup! Some piece of feature 1
⌽ 66b4dc6 moAR commits
⌽ 163fb6d more commits
⌽ vlovich/feature-2 do something

@epage epage changed the title Supporting moving fixup commits to parent branches Supporting moving fixup commits be last commit in their branch Nov 12, 2021
@epage
Copy link
Collaborator

epage commented Nov 12, 2021

I can see how that would be helpful though with the downside that you delay discovering how cleanly you can move the commit to be right after what it fixes.

When doing this workflow, do you eventually do a "move" or do you only need "move-tip" and squash?

The main issue will be finding a way to expose this clearly. I worry a --fixup move-tip won't be very clear. I wonder if there can be a separate config field for fixup move policy but what to call that and what to call the values still needs answering.

@vlovich
Copy link
Author

vlovich commented Nov 15, 2021

We just move tip and squash so having a confit option that changes where we move to is fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Uncertainty is involved
Projects
None yet
Development

No branches or pull requests

2 participants