From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#20292: 24.5; Saving Git-controlled file with merge conflicts after "stash pop" stages the file Date: Sat, 18 Apr 2015 22:16:51 +0300 Message-ID: <5532ADA3.5000006@yandex.ru> References: <83fv88ta5r.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1429384702 5635 80.91.229.3 (18 Apr 2015 19:18:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 18 Apr 2015 19:18:22 +0000 (UTC) Cc: "Eric S. Raymond" To: Eli Zaretskii , 20292@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Apr 18 21:18:12 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 1YjYFo-0001Ux-4G for geb-bug-gnu-emacs@m.gmane.org; Sat, 18 Apr 2015 21:18:12 +0200 Original-Received: from localhost ([::1]:46617 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YjYFn-000559-9O for geb-bug-gnu-emacs@m.gmane.org; Sat, 18 Apr 2015 15:18:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50018) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YjYFj-00054Y-DW for bug-gnu-emacs@gnu.org; Sat, 18 Apr 2015 15:18:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YjYFe-0000Ji-Dr for bug-gnu-emacs@gnu.org; Sat, 18 Apr 2015 15:18:07 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:42189) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YjYFe-0000Jd-AZ for bug-gnu-emacs@gnu.org; Sat, 18 Apr 2015 15:18:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1YjYFe-0006wr-1O for bug-gnu-emacs@gnu.org; Sat, 18 Apr 2015 15:18:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 18 Apr 2015 19:18: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.142938462326596 (code B ref 20292); Sat, 18 Apr 2015 19:18:01 +0000 Original-Received: (at 20292) by debbugs.gnu.org; 18 Apr 2015 19:17:03 +0000 Original-Received: from localhost ([127.0.0.1]:60186 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YjYEh-0006ut-1f for submit@debbugs.gnu.org; Sat, 18 Apr 2015 15:17:03 -0400 Original-Received: from mail-wg0-f43.google.com ([74.125.82.43]:35957) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YjYEe-0006uJ-MR for 20292@debbugs.gnu.org; Sat, 18 Apr 2015 15:17:01 -0400 Original-Received: by wgsk9 with SMTP id k9so142108116wgs.3 for <20292@debbugs.gnu.org>; Sat, 18 Apr 2015 12:16:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=THxeIJKdsqDiVU3QNCXZxHRsJ+Qjv+gIV8gSdTt9geo=; b=uHlr8kT7tLt7Y+NvCyhnoJPZ4Y+3+yB1gPDXCgR8GKLQ7ncBVLPyHUwZs3Oq6V3/VQ SUcyELBMO7FEFyEMs8KwIzkW5AbF4DefRV4mpDejzRlYOY7PZxnaAFsEMCv3h+jGX8WF 6av9rGnrep4dMnTJe7mNKIdB7X9Zq46lgMVIw06AHd2nDLlWkEXZxA8eIsaruOMiDQU2 2BdrmEoHivyD/kR9K3UudFKxXLfqx9t3xrwer9XsZWyJNWr9JvxLPNgxxx1YjC859ZIV +0iJR4rNLJf8tEVRWOQWguzt52aX+8JgQKB4BgueF+HkkFpukJaVcTGXqjzcixXOtw4K RiMQ== X-Received: by 10.180.96.65 with SMTP id dq1mr11828869wib.46.1429384614987; Sat, 18 Apr 2015 12:16:54 -0700 (PDT) Original-Received: from [192.168.1.2] ([82.102.93.54]) by mx.google.com with ESMTPSA id ax10sm20064806wjc.26.2015.04.18.12.16.53 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 18 Apr 2015 12:16:54 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:36.0) Gecko/20100101 Thunderbird/36.0 In-Reply-To: <83fv88ta5r.fsf@gnu.org> 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:101687 Archived-At: On 04/10/2015 03:55 PM, Eli Zaretskii wrote: > If "git stash pop" encounters merge conflicts, then resolving these > conflicts in Emacs and saving the buffer will run "git add" for the > file whose conflicts were resolved. But that is not TRT in this case; > the user likely does not expect to have her uncommitted changes staged > for the next commit. Apparently, to both mark the conflict as resolved and not stage the file, the best we can do is 'git add ...; git reset ...', which would not DTRT if the file had some changes, and they were staged before you did 'git stash pop' (if the file had unstaged changes, 'git stash pop' would abort). Should we be concerned about that? > Therefore, I think vc-git-resolve-when-done should not run "git add" > if the merge conflict was due to "git stash pop". Maybe we can detect this case (as well as any similar ones) by the absence of .git/MERGE_HEAD. But what's the justification for vc-git-resolve-when-done? I think vc-git-checkin will work well enough without that. Further, if there's a conflict, 'git stash pop' doesn't actually remove the stash from the list. Would we expect vc-git-resolve-when-done to call 'git stash drop' at the end of conflict resolution?