-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Handle empty commits during cherry-pick and offer skip or continue options #4925
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
Open
kosiew
wants to merge
42
commits into
jesseduffield:master
Choose a base branch
from
kosiew:cherry-freeze-4763
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,383
−48
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Update README to describe new behavior for cherry-picking empty commits. - Implement CommitAllowEmpty method to allow creating empty commits. - Modify cherry-pick error handling to prompt user for action on empty cherry-picks. - Add translations for new prompts in multiple languages. - Introduce integration test for cherry-picking a commit with no changes.
…rate new test case
…ng tree state before proceeding with commands
…mpty cherry-pick scenarios
…ntegrate with rebase helper
… by conflict resolution
…s with user prompts and integrate tests for empty commit resolutions
…inuing rebase and update revert test to select create empty commit option
…herry-pick and rebase scenarios
…t handling and reorder conflict checks
…dling and remove redundant checks for merge conflicts
…s and improve error handling for empty commits
…ommit produces no changes
… handling and remove redundant conflict check
…ing to improve clarity and reduce redundancy
…add support for "equals one of" matcher in tests
…ed on Git version
…g based on Git version
… for cherry-pick command
…ts argument based on Git version
…ick scenarios and improve popup interactions
…ng and cleanup process
…s and improve handling of empty commits in tests
…post-paste selection and improve handling after empty cherry-pick resolution
…reselect handling
… post-paste reselect based on parameter
…ct and update test assertions for empty commits
…pping empty cherry-picks
…lution to preserve post-paste reselect option
…disable post-paste reselect and improve test assertions for conflict scenarios
…rrectly highlight the selected commit
- Updated `CherryPickHelper` to modify the `postPasteCleanup` function to accept a boolean parameter indicating whether to mark the paste operation. - Added `postPasteShouldMarkDidPaste` field to manage the state of whether to mark as done after pasting. - Adjusted the logic in several methods (`Paste`, `runPostPasteCleanup`, etc.) to handle the new parameter appropriately. - Updated integration tests to reflect changes in expected behavior for cherry-picking during rebase and empty autostash scenarios.
…king and add integration tests for empty intermediate commits
9168622
to
2677cfd
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes: #4763
PR Description
This PR improves lazygit's handling of cherry-pick operations that result in an empty commit (i.e., the commit makes no changes to the working tree). In such cases, Git allows the user to either skip the commit or create an empty one using
--allow-empty
. Prior to this patch, lazygit would freeze or leave the UI in an unresolved state when this happened.This update introduces:
--empty=stop
.This improves UX by removing the need to drop to the command line during edge-case cherry-pick flows.
Please check if the PR fulfills these requirements
go generate ./...
)Additional Notes:
--empty=stop
for Git >= 2.45 to halt on empty commits for cherry-pick operations.This ensures a smooth and intuitive cherry-pick workflow, even in complex scenarios — all within the lazygit UI ✨