Date | Commit message (Collapse) |
|
git would not generate non-ASCII digits to describe
hunk offsets, so don't waste more time than necessary
to make sense of non-ASCII digit chars for line offsets.
|
|
This is worth a 1-2% speedup in t/perf-msgview.t rendering 2620
messages currently in https://public-inbox.org/meta/
|
|
This was buggy and was causing non-diff text to have extra
leading spaces. The diff parsing code needs to be cleaned up,
so this will be fixed, later.
This reverts commit 1a67b91c1326efa372d1ec957e2494849d894f0b.
|
|
"git format-patch --interdiff" and similar can prefix diffs
with leading white space. Teach our diff parser to account
for it and set appropriate CSS classes for them.
|
|
It seems a common case for mangled patches is editors or MUAs
dropping trailing whitespace, and lines matching /^ $/ gets
the space dropped to only match /^$/.
|
|
We'll be building off of this for showing diffs in
the coderepo views.
|
|
Leaving out parentheses caused transitions to state="del" or
state="add" to be misidentified.
cf. https://public-inbox.org/meta/20190204105454.GG10587@szeder.dev/
Reported-by: SZEDER Gábor <szeder.dev@gmail.com>
|
|
This is best-effort, but works well-enough in practice for
projects which use shell-friendly filenames as well as the
long path names for some Linux kernel selftests.
|
|
For URLs we generate, we need to escape '&' in query parameters
for correctness.
|
|
diffstat <-> ^diff anchors work within the same attachment or
message while in HTML views which display multiple messages.
|
|
This can be helpful for reviewing larger patches which span
across several files on the permalink (/$MESSAGE_ID/) HTML
page.
More work will be needed to get this working for the /T/ and /t/
pages which show multiple emails, as the filename-based anchors
will conflict at the moment.
|
|
We must reset diff context when starting a new file;
and we must check for all-zeroes object_ids as the
post-image correctly.
|
|
We still need to use XHTML the Atom feed, and XHTML requires
attributes to be quoted, whereas HTML 5 does not.
|
|
This makes things less error-prone and allows us to only
highlight the "@@ -\S+ \+\S+ @@" part of the hunk header
line, without highlighting the function context.
This more closely matches the coloring behavior of git-diff(1)
|
|
Having diff highlighting alone is still useful, even
if blob-resolution/recreation is too expensive or
unfeasible.
|
|
As with our use of the trailing slash in $MESSAGE_ID/T/ and
'$MESSAGE_ID/t/' endpoints, this for 'wget -r --mirror'
compatibility as well as allowing sysadmins to quickly stand up
a static directory with "index.html" in it to reduce load.
|
|
Meaningful names in URLs are nice, and it can make
life easier for supporting syntax-highlighting
|
|
|