unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#39704: 28.0.50; vc-print-branch-log data loss
@ 2020-02-20 23:32 Juri Linkov
  2020-02-21  0:25 ` Dmitry Gutov
  0 siblings, 1 reply; 6+ messages in thread
From: Juri Linkov @ 2020-02-20 23:32 UTC (permalink / raw)
  To: 39704

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)





^ permalink raw reply related	[flat|nested] 6+ messages in thread

* bug#39704: 28.0.50; vc-print-branch-log data loss
  2020-02-20 23:32 bug#39704: 28.0.50; vc-print-branch-log data loss Juri Linkov
@ 2020-02-21  0:25 ` Dmitry Gutov
  2020-02-21 18:29   ` Tom Tromey
  2020-02-23  0:07   ` Juri Linkov
  0 siblings, 2 replies; 6+ messages in thread
From: Dmitry Gutov @ 2020-02-21  0:25 UTC (permalink / raw)
  To: Juri Linkov, 39704; +Cc: Tom Tromey

On 21.02.2020 1:32, Juri Linkov wrote:
> 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?

I think so (then, the patch LGTM).

Tom might want to weigh in on this, though.





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#39704: 28.0.50; vc-print-branch-log data loss
  2020-02-21  0:25 ` Dmitry Gutov
@ 2020-02-21 18:29   ` Tom Tromey
  2020-02-23  0:07   ` Juri Linkov
  1 sibling, 0 replies; 6+ messages in thread
From: Tom Tromey @ 2020-02-21 18:29 UTC (permalink / raw)
  To: Dmitry Gutov; +Cc: Tom Tromey, 39704, Juri Linkov

Dmitry> Tom might want to weigh in on this, though.

I don't really have an opinion.
The proposed behavior seems fine to me.

Tom





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#39704: 28.0.50; vc-print-branch-log data loss
  2020-02-21  0:25 ` Dmitry Gutov
  2020-02-21 18:29   ` Tom Tromey
@ 2020-02-23  0:07   ` Juri Linkov
  2020-02-23  8:57     ` Dmitry Gutov
  1 sibling, 1 reply; 6+ messages in thread
From: Juri Linkov @ 2020-02-23  0:07 UTC (permalink / raw)
  To: Dmitry Gutov; +Cc: Tom Tromey, 39704

>> 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?
>
> I think so (then, the patch LGTM).

Or maybe retain the old behavior on using a prefix arg?

I.e. C-u M-x vc-print-branch-log could ask for a directory,
with the default on default-directory.





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#39704: 28.0.50; vc-print-branch-log data loss
  2020-02-23  0:07   ` Juri Linkov
@ 2020-02-23  8:57     ` Dmitry Gutov
  2020-03-09 23:34       ` Juri Linkov
  0 siblings, 1 reply; 6+ messages in thread
From: Dmitry Gutov @ 2020-02-23  8:57 UTC (permalink / raw)
  To: Juri Linkov; +Cc: Tom Tromey, 39704

On 23.02.2020 2:07, Juri Linkov wrote:
> Or maybe retain the old behavior on using a prefix arg?
> 
> I.e. C-u M-x vc-print-branch-log could ask for a directory,
> with the default on default-directory.

Personally, I don't remember needing something like that (or, in a 
once-a-decade occurrence, I can use the console). But if you find it 
useful, sure.





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#39704: 28.0.50; vc-print-branch-log data loss
  2020-02-23  8:57     ` Dmitry Gutov
@ 2020-03-09 23:34       ` Juri Linkov
  0 siblings, 0 replies; 6+ messages in thread
From: Juri Linkov @ 2020-03-09 23:34 UTC (permalink / raw)
  To: Dmitry Gutov; +Cc: Tom Tromey, 39704

tags 39704 fixed
close 39704 28.0.50
quit

>> Or maybe retain the old behavior on using a prefix arg?
>> I.e. C-u M-x vc-print-branch-log could ask for a directory,
>> with the default on default-directory.
>
> Personally, I don't remember needing something like that (or, in
> a once-a-decade occurrence, I can use the console). But if you find it 
> useful, sure.

Ok, pushed to master, and closed.





^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-03-09 23:34 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-20 23:32 bug#39704: 28.0.50; vc-print-branch-log data loss Juri Linkov
2020-02-21  0:25 ` 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

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