[PATCH 0/2] gitweb: shorten commitdiff index hashes with file modes
- From
Travor Liu <travor_lzh@outlook.com>
- Date
- Jul 15, 2026, 09:11 UTC
- Message-ID
- <SA1PR10MB997715AD62D7F2AF64EB1A9887F1F82@SA1PR10MB997715.namprd10.prod.outlook.com>
From: Travor Liu <travor_lzh@outlook.com>
This series fixes gitweb rendering of commitdiff index lines that carry a trailing file mode, such as:
index <old>..<new> 100644
gitweb currently recognizes the mode before matching the object IDs, which appends the file-type annotation first. The later object-ID matcher expects the ID range to end the line, so these common index lines keep two full, unlinked object IDs.
Patch 1 moves the mode handling so the index object IDs can still be shortened and linked.
Patch 2 adds a gitweb regression test for the common "index <old>..<new> 100644" form.
Tested with:
make NO_RUST=YesPlease
cd t && prove -v t9502-gitweb-standalone-parse-output.shTravor Liu (2): gitweb: shorten index hashes with trailing file modes t9502: test gitweb index hash formatting with modes
gitweb/gitweb.perl | 18 +++++++++++++----- t/t9502-gitweb-standalone-parse-output.sh | 14 ++++++++++++++ 2 files changed, 27 insertions(+), 5 deletions(-)
-- 2.52.0