From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#57807: 29.0.50; Make vc-print-branch-log able to log multiple branches Date: Wed, 14 Sep 2022 22:17:13 +0300 Organization: LINKOV.NET Message-ID: <86v8ppn5b2.fsf@mail.linkov.net> References: <87czbxub4b.fsf@melete.silentflame.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13861"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) Cc: 57807@debbugs.gnu.org To: Sean Whitton Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Sep 14 21:34:28 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oYY9U-0003TP-3b for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 14 Sep 2022 21:34:28 +0200 Original-Received: from localhost ([::1]:52460 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oYY9T-0002db-7t for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 14 Sep 2022 15:34:27 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49048) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oYY6B-0000jm-GR for bug-gnu-emacs@gnu.org; Wed, 14 Sep 2022 15:31:07 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:39365) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oYY6A-0006t3-RX for bug-gnu-emacs@gnu.org; Wed, 14 Sep 2022 15:31:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oYY6A-00044K-Lj for bug-gnu-emacs@gnu.org; Wed, 14 Sep 2022 15:31:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 14 Sep 2022 19:31:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57807 X-GNU-PR-Package: emacs Original-Received: via spool by 57807-submit@debbugs.gnu.org id=B57807.166318384315606 (code B ref 57807); Wed, 14 Sep 2022 19:31:02 +0000 Original-Received: (at 57807) by debbugs.gnu.org; 14 Sep 2022 19:30:43 +0000 Original-Received: from localhost ([127.0.0.1]:56296 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oYY5r-00043e-G5 for submit@debbugs.gnu.org; Wed, 14 Sep 2022 15:30:43 -0400 Original-Received: from relay12.mail.gandi.net ([217.70.178.232]:43223) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oYY5p-00043D-5v for 57807@debbugs.gnu.org; Wed, 14 Sep 2022 15:30:41 -0400 Original-Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id B5D4A200003; Wed, 14 Sep 2022 19:30:31 +0000 (UTC) In-Reply-To: <87czbxub4b.fsf@melete.silentflame.com> (Sean Whitton's message of "Wed, 14 Sep 2022 10:19:48 -0700") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:242526 Archived-At: > vc-git-log-edit-mode is already able to properly understand git-log(1) I suppose vc-git-log-view-mode, not vc-git-log-edit-mode? > output which logs multiple branches. Here's a hack to demonstrate that: > > (let ((default-directory "~/src/emacs/") > (vc-git-log-switches > (cons "origin/scratch/posix-spawn" vc-git-log-switches))) > (call-process-shell-command "git branch -f tmp 4b2ca6bfc0") > (vc-print-branch-log "tmp")) > > (4b2ca6bfc0 is an old tip of master close to scratch/posix-spawn.) Is this equivalent to `M-& git log origin/scratch/posix-spawn 4b2ca6bfc0`, then enabling vc-git-log-view-mode in the output buffer? > An example of a case in which it is useful to produce logs like this is > when you're trying to figure out how several feature branches relate to > each other and to the trunk. I never encountered anything like this. I wonder if this is a common need? > I don't think the idea of producing a log showing more than one branch > at once is fundamentally git-specific. So I would like to extend > vc-print-branch-log to allow logging more than one branch, or > alternatively, add a vc-print-branch-logs command. Maybe vc-print-branch-logs, to keep the original vc-print-branch-log uncomplicated. > I believe that there are two design issues, on which I'm requesting > review/input: > > (1) Extending the VC history functions API to permit expressing a > request for the backend to print a log of multiple branches. We could > allow the START-REVISION argument to `print-log' to take a list of > branches, or add an additional optional argument > ADDITIONAL-START-REVISIONS. The latter seems more robust to me. > > (2) How could vc-print-branch-log prompt the user for multiple branch > names? Magit has the user separate branch names with commas, offering > completion for each branch name. But I suppose commas never appearing > in branch names is git-specific. So the command could prompt the user > repeatedly for branch names, until the user hits RET to input a > zero-length branch name, indicating they've input them all. Maybe by using completing-read-multiple with branch names separated by crm-separator, not necessarily comma?