From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ivan Shmakov Newsgroups: gmane.emacs.bugs Subject: bug#18850: smerge-mode: use diff-check-labels Date: Mon, 27 Oct 2014 10:25:00 +0000 Message-ID: <87egttdd37.fsf_-_@violet.siamics.net> References: <87h9ysecea.fsf@violet.siamics.net> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1414405584 3080 80.91.229.3 (27 Oct 2014 10:26:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 27 Oct 2014 10:26:24 +0000 (UTC) To: 18850@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Oct 27 11:26:19 2014 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 1XihVC-0001Dq-1d for geb-bug-gnu-emacs@m.gmane.org; Mon, 27 Oct 2014 11:26:18 +0100 Original-Received: from localhost ([::1]:60597 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XihVB-0006bh-Bu for geb-bug-gnu-emacs@m.gmane.org; Mon, 27 Oct 2014 06:26:17 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40073) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XihV1-0006SW-46 for bug-gnu-emacs@gnu.org; Mon, 27 Oct 2014 06:26:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XihUw-0001T2-Ut for bug-gnu-emacs@gnu.org; Mon, 27 Oct 2014 06:26:07 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:44301) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XihUw-0001Sy-Jw for bug-gnu-emacs@gnu.org; Mon, 27 Oct 2014 06:26:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1XihUw-0000gu-4F for bug-gnu-emacs@gnu.org; Mon, 27 Oct 2014 06:26:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Ivan Shmakov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 27 Oct 2014 10:26:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 18850 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: submit@debbugs.gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.14144055162511 (code B ref -1); Mon, 27 Oct 2014 10:26:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 27 Oct 2014 10:25:16 +0000 Original-Received: from localhost ([127.0.0.1]:36399 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XihUB-0000eP-67 for submit@debbugs.gnu.org; Mon, 27 Oct 2014 06:25:16 -0400 Original-Received: from fely.am-1.org ([78.47.74.50]:37637) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XihU7-0000dg-TM for submit@debbugs.gnu.org; Mon, 27 Oct 2014 06:25:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=siamics.net; s=a2013295; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:Sender:References:Subject:To:From; bh=15AU5fwZR3xjC7g7t0sSDjQ/L/S/l16R40GoDUSWWgg=; b=OGYdd8301ui3xdy36IIBsgrd5XOVXb51PIy7tMp9VLOYyh7rVfuvbcrQOGuEZLm83HSeCE5oxQybBaVo8jQUTLgqGZoj7hk3oOVpLCGZz6XAsSiSrqrJejpLzwkviiVMkFgP6tCB1GOZVmHSD7OyQMui1jEhHBnQdLekPBosrJo=; Original-Received: from [2a02:2560:6d4:26ca::1:1d] (helo=violet.siamics.net) by fely.am-1.org with esmtps (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1XihU4-0002sr-OK for submit@debbugs.gnu.org; Mon, 27 Oct 2014 10:25:09 +0000 Original-Received: from localhost ([::1] helo=violet.siamics.net) by violet.siamics.net with esmtps (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1XihTx-0004Y3-2e for submit@debbugs.gnu.org; Mon, 27 Oct 2014 17:25:01 +0700 In-Reply-To: (Stefan Monnier's message of "Sat, 25 Oct 2014 22:41:16 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) 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:95151 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Package: emacs Severity: wishlist Tags: patch Control: block -1 by 18824 >>>>> Stefan Monnier writes: >> Please provide a separate diff-check-labels function to allow for >> the code calling diff.el facilities to supply its own --label=3D >> arguments to diff in place of diff.el-generated ones. > Sounds fine. While you're at it, you might like to use this for > smerge-mode (which uses "-L" rather than "--label"). I assume you mean something along the lines of the (untested) patch MIMEd. Curiously, I don=E2=80=99t usually use the merge facility proper, resolving merge conflicts afterwards. Instead, I save the diff against the current revision, switch to a newer one, apply the diff saved, and deal with the =E2=80=98.rej=E2=80=99 files, if any. Like: $ (umask 0222 && git diff > +patch-$(date +%s).diff)=20 $ git reset origin/master \ && patch -bVt -p1 -R < <(git diff)=20 =E2=80=A6 $ patch -bVt -p1 < +patch-1414405170.diff=20 =E2=80=A6 --=20 FSF associate member #7257 http://boycottsystemd.org/ =E2=80=A6 3013 B6A0= 230E 334A --=-=-= Content-Type: text/diff Content-Disposition: inline --- a/lisp/vc/smerge-mode.el +++ b/lisp/vc/smerge-mode.el @@ -44,6 +44,7 @@ ;;; Code: (eval-when-compile (require 'cl-lib)) +(require 'diff) ; for diff-check-labels (require 'diff-mode) ;For diff-auto-refine-mode. (require 'newcomment) @@ -1162,10 +1163,13 @@ smerge-diff (n1 n2) (erase-buffer) (let ((status (apply 'call-process diff-command nil t nil - (append smerge-diff-switches - (list "-L" (concat name1 "/" file) - "-L" (concat name2 "/" file) - file1 file2))))) + (nconc (and (diff-check-labels) + (list "--label" + (concat name1 "/" file) + "--label" + (concat name2 "/" file))) + smerge-diff-switches) + file1 file2))))) (if (eq status 0) (insert "No differences found.\n")))) (goto-char (point-min)) (diff-mode) --=-=-=--