-
Notifications
You must be signed in to change notification settings - Fork 151
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
Lots of prompts when doing straight-pull-all is tiring #158
Comments
Oh right so you're saying there would be a popup for each package even if the repos were not in detached head states? Yeah so similar to #103 I just want to say update all my packages and then come back to them all updated (or not if there's failures) without having to stay at emacs answering all the prompts. Even if the operation is synchronous, it would still be better than how it is now in my opinion. My searches didn't find #66 though, I feel like this issue is a duplicate of that? PS - Nice title for #66. |
In the vein of "baby steps" how about making |
@xendk Yeah that seems very reasonable to me. |
Sounds good. I can't deny it's an improvement over the current situation. |
I did this, but then got cold feet. Feels wrong to have I considered adding a So I thought, shouldn't So I think we need a looser "check that we haven't diverted too much" function that won't consider HEAD being behind remote/HEAD a problem (it could still call But taking a step back, I seem to have muddied the waters (at least in my own head). The original issue as about detached heads, which is properly dealt with in #66. The
part is somewhat addressed in #241 (at least one can get coffee while fetching the repos and answer all the questions in quick succession), which leaves getting |
Isn't it sufficient to allow fast-forwarding when the (cl-defun straight-vc-git--validate-head (local-repo branch &optional ref)
"Validate that LOCAL-REPO has BRANCH checked out.
If REF is non-nil, instead validate that BRANCH is ahead of REF.
Any untracked files created by checkout will be deleted without
confirmation, so this function should only be run after
`straight-vc-git--validate-worktree' has passed."
Yes, that would be great. |
@raxod502 And it's really Not entirely sure how I see this, but I haven't had time to properly work on it. |
Just to be clear,
But these are both good arguments. ¯\_(ツ)_/¯
Yeah, same and probably for quite a while. So I'm pretty open to whatever solutions may be proposed, if they make things better :) |
Yeah.. But I just realized, from the docstring:
That's the exact opposite of what thee situation is for a fast-forward to be possible. Donno if this insight helps me much, though. Thinking of possible usecases, I'm tempted to create some simpler "check that worktree is clean and we're ahead/behind the remote head" and letting users deal with everything else in magit... I'm pondering Aah well, one of these days I'll have an evening where I can properly dig in. |
No, it's the only situation in which a fast-forward is possible—namely, if the branch is behind the ref and needs to be fast-forwarded so that it's ahead. |
Eh, no, unless we're talking past each other. If branch is master and ref is origin/master, if branch is ahead of ref, it can't be fast-forwarded (would rather be a reset). Fast-forwarding is possible when branch is behind ref. Unless I'm really bad at reading the docstring/code. That would make it suitable for checking if the branch could be pushed. Or am I entirely blind? |
Very likely :P (but that's my fault too) So let me clarify the terminology used in the docstring:
So As a consequence, "validate that |
Aha, that's reason for the misunderstanding. I'm used to thinking of "validate" as "check that X is the case", not as "ensure that X is the case". I'd have named the function with "ensure". Then automatic fast-forwarding makes sense again. I'll give it another pass with my newfound insight. |
|
That seems more reasonable. I have no objection to a rename. I think the reason for the nomenclature is that I started with |
I think it is. |
After reproducing an emacs config from the version lockfile on another machine, I did
straight-pull-all
on it to update all my packages. Then this prompt popped up for each package:https://github.com/raxod502/straight.el/blob/87525b5b89ed8b6a6823422b0d9b0cb097eeac04/straight.el#L1038-L1040
So I had to press
a
for all packages to update them, which you can believe can be really repetitive and tiring especially if you have a lot of packages (like 100s). I think it was detached becausegit checkout <commit>
was used for all the packages to get them on the correct revisions as specified by the lockfile? Would usinggit reset --hard <commit>
instead work (to avoid the detached head state)?The text was updated successfully, but these errors were encountered: