From: Dmitry Gutov <dgutov@yandex.ru>
To: "Nicolás Ojeda Bär" <n.oje.bar@gmail.com>, 55871@debbugs.gnu.org
Subject: bug#55871: Acknowledgement (27.1; vc-git.el log view 'a', 'f', 'd' do not work when following renames)
Date: Thu, 18 Aug 2022 05:10:16 +0300 [thread overview]
Message-ID: <78f97339-2aca-0dbd-4cb4-3532af78a895@yandex.ru> (raw)
In-Reply-To: <CAPunWhAX4_tj7h4OXR_qnNUT9XJN3718GjaBw+yEujsp5gAjMQ@mail.gmail.com>
Hi Nicholas,
On 10.06.2022 20:31, Nicolás Ojeda Bär wrote:
> Dear all,
>
> Attached is a patch that solves some of the problems in this issue (not all).
>
> Its main feature is that it should not modify anything if you are not
> using `vc-git-print-log-follow`.
>
> If you are, the patch makes it possible to use `a`, `f` and `d` from
> inside the `*vc-change-log*` buffer.
>
> The patch itself is very much based on the one proposed in
> https://debbugs.gnu.org/cgi/bugreport.cgi?bug=8756#53, with some
> changes to make sure that nothing changes if `vc-git-print-log-follow`
> is not being used. Additionally, a horrible HACK (see commit message)
> is used to allow `vc-git.el` to discriminate between `d` and `D` in
> the `*vc-change-log*` buffer, as these two functions require different
> Git commands to be executed when following renames (this is also
> discussed in the just linked bug report).
Thanks for your help with updating this patch. I've tried it out, and it
seems functional, which is great.
First of all, how do you feel about signing copyright assignment for
Emacs? AFAICT you haven't done so yet, and this patch borders on our
allowed limit without assignment (if I take only the lines that changed
substantially from Dmitry Dzhus's version). It would probably be easier
to get the assignment going anyway, so you continue to be able to
contribute.
There are also a few of improvements I'm eyeing here (not requirements
for acceptance -- I can do them myself, if you like):
1) vc-git--shalist-raw doesn't seem to serve much of a purpose. It is
there only to delay the conversion from the raw string into a list?
2) It would be better to produce shalist entirely lazily. I'm not sure
what's stopping us from doing that, given that vc-git--shalist knows how
to find the log buffer. Finding the values for all the arguments might
be a problem, so we can save the args (start-revision, limit) to a new var.
3) git-log-view-diff-whole-changeset might be unnecessary. vc-git-diff
could look up two file names, for both revisions (the current and the
one corresponding to the previous revision in the sha list), or
log-view-diff-common could pass explicitly the previous revision from
the already-printed list, rather than fetch it using (vc-call-backend
log-view-vc-backend 'previous-revision nil fr) -- I'm not sure why it's
doing it this way.
At first I just changed vc-git-diff to do this:
(let ((file1 (vc-git--rev-to-filename rev1))
(file2 (vc-git--rev-to-filename rev2)))
(when (or file1 file2)
;; Run diff from the repository root because our file names are
;; relative to it
(setq default-directory (vc-git-root default-directory))
(when file1 (push file1 files))
(when file2 (push file2 files))))
...and reverted the change to vc-git-previous-revision, and that almost
worked, except a revision that did rename only showed one side
(addition, not deletion).
WDYT?
I experimented with --follow myself in the past, and it is annoying in
that it skips commits, some of which are visible in the log when you
don't use --follow, details here:
https://stackoverflow.com/questions/46487476/git-log-follow-graph-skips-commits
So I figured the approach in (3) has something to do with it. But it
seems not to be the case.
next prev parent reply other threads:[~2022-08-18 2:10 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-09 9:54 bug#55871: 27.1; vc-git.el log view 'a', 'f', 'd' do not work when following renames Nicolás Ojeda Bär
[not found] ` <handler.55871.B.16547851264967.ack@debbugs.gnu.org>
2022-06-10 17:31 ` bug#55871: Acknowledgement (27.1; vc-git.el log view 'a', 'f', 'd' do not work when following renames) Nicolás Ojeda Bär
2022-08-18 2:10 ` Dmitry Gutov [this message]
2022-09-06 10:56 ` bug#55871: 27.1; vc-git.el log view 'a', 'f', 'd' do not work when following renames Lars Ingebrigtsen
2022-09-06 12:12 ` Nicolás Ojeda Bär
2022-09-06 12:13 ` Lars Ingebrigtsen
2022-12-03 2:02 ` Dmitry Gutov
2022-12-11 23:02 ` bug#55871: Acknowledgement (27.1; vc-git.el log view 'a', 'f', 'd' do not work when following renames) Dmitry Gutov
2022-12-12 16:44 ` Nicolás Ojeda Bär
2022-12-13 1:23 ` Dmitry Gutov
2023-12-14 0:52 ` Dmitry Gutov
2023-12-14 1:23 ` Dmitry Gutov
2023-12-15 2:01 ` Dmitry Gutov
2023-12-15 13:05 ` Eli Zaretskii
2023-12-15 14:39 ` Dmitry Gutov
2023-12-15 15:10 ` Eli Zaretskii
2023-12-15 20:45 ` Dmitry Gutov
2023-12-16 7:21 ` Eli Zaretskii
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=78f97339-2aca-0dbd-4cb4-3532af78a895@yandex.ru \
--to=dgutov@yandex.ru \
--cc=55871@debbugs.gnu.org \
--cc=n.oje.bar@gmail.com \
/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).