From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Re: Merge-base alias for git vc-diff Date: Thu, 27 Dec 2018 22:02:35 +0200 Organization: LINKOV.NET Message-ID: <87lg4aak10.fsf@mail.linkov.net> References: <87bm58ornb.fsf@mail.linkov.net> <92f058a4-ef98-725b-9603-5a671113dfaa@yandex.ru> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1545943060 510 195.159.176.226 (27 Dec 2018 20:37:40 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 27 Dec 2018 20:37:40 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) Cc: emacs-devel@gnu.org To: Dmitry Gutov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Dec 27 21:37:36 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gccPM-0008N3-JH for ged-emacs-devel@m.gmane.org; Thu, 27 Dec 2018 21:37:34 +0100 Original-Received: from localhost ([127.0.0.1]:55071 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gccRS-0003Rl-O7 for ged-emacs-devel@m.gmane.org; Thu, 27 Dec 2018 15:39:42 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:39103) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gccQZ-0003Rf-HZ for emacs-devel@gnu.org; Thu, 27 Dec 2018 15:38:48 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gccQU-0005Be-Jl for emacs-devel@gnu.org; Thu, 27 Dec 2018 15:38:47 -0500 Original-Received: from purple.birch.relay.mailchannels.net ([23.83.209.150]:9286) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gccQU-0005Ax-80 for emacs-devel@gnu.org; Thu, 27 Dec 2018 15:38:42 -0500 X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 8CEC15C418E; Thu, 27 Dec 2018 20:38:40 +0000 (UTC) Original-Received: from pdx1-sub0-mail-a68.g.dreamhost.com (unknown [100.96.36.160]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 469155C41A1; Thu, 27 Dec 2018 20:38:40 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from pdx1-sub0-mail-a68.g.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.16.2); Thu, 27 Dec 2018 20:38:40 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Squirrel-Suffer: 3cd0348309d3a855_1545943120399_992654504 X-MC-Loop-Signature: 1545943120399:2635539318 X-MC-Ingress-Time: 1545943120398 Original-Received: from pdx1-sub0-mail-a68.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a68.g.dreamhost.com (Postfix) with ESMTP id E6B717FD03; Thu, 27 Dec 2018 12:38:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type:content-transfer-encoding; s=linkov.net; bh=xim12G mnk22lKf5JI/rsGNZBbL8=; b=EVkxMdd1ZMMGACKmlfHHiOMwjT4P0AopIuqgz8 DA4u6EJi3Qg6ShImenvOwqFkdATVYvslb4MSBfzDHi6paZ9gwnrwapaKbtxPSbYr yERm6BsaMbkQPcri8zBZCak800NO0waOYNCvM032az/5CKkMfqYzdaJ4h3qHkIyr DJM+0= Original-Received: from mail.jurta.org (m91-129-108-193.cust.tele2.ee [91.129.108.193]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by pdx1-sub0-mail-a68.g.dreamhost.com (Postfix) with ESMTPSA id 626167FCFF; Thu, 27 Dec 2018 12:38:37 -0800 (PST) X-DH-BACKEND: pdx1-sub0-mail-a68 In-Reply-To: <92f058a4-ef98-725b-9603-5a671113dfaa@yandex.ru> (Dmitry Gutov's message of "Thu, 27 Dec 2018 03:07:01 +0200") X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: -100 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedtledrtdefgdejlecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucggtfgfnhhsuhgsshgtrhhisggvpdfftffgtefojffquffvnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvffuohhfffgjkfgfgggtgfesthekredttderjeenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucfkphepledurdduvdelrddutdekrdduleefnecurfgrrhgrmhepmhhouggvpehsmhhtphdphhgvlhhopehmrghilhdrjhhurhhtrgdrohhrghdpihhnvghtpeeluddruddvledruddtkedrudelfedprhgvthhurhhnqdhprghthheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqedpmhgrihhlfhhrohhmpehjuhhriheslhhinhhkohhvrdhnvghtpdhnrhgtphhtthhopegughhuthhovheshigrnhguvgigrdhruhenucevlhhushhtvghrufhiiigvpedt X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 23.83.209.150 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:232005 Archived-At: >> Since "git diff A...B" is equivalent to "git diff $(git-merge-base A B= ) B", >> doing the same means adding a new alias "MERGE-BASE" to the completion= s of >> `C-u C-x v D' (vc-root-diff) to complement the existing alias "HEAD". > > Do we have aliases like that in VC? HEAD is simply a ref that Git > recognizes, but MERGE-BASE is not (*). Not sure how to handle it best. MERGE-BASE could be a VC alias, not Git alias. So it could be handled specially by =E2=80=98vc-git-diff=E2=80=99, =E2=80=98vc-git-revision-tabl= e=E2=80=99, etc. > Maybe you'll want to both extend the 'diff' backend command and add a n= ew > boolean argument to the end. This is the easiest part of the task. > And also add a new command that would use it, similar to > vc-root-version-diff (or a new meaning to some value of the prefix > argument). Adding a new command like =E2=80=98vc-merge-base-diff=E2=80=99 is easy, b= ut first I'd like to try to extend the existing command because it is bound to a short key sequence: =E2=80=98C-u C-x v D=E2=80=99 then type =E2=80=98= TAB=E2=80=99 for completion and select e.g. =E2=80=98MERGE-BASE=E2=80=99. > (*) Also: merge-base with what? master is not always the base. This is another problem, then we need to add the prefix MERGE-BASE to all branches listed in the completions: MERGE-BASE:master, MERGE-BASE:branch-a, MERGE-BASE:branch-b, ... Too bad.