GNU bug report logs -
#20292
24.5; Saving Git-controlled file with merge conflicts after "stash pop" stages the file
Previous Next
Reported by: Eli Zaretskii <eliz <at> gnu.org>
Date: Fri, 10 Apr 2015 12:57:02 UTC
Severity: normal
Merged with 20151
Found in versions 24.5, 25.0.50
Done: Dmitry Gutov <dgutov <at> yandex.ru>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
> Cc: monnier <at> iro.umontreal.ca, esr <at> snark.thyrsus.com, 20292 <at> debbugs.gnu.org
> From: Dmitry Gutov <dgutov <at> yandex.ru>
> Date: Wed, 13 May 2015 02:13:10 +0300
>
> When a stash contains changes for several files, and "stash pop" encounters conflicts only in some of them, the rest of the files are stages automatically.
>
> At least, that happens with Git 2.1.0 on my machine
I see this with 1.9.5 as well.
> What shall we do?
Report a bug in Git, I think. It doesn't make sense to have the
outcome of "stash pop" wrt the index/staging depend on whether there
were conflicts or not, which is what happening here: if I "stash pop"
after pulling when none of my local stashed changes are in conflict
with the pulled/merged content, I get back modified and unstaged
files. Why would the existence of conflicts during "stash pop"
produce any different effect for files _without_ conflicts, except by
some obscure bug?
> Unstage the automatically-staged files?
If we can do that, yes. But how do we know which files to unstage?
> Revert the changes from this bug?
No! That'd be a step back. The current treatment of stashed changes
is better than it was before the change. Also note that conflicts
like this are quite rare, so the way vc-git worked previously was
wrong in 99% of cases, why the one we have now is wrong in perhaps
0.1%.
> It seems Git really wants the changes staged after the conflict resolution.
It seems to me we've uncovered a bug in Git (gasp!). Git has no
reasons to want the changes staged, certainly not depending on whether
there were conflicts.
This bug report was last modified 8 years and 191 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.