GNU bug report logs - #54034
29.0.50; Diff prettify broken for empty files

Previous Next

Package: emacs;

Reported by: Matthias Meulien <orontee <at> gmail.com>

Date: Thu, 17 Feb 2022 07:49:02 UTC

Severity: normal

Found in version 29.0.50

Full log


Message #20 received at 54034 <at> debbugs.gnu.org (full text, mbox):

From: Matthias Meulien <orontee <at> gmail.com>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 54034 <at> debbugs.gnu.org
Subject: Re: bug#54034: 29.0.50; Diff prettify broken for empty files
Date: Tue, 22 Feb 2022 00:00:15 +0100
[Message part 1 (text/plain, inline)]
Stefan Monnier <monnier <at> iro.umontreal.ca> writes:

> I pushed a patch to `master` which should handle those cases correctly.
> Please confirm that it also fixes the problem on your side,

Yes, thanks a lot Stefan. The fix looks good to me!

I found one unhandled case. When a diff changes a file mode, like in the
following:

    diff --git a/argos/session.py b/argos/session.py
    old mode 100755
    new mode 100644

Note that it becomes "problematic" when the diff cumulates file
modification and mode change for the same file.  I understand that the
"old mode" and "new mode" lines are the culprit since they're not
handled by the regexp used by diff--font-lock-prettify:

[Capture d’écran du 2022-02-21 23-42-45.png (image/png, inline)]
[Message part 3 (text/plain, inline)]
I also saw you added a comment saying "FIXME: Add support for Git's
"rename from/to"?".  I am curious: What do you have in mind?  What kind
of output of "git diff" do you want to support? Do you want to link the
related "New file" and "Deleted file" hunks?
-- 
Matthias

This bug report was last modified 2 years and 350 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.