]> Lady’s Gitweb - Gitweb/commit
gitweb: make hash size independent
authorbrian m. carlson <redacted>
Tue, 19 Feb 2019 00:05:26 +0000 (00:05 +0000)
committerLady <redacted>
Mon, 6 Apr 2026 04:51:33 +0000 (00:51 -0400)
commit770213e5c94c82dd69cfa50652abefee9ec04318e7de0effc0696b22eb62117c
tree569c392803d397116963345dbeee256d6757c3ac8bc2e09b46bcfaaa03399414
parent16638472ca7d7a0a21ae0357c14494e6ed8b0ff311e6fdaa1c8d21b6f2c3bbda
gitweb: make hash size independent

Gitweb has several hard-coded 40 values throughout it to check for
values that are passed in or acquired from Git.  To simplify the code,
introduce a regex variable that matches either exactly 40 or exactly 64
hex characters, and use this variable anywhere we would have previously
hard-coded a 40 in a regex.

Add some helper functions which allow us to write tighter regexes that
match exactly the number of hex characters we're expecting.

Similarly, switch the code that looks for deleted diffinfo information
to look for either 40 or 64 zeros, and update one piece of code to use
this function.  Finally, when formatting a log line, allow an
abbreviated describe output to contain up to 64 characters.

Helped-by: Ævar Arnfjörð Bjarmason <redacted>
Signed-off-by: brian m. carlson <redacted>
Signed-off-by: Junio C Hamano <redacted>
gitweb.perl
This page took 0.25 seconds and 4 git commands to generate.