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

Add option to stack to use merge rather than rebase #36

Merged
merged 2 commits into from
Sep 20, 2024

Conversation

yashNaN
Copy link
Contributor

@yashNaN yashNaN commented Jun 6, 2024

Stacky should work just fine with either rebasing or git merging.

This makes a change that adds a [GIT] section to the stacky config and 2 settings use_merge and use_force_merge to change to merge commits and disallowing force pushes. If we disallow force pushes and want to use merging we should also disallowing amending commits, which this pr does.

Sample ~/.stackyconfig with these changes set

  [UI]
  change_to_main = True
  
  [GIT]
  use_merge = True
  use_force_push = False

Tested by creating a stack of 3 branches using normal stacky commands

@yashNaN yashNaN marked this pull request as ready for review June 6, 2024 19:50
@mpatou mpatou requested review from mpatou and tudor June 6, 2024 19:58
@mpatou
Copy link
Contributor

mpatou commented Jun 6, 2024

Looks good to me, I wished you could add some test to cover, we don't have yet too many tests but it would be good.
I would like to get the opinion of @tudor too on allowing merge.
I don't like merge we do protect against that, I also understand it's off by default but ...

@yashNaN
Copy link
Contributor Author

yashNaN commented Jun 6, 2024

Yeah I have the opposite issue, my team disallows rebasing and only allows merging. So I would need this to make stacky work with that.

I kind of buy the argument. git log --first-parent will let you see the commits like you expect. And in github you can avoid force-pushing so that when reviewing you can check only the changes since the last time you've reviewed.

@@ -19,6 +19,7 @@
# onwards). After updating a parent branch P, given a child branch C,
# we rebase everything from C's PC until C's tip onto P.
#
#
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: not sure that this is really needed I guess more comments line won't hurt

@mpatou mpatou merged commit 5a045c6 into rockset:master Sep 20, 2024
15 checks passed
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.

3 participants