Web lists-archives.com

Diff Range Underflow




I discovered an apparent underflow when using the —unified=0 / -U0 flag with git-show on a merge commit.
Leaving the flag on its default value or 1 shows the ranges correctly.

	$git --no-pager show -z --no-color --pretty=%x00%s%x00%b%x00 -U1 3ac9cfed9ce01836dea1fee96c4eceb2df4b6878

produces a diff with the following ranges

	@@@ -582,2 -599,19 +582,1 @@@ extension TranslationContentViewControl

changing the flag to -U0 like so

	git --no-pager show -z --no-color --pretty=%x00%s%x00%b%x00 -U0 3ac9cfed9ce01836dea1fee96c4eceb2df4b6878

results in the following ranges begin output

	@@@ -583,0 -600,17 +583,18446744073709551615 @@@ extension TranslationContentViewControl


Obviously this is some sort of underflow bug.
Unfortunately I cant share the original repo or diff.


Best regards,
Erik