emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[nongnu] elpa/git-commit 304b1730f5 2/4: diff: Remove partially broken a


From: ELPA Syncer
Subject: [nongnu] elpa/git-commit 304b1730f5 2/4: diff: Remove partially broken and unnecessary kludge
Date: Fri, 14 Oct 2022 13:58:42 -0400 (EDT)

branch: elpa/git-commit
commit 304b1730f569d52eb59d2c7a57c628b348660561
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>

    diff: Remove partially broken and unnecessary kludge
    
    A comment claimed that "git diff" ignores "--no-prefix" for new and
    renames files, but that is no longer true.  It possibly was never
    true.  I tried confirm that it isn't true for the oldest git release
    that we still support, v2.2.0, but I am no longer able to build that.
    
    I have decided to remove the kludge for "git diff" because the kludge
    would not have worked for new files anyway.  There were no bug reports
    concerning that, so it is very likely that this kludge really isn't
    needed.
    
    The kludge is still needed for "git log -L", but has to be improved.
---
 lisp/magit-diff.el | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/lisp/magit-diff.el b/lisp/magit-diff.el
index 698bc2182a..2e8b104a57 100644
--- a/lisp/magit-diff.el
+++ b/lisp/magit-diff.el
@@ -2314,14 +2314,10 @@ section or a child thereof."
       (when orig
         (setq orig (magit-decode-git-path orig)))
       (setq file (magit-decode-git-path file))
-      ;; KLUDGE `git-diff' ignores `--no-prefix' for new files and renames at
-      ;; least.  And `git-log' ignores `--no-prefix' when `-L' is used.
-      (when (or (and file orig
-                     (string-prefix-p "a/" orig)
-                     (string-prefix-p "b/" file))
-                (and (derived-mode-p 'magit-log-mode)
-                     (--first (string-prefix-p "-L" it)
-                              magit-buffer-log-args)))
+      ;; KLUDGE `git-log' ignores `--no-prefix' when `-L' is used.
+      (when (and (derived-mode-p 'magit-log-mode)
+                 (--first (string-prefix-p "-L" it)
+                          magit-buffer-log-args))
         (setq file (substring file 2))
         (when orig
           (setq orig (substring orig 2))))



reply via email to

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