unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@linkov.net>
To: 39704@debbugs.gnu.org
Subject: bug#39704: 28.0.50; vc-print-branch-log data loss
Date: Fri, 21 Feb 2020 01:32:35 +0200	[thread overview]
Message-ID: <871rqoj0mk.fsf@mail.linkov.net> (raw)

Tags: patch

Accidentally I noticed that vc-print-branch-log prints a narrower log
than it should.  I don't remember any damage from this data loss
but this is not the right thing to do - by default it should show logs
from the repository root, not logs limited to a subdirectory when
this command happens to be called from a subdirectory.

Am I correct to expect that vc-print-branch-log should print
log from branch's root like vc-print-root-log does, and
not from a subdirectory like vc-print-log does?

diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el
index f7d651fac6..13d60b6fcf 100644
--- a/lisp/vc/vc.el
+++ b/lisp/vc/vc.el
@@ -2559,9 +2590,11 @@ vc-print-branch-log
     (vc-read-revision "Branch to log: ")))
   (when (equal branch "")
     (error "No branch specified"))
-  (vc-print-log-internal (vc-responsible-backend default-directory)
-                         (list default-directory) branch t
-                         (when (> vc-log-show-limit 0) vc-log-show-limit)))
+  (let* ((backend (vc-responsible-backend default-directory))
+         (rootdir (vc-call-backend backend 'root default-directory)))
+    (vc-print-log-internal backend
+                           (list rootdir) branch t
+                           (when (> vc-log-show-limit 0) vc-log-show-limit))))
 
 ;;;###autoload
 (defun vc-log-incoming (&optional remote-location)





             reply	other threads:[~2020-02-20 23:32 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-20 23:32 Juri Linkov [this message]
2020-02-21  0:25 ` bug#39704: 28.0.50; vc-print-branch-log data loss Dmitry Gutov
2020-02-21 18:29   ` Tom Tromey
2020-02-23  0:07   ` Juri Linkov
2020-02-23  8:57     ` Dmitry Gutov
2020-03-09 23:34       ` Juri Linkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=871rqoj0mk.fsf@mail.linkov.net \
    --to=juri@linkov.net \
    --cc=39704@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).