Package: git Version: 1:2.35.1+next.20220211-1 Severity: minor Tags: patch 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). -- System Information: Debian Release: bookworm/sid APT prefers unstable APT policy: (500, 'unstable'), (500, 'testing'), (500, 'stable'), (1, 'experimental') Architecture: amd64 (x86_64) Foreign Architectures: i386 Kernel: Linux 5.15.4-k8 (SMP w/24 CPU threads) Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_OOT_MODULE Locale: LANG=en_US.utf8, LC_CTYPE=en_US.utf8 (charmap=UTF-8), LANGUAGE=en_US:en Shell: /bin/sh linked to /bin/dash Init: sysvinit (via /sbin/init) Versions of packages git depends on: ii git-man 1:2.35.1+next.20220211-1 ii libc6 2.33-7 ii libcurl3-gnutls 7.81.0-1 ii liberror-perl 0.17029-1 ii libexpat1 2.4.6-1 ii libpcre2-8-0 10.39-3 ii perl 5.34.0-3 ii zlib1g 1:1.2.11.dfsg-2 Versions of packages git recommends: ii ca-certificates 20211016 ii less 590-1 ii openssh-client [ssh-client] 1:8.9p1-3 ii patch 2.7.6-7 Versions of packages git suggests: ii gettext-base 0.21-4 pn git-cvs <none> pn git-daemon-run | git-daemon-sysvinit <none> pn git-doc <none> pn git-email <none> pn git-gui <none> pn git-mediawiki <none> pn git-svn <none> pn gitk <none> pn gitweb <none> -- no debconf information -- debsums errors found: debsums: changed file /usr/lib/git-core/git-add--interactive (from git package)
--- git-add--interactive.orig 2022-03-29 18:30:14.787905260 +0300 +++ /usr/lib/git-core/git-add--interactive 2022-03-29 18:25:28.990785877 +0300 @@ -1396,7 +1396,9 @@ # Keep the line numbers, discard extra context. $summary =~ s/@@(.*?)@@.*/$1 /s; - $summary .= " " x (20 - length $summary); + if (length $summary < 20) { + $summary .= " " x (20 - length $summary); + } # Add some user context. for my $line (@{$rhunk->{TEXT}}) {