-
Notifications
You must be signed in to change notification settings - Fork 61
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
Add --force flag to stg push? #193
Comments
As a workaround:
|
I'm having a hard time reproducing this issue. I've tried some simple test cases that perform the So I could use some help fleshing out a reproducing test case. Another thing to note is that |
@jpgrayson I think the @larsks refers to having some files in the modified but Unstaged state after refreshing a subset. I presume, they want to be able to ask push command to drop all changes that are not staged, or perhaps all changes that are not committed. That sounds a bit dangerous though. @larsks if you are looking for a quicker—get rid of my extra local changes—workaround I would suggest:
I also wonder if perhaps |
Here's a complete reproducer:
Despite what I said earlier, there's not really a good workaround here -- in this failure, Having a Note that in this situation,
And using the
|
@jpgrayson just wanted to follow up and see if that last comment helped clarify things? |
Yes, this helps. Thank you for providing this use case, @larsks. I agree that the error message provided by StGit is insufficient. There is a straightforward change to make StGit show the same message as For this particular use case, there is another workflow that might help: date > file1
date > file2
stg add file{1,2}
stg new -rm add-files
# Instead of `stg pop --spill`, use `stg spill`
stg spill --reset
stg add file1
stg refresh -i
stg add file2
stg new -rm add-file2 The idea is to use Regarding adding a |
The problem I see is that if there are a large number of conflicting files, the cleanup may still be messy even with a better error message. Absent something like In my experience it's relatively easy to get into this state when using |
When pushing a patch that adds a file that conflicts with an untracked file in the working tree, the error stated "Index/worktree dirty" without further elaboration. The error message from `git merge-recursive` is now displayed. This message indicates the particular untracked files that prevent the push's merge from completing. Also add test cases to ensure this behavior. Addresses #193
This use case and the problem of push-time conflicts with untracked files is not something I've run into before, or at least not enough to want StGit to do more. So I'm trying to decide how much weight to give this issue. I appreciate the detail you've provided about your experience. If we were to add a
Neither So I'm sympathetic to this use case, wary of an extra What would be ideal, IMO, would be if the |
|
Using the rust branch, I run into this a lot:
stg pop --spill
to incorporate some changes into a previous patchgit reset
to unstage everythingstg refresh
to update the patch after adding some updated filesstg push
to return to the next patch in the seriesThis invariably fails with:
And that's because the
stg pop --spill
+git reset
means that any files in the subsequent patch that aren't included in the current patch are now in the way. Usinggit checkout
, we would see something like this:The solution here is generally
git checkout --force
, which will replace the indicated files.It would be great if
stg push
had the same option, because sometimes cleaning this up is a pain (it would also be nice ifstg push
were to provide a list of files that are causing the error).The text was updated successfully, but these errors were encountered: