[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Merge-base alias for git vc-diff

From: Juri Linkov
Subject: Re: Merge-base alias for git vc-diff
Date: Thu, 27 Dec 2018 22:02:35 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu)

>> 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 completions 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 ‘vc-git-diff’, ‘vc-git-revision-table’, etc.

> Maybe you'll want to both extend the 'diff' backend command and add a new
> 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 ‘vc-merge-base-diff’ is easy, but first
I'd like to try to extend the existing command because it is bound
to a short key sequence: ‘C-u C-x v D’ then type ‘TAB’ for completion
and select e.g. ‘MERGE-BASE’.

> (*) 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.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]