#1008617 git add -p emits perl errors with very long files

Package:
git
Source:
git
Description:
fast, scalable, distributed revision control system
Submitter:
Mikko Rasa
Date:
2022-03-29 16:06:03 UTC
Severity:
minor
Tags:
#1008617#5
Date:
2022-03-29 15:38:35 UTC
From:
To:
I'm working on a large Unity project where some of out scene and prefab
files reach six digit line numbers.  When using git add -p on such a file
and selecting the go to hunk option, these errors appear:

Negative repeat count does nothing at /usr/lib/git-core/git-add--interactive line 1399, <STDIN> line 1.

It seems to be due to the summary of the hunks exceeding 20 characters.
The error appears once per such a hunk and makes the list of hunks
difficult to read.  It can be avoided by simply wrapping the offending
line in an if (see attached patch).