From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: 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 Message-ID: <83a8y04j6b.fsf@gnu.org> References: <83fv88ta5r.fsf@gnu.org> <5532ADA3.5000006@yandex.ru> <834mod6xnm.fsf@gnu.org> <5532D397.8090602@yandex.ru> <83zj645gxu.fsf@gnu.org> <5533D7B8.7060508@yandex.ru> <83sibw59q1.fsf@gnu.org> <5533E816.2090208@yandex.ru> <83r3rg56zy.fsf@gnu.org> <5533EFE5.2050101@yandex.ru> <83oamk561p.fsf@gnu.org> <5533F446.4020400@yandex.ru> <83fv7u6epr.fsf@gnu.org> <838udm61ur.fsf@gnu.org> <5536FE56.406@yandex.ru> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1429694254 5381 80.91.229.3 (22 Apr 2015 09:17:34 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 22 Apr 2015 09:17:34 +0000 (UTC) Cc: 20292@debbugs.gnu.org, dgutov@yandex.ru To: rms@gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Apr 22 11:17:18 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YkqmU-0005fM-6B for geb-bug-gnu-emacs@m.gmane.org; Wed, 22 Apr 2015 11:17:18 +0200 Original-Received: from localhost ([::1]:34000 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YkqmT-0005m1-6V for geb-bug-gnu-emacs@m.gmane.org; Wed, 22 Apr 2015 05:17:17 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55996) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YkqmJ-0005c0-Ts for bug-gnu-emacs@gnu.org; Wed, 22 Apr 2015 05:17:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YkqmE-0004Ix-K8 for bug-gnu-emacs@gnu.org; Wed, 22 Apr 2015 05:17:07 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:45973) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YkqmE-0004Ir-Fj for bug-gnu-emacs@gnu.org; Wed, 22 Apr 2015 05:17:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1YkqmD-0000kN-Rg for bug-gnu-emacs@gnu.org; Wed, 22 Apr 2015 05:17:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 22 Apr 2015 09:17:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 20292 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 20292-submit@debbugs.gnu.org id=B20292.14296942022843 (code B ref 20292); Wed, 22 Apr 2015 09:17:01 +0000 Original-Received: (at 20292) by debbugs.gnu.org; 22 Apr 2015 09:16:42 +0000 Original-Received: from localhost ([127.0.0.1]:35749 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Ykqlt-0000jm-Io for submit@debbugs.gnu.org; Wed, 22 Apr 2015 05:16:41 -0400 Original-Received: from mtaout24.012.net.il ([80.179.55.180]:60929) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Ykqlq-0000jX-3p for 20292@debbugs.gnu.org; Wed, 22 Apr 2015 05:16:39 -0400 Original-Received: from conversion-daemon.mtaout24.012.net.il by mtaout24.012.net.il (HyperSendmail v2007.08) id <0NN700800AGGIP00@mtaout24.012.net.il> for 20292@debbugs.gnu.org; Wed, 22 Apr 2015 12:07:43 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout24.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NN7003GTAOV0Q60@mtaout24.012.net.il>; Wed, 22 Apr 2015 12:07:43 +0300 (IDT) In-reply-to: X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:101858 Archived-At: > Date: Wed, 22 Apr 2015 04:47:44 -0400 > From: Richard Stallman > CC: 20292@debbugs.gnu.org, dgutov@yandex.ru, eliz@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.