GNU bug report logs - #20292
24.5; Saving Git-controlled file with merge conflicts after "stash pop" stages the file

Previous Next

Package: emacs;

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


Message #86 received at 20292 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: rms <at> gnu.org
Cc: 20292 <at> debbugs.gnu.org, dgutov <at> yandex.ru
Subject: Re: bug#20292: 24.5;
 Saving Git-controlled file with merge conflicts after "stash
 pop"	stages the file
Date: Wed, 22 Apr 2015 12:16:28 +0300
> Date: Wed, 22 Apr 2015 04:47:44 -0400
> From: Richard Stallman <rms <at> gnu.org>
> CC: 20292 <at> debbugs.gnu.org, dgutov <at> yandex.ru, eliz <at> gnu.org
> 
>   > >> Then my vote is for using "git add FILE" with conflicts during a
>   > >> merge, and "git reset HEAD FILE" with conflicts during "stash pop".
>   > >> I think this is the simplest solution and is easy to implement with
>   > >> minimal changes.
>   > >
>   > > Fine by me,
> 
>   > I've pushed this, together with the choosing logic suggested previously. 
>   > Apparently it's the best we can do.
> 
> Could you describe the new behavior that you have implemented?

The new behavior changes what Emacs does when you save a file which
had conflicts that you resolved:

  . if the conflicts were due to a merge (which includes the automatic
    merge done by "git pull"), the behavior is as before: Emacs stages
    the file for commit by running "git add FILE"

  . if the conflicts were due to something else (which includes
    conflicts during "git stash pop"; not sure if there are other
    non-merge situations that create conflicts), then the new behavior
    is to run "git reset FILE", which leaves any changes in FILE
    uncommitted (and not staged), thus restoring the status of FILE
    before "git stash save"

The one thing to remember is that after saving the file whose
conflicts were resolved, you should type "C-x v v" to commit it in the
first case, and do nothing in the second.




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.