-
Notifications
You must be signed in to change notification settings - Fork 5.9k
git: Add support for git pull with rebase #41117
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
git: Add support for git pull with rebase #41117
Conversation
|
We require contributors to sign our Contributor License Agreement, and we don't have @Sathiyaraman-M on file. You can sign our CLA at https://zed.dev/cla. Once you've signed, post a comment here that says '@cla-bot check'. |
|
@cla-bot check |
|
The cla-bot has been summoned, and re-checked this pull request! |
cole-miller
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, one piece of feedback but seems good otherwise!
crates/git/src/repository.rs
Outdated
| .envs(env.iter()) | ||
| .current_dir(&working_directory?) | ||
| .args(["pull"]) | ||
| .arg(if rebase { "--rebase" } else { "--no-rebase" }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we shouldn't pass --no-rebase if rebase is false here, so you get the configured behavior for the branch (which might be either merge or rebase)--this is how git::Pull works in Zed now and we should maintain that behavior.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
|
@cole-miller Gentle reminder: I've addressed the comment. Could you please take another look when you have time? Thanks! |
|
Thank you! |
- Adds a new action `git::PullRebase` which adds `--rebase` in the final command invoked by existing Git-Pull implementation. - Includes the new action in "Fetch/Push" button in the Git Panel (screenshot below) - Adds key-binding for `git::PullRebase` in all three platforms, following the existing key-binding patterns (`ctrl-g shift-down`) - Update git docs to include the new action. Sidenote: This is my first ever OSS contribution Screenshot: <img width="234" height="215" alt="image" src="https://github.com/user-attachments/assets/713d068f-5ea5-444f-8d66-444ca65affc8" /> --- Release Notes: - Git: Added `git: pull rebase` for running `git pull --rebase`.
git::PullRebasewhich adds--rebasein the final command invoked by existing Git-Pull implementation.git::PullRebasein all three platforms, following the existing key-binding patterns (ctrl-g shift-down)Sidenote: This is my first ever OSS contribution
Screenshot:
Release Notes:
git: pull rebasefor runninggit pull --rebase.