{"thread":{"id":"60904","subject":"Possible bug with 'diff --cc' report","startedAt":"2024-02-13T02:24:17Z","lastAt":"2024-02-13T02:24:17Z","messageCount":1,"participants":["Groboclown"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"488500","messageId":"CAEfaiTSX8kh1WMQDtT0XFUC2o3Ldu9r75F0kB9qUuby5VcrZcQ@mail.gmail.com","threadId":"60904","inReplyTo":null,"subject":"Possible bug with 'diff --cc' report","fromName":"Groboclown","fromEmail":"groboclown@gmail.com","sentAt":"2024-02-13T02:24:04Z","receivedAt":"2024-02-13T02:24:17Z","isPatch":false,"sender":{"key":"groboclown@gmail.com","avatar":null},"body":"While testing out the report parser for the gitleaks go-gitdiff\nlibrary against a repository, I encountered output in the form:\n\n@@@ -229,4 -229,18446744073709551615 +228,3 @@@ Comment\n\nThe '18446744073709551615' value is interesting, in that it's a uint64\nvalue storing a signed int64 -1.  Along with this, the number of\nchanged lines in the output was actually 5 / 0 / 4 (as opposed to 4 /\n-1 / 3).  I found the '-1' value as the first, second, and third line\ncounts (the code only used at most 2 parents per commit).\n\nAt first I thought this to only happen on some 0 line change\ninstances, but I also found a diff result that looked like (I added a\n' mark before each line to make the spacing obvious):\n\n'@@@ -225,4 -237,2 +225,6 @@@ Comment\n' +line 1\n' +line 2\n' +line 3\n' +line 4\n'- line 5\n'++line 6\n'++line 7\n'+ line 8\n' -line 9\n' -line 10\n\nThe reported line counts doesn't match the actual output.  Based on\nother examples plus the documentation, it looks like these are also\noff by 1 - by my count, it should be 5 / 3 / 7, rather than 4 / 2 / 6.\n\nSystem information:\n\ngit version 2.43.0\ncpu: x86_64\nsizeof-long: 8\nsizeof-size_t: 8\nuname: Linux 5.15.146.1-microsoft-standard-WSL2\ncompiler info: gnuc: 13.2\nlibc info: glibc: 2.39\n"}]}