Subject: Re: bug#54034: 29.0.50; Diff prettify broken for empty files

From: Matthias Meulien <[email-masked]>
Date: Tue, 22 Feb 2022 00:00:15 +0100

Stefan Monnier <[email-masked]> 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:

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