-
Notifications
You must be signed in to change notification settings - Fork 71
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
Generate one fixup per commit, not per-hunk? #19
Comments
as you've observed, the user gets no benefit from having one fixup commit per hunk if they're both absorbing into the same commit. however, it makes the absorption loop a LOT easier to write. i would probably accept a PR for this if it could be implemented in a legible way, but instinctively i feel like this would be a scary refactor to actually do |
the advantage of limiting the number of fixup commits appears when a human inspects them. |
Chiming in with the same workflow as @stof, pushing fixup!s and squashing them only at the time of merging the PR makes it a bit easier for reviewers, compared to force pushing every time. I haven't looked at the code, but maybe doing it as a post-processing step could be more viable, instead of rewriting the loop to group hunks? As in
or if commits are not collected and committed at the end but committed immediately
|
yes, i think this is the most likely implementation that would work. you have to wait to make commits until after the entire absorption loop is done.
where as this approach sounds quite fiddly to me - because you're performing two interactive rebases in a row (one to combine fixups together, and then another to absorb the fixups into the actual commits) and you have to keep the commit messages organized. |
I have tested the new option I have a feature with one commit that contains two hunks in a single file. (Now running a soft reset to origin to start over) If I run just |
@craftey ugh, yes i can repro. it's some off-by-one line offset issue. i'm not going to revert the pr but the feature will stay out of a release until i (or someone else) have time to track it down. good thing is there's no regression in the old behavior, it still has the right line offsets there. |
Maybe @rbartlensky can have a look. |
@craftey @tummychow I can have a look this week -- thanks for the repro case! |
Opened #93 to fix the issue |
The feature is available in the 0.6.11 version on an opt-in basis:
I've been happily using it since August by adding it to my sublime merge configuration
As far as I am concerned the only reason to keep this issue open is to maybe make it the default, on which Stephen commented elsewhere:
Huge thanks again to everyone who made this happen — @rbartlensky, @tummychow, @craftey! |
fyi you can now enable [absorb]
oneFixupPerCommit = true |
Currently running git-absorb with non-trivial changes creates LOTS of fixup commits with the same message, because a separate fixup commit is created for each hunk. Is there a reason to do this or could we squash those into a few commits?
The text was updated successfully, but these errors were encountered: