Conversation
repository/repository.go
Outdated
There was a problem hiding this comment.
What happens if you pass a commit message here?
There was a problem hiding this comment.
Nothing, unfortunately
There was a problem hiding this comment.
Yeah you can in .git/SQUASH_MSG
There was a problem hiding this comment.
but then it still needs a git commit after 🤔... not an ideal solution. i guess what i want is maybe closer to a git rebase -i --autosquash but non interactive and rewriting the final commit message.
3a7d187 to
f58a545
Compare
4870ca1 to
6a57aa3
Compare
0403d65 to
fa2ffeb
Compare
fa2ffeb to
d4b7894
Compare
6760175 to
26ad3a2
Compare
|
@eunomie Do you mind taking this out for a spin and see if it replaces your manual There's an alternate implementation (commented) in |
|
I tried both merge and apply in 46ce377. For both
For
I'm not familiar enough with merge strategies to try to find differences without the last commit, that is at 1df29b5. My gut feeling is that Other than that, this is a VERY welcome change, thank you! |
|
I think to stop and raise an error if the working repo is dirty is a good idea. That's what I have regularly while using stgit, and it let the user decide what they want to do. And maybe it's possible to still add a flag like Regarding |
I tried on some (basic) changes, and it works just fine. Better than the That sounds pretty good to me :-) |
df7f512 to
fd49df7
Compare
|
i am also pro |
Add a |
repository/repository.go
Outdated
There was a problem hiding this comment.
the answer is "maybe, if it helps with UX when combo'd with some additional commit metadata" lol, but i don't want to couple that with a bunch of other changes.
handling conflicts is nicer with merge --squash for right now, correct? like users have the ability to abort?
if yes, there's 2 desirable UXs that are mutually exclusive to the 2 impls:
- conflict-abortion
- repeated-squash-merges
it might be possible to get both via some clever behind the scenes rebasing, but that sounds like a huge faff. we may have to pick one of these 2 desirable behaviors.
@aluzzardi lol that's a bigger question... i'd mirror for now to keep open the possibility of passing unknown args through to git. |
| } | ||
|
|
||
| return RunInteractiveGitCommand(ctx, r.userRepoPath, w, "merge", "-m", "Merge environment "+envInfo.ID, "--", "container-use/"+envInfo.ID) | ||
| return RunInteractiveGitCommand(ctx, r.userRepoPath, w, "merge", "--autostash", "--squash", "--", "container-use/"+envInfo.ID) |
There was a problem hiding this comment.
the beauty of "cu apply" imo is that it can make a commit without "overriding" the meaning of git merge flags, so if we're doing --squash, let's make the commit if there's no conflict?
later, we can add logic to edit .git/SQUASH_MSG with the llm-updated summary.
There was a problem hiding this comment.
I think this flag was applied to cu merge -- it replaces the old broken logic of the stash + defer stash pop. Doesn't apply to cu apply, unrelated improvement
There was a problem hiding this comment.
i think we're miscommunicating here, one of both of us is misunderstanding lol --- what i'm asking isn't related to autostash, i'm assuming that with this PR, cu apply will leave the user with a bunch of staged files but no commit message, right? so what i'm trying to suggest is that cu apply should just go ahead and make a commit if this merge --squash succeeds.
There was a problem hiding this comment.
oh nm, i see your response below, indeed miscommunication (i'm the one misunderstanding XD)
I'm unsure about that because:
IMHO there should either be a |
555adce to
3e6e50b
Compare
Signed-off-by: Andrea Luzzardi <al@dagger.io>
Signed-off-by: Andrea Luzzardi <al@dagger.io>
Signed-off-by: Andrea Luzzardi <al@dagger.io>
Signed-off-by: Andrea Luzzardi <al@dagger.io>
Signed-off-by: Andrea Luzzardi <al@dagger.io>
Signed-off-by: Andrea Luzzardi <al@dagger.io>
3e6e50b to
05f973d
Compare
Signed-off-by: Andrea Luzzardi <al@dagger.io>
|
@aluzzardi lgtm based on your commment:
ugh, good point, didn't think of that edge case, just thought our shit was handled by --autostash but i imagine that doesn't stash staged files?
works for me. |
|
(@aluzzardi asked for my 2c in Discord, so this may be a bit of a non sequitur:) IMO if we have commands that match But more importantly I never want the raw commits from the environment branch to enter my pristine Following those two principles, I get:
I think that would cover all the scenarios I care about:
I dunno, feels half baked but maybe there are some nuggets of wisdom in there. |
No description provided.