-
Notifications
You must be signed in to change notification settings - Fork 152
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
Refactor pull operations to use fetch and merge #241
Conversation
|
straight.el
Outdated
(straight-vc-git--validate-head | ||
local-repo branch (format "%s/%s" remote remote-branch)) | ||
(cl-return-from straight-vc-git--pull-from-remote-raw t)))))) | ||
(straight-vc-fetch-from-remote recipe) |
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 would prefer to avoid round-tripping through the top-level VC API here. Can we use straight-vc-git-fetch-from-remote
instead?
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.
Sure.
straight.el
Outdated
local-repo branch (format "%s/%s" remote remote-branch)) | ||
(cl-return-from straight-vc-git--pull-from-remote-raw t)))))) | ||
(straight-vc-fetch-from-remote recipe) | ||
(cl-return-from straight-vc-git--pull-from-remote-raw |
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 this cl-return-from
is superfluous.
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.
Disregard previous comment, I get it now.
straight.el
Outdated
@@ -4223,9 +4152,11 @@ not just from primary remote but also from configured upstream." | |||
(interactive (list (straight--select-package "Pull package" nil 'installed) | |||
current-prefix-arg)) | |||
(let ((recipe (gethash package straight--recipe-cache))) | |||
(and (straight-vc-pull-from-remote recipe) | |||
(and (and (straight-vc-fetch-from-remote recipe) | |||
(straight-vc-merge-from-remote recipe)) |
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.
These two and
s can be collapsed together.
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.
Oh, of course.
I think this is a good idea. Further work is needed for the user experience, but this pull request is a step in the right direction. I just had a few stylistic comments, and then I will merge it. |
Also, could you elaborate on what you mean by |
I'll fix those things when I have time. I've tried taking a random package, doing a |
If you have |
`straight-pull-all` now feches first, before merging all.
I've implemented your suggestions. |
straight-pull-all
now feches first, before merging all.I've removed the low-level git pull commands as they're functionally covered by fetch and merge, and keeping the VC interface as simple as possible seems like a good idea.
Addresses some of #103