You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Merge Conflicts cannot proceed when untracked files exist #6411
Start with a branch that has 1 or more untracked files.
Merge another branch, like master, into branch, such that conflicts will arise (should NOT be changes that track above file(s)).
Merge Conflict dialog pops up.
Resolve merge conflicts in editor (do not remove untracked files).
Press "Commit Merge" button.
See error: "Could not generate a patch for file foo/bar, patch empty".
Now you are stuck.
Work arounds:
Move (temporarily) the untracked file(s).
Run git add foo/bar outside of the app.
Neither are particularly pleasing options.
Preferred Solutions:
Quietly skip untracked files for the merge, unless, of course, the merge adds them. Committing anything that didn't come from the merge makes no sense from the merge's perspective. (Preferred)
Do (1) and offer options to add or skip untracked. (Ok, but messier merge)
Allow me to exit the dialog and commit when I'm ready, which is sort of how it was before the Merge Conflict dialog was added. (Ok, less messy than (2), but not great)
Warn me that the merge cannot be started with untracked files present, which is hardly better than doing nothing. (Meh, I'll just end up do work around 1 anyway)
Thanks @SleepyJay, this is a super detailed and helpful report. I'm trying to discern the difference between this and #6349, as they seem like similar states but that one actually commits the files as part of the merge commit, whereas in your case it errored out. We're going to look into that so we can ensure it's a more elegant solution as we totally agree the behavior you're seeing is suboptimal.
In #6349 they are talking about changes to tracked files, while as this (#6411) is with untracked files and a dialog-deadlock sitch. My preferred solution (1) is for the same reasons #6349 was filed: the merge commit should only contain the merge, not also my local uncommitted changes. Note that this is why you (or Git) won't allow a merge when the merge will conflict with local uncommitted changes.
the merge commit should only contain the merge, not also my local uncommitted changes
We're in complete agreement. However we solve that one should likely account for both scenarios, so I appreciate you bringing it up. 😄 Going to go ahead and add this to the same milestone.
Activity
billygriffin commentedon Dec 13, 2018
Thanks @SleepyJay, this is a super detailed and helpful report. I'm trying to discern the difference between this and #6349, as they seem like similar states but that one actually commits the files as part of the merge commit, whereas in your case it errored out. We're going to look into that so we can ensure it's a more elegant solution as we totally agree the behavior you're seeing is suboptimal.
SleepyJay commentedon Dec 13, 2018
In #6349 they are talking about changes to tracked files, while as this (#6411) is with untracked files and a dialog-deadlock sitch. My preferred solution (1) is for the same reasons #6349 was filed: the merge commit should only contain the merge, not also my local uncommitted changes. Note that this is why you (or Git) won't allow a merge when the merge will conflict with local uncommitted changes.
billygriffin commentedon Dec 13, 2018
We're in complete agreement. However we solve that one should likely account for both scenarios, so I appreciate you bringing it up. 😄 Going to go ahead and add this to the same milestone.
SleepyJay commentedon Dec 14, 2018
@billygriffin Ya. I didn't mean to imply otherwise. :) 👍
billygriffin commentedon Jan 22, 2019
Thanks for letting us know about this @SleepyJay! Please let me know if things are working better for you now. 😄