{"thread":{"id":"58348","subject":"Regression in 'git add -p' with 'interactive.diffFilter' since builtin version is default","startedAt":"2022-08-22T22:15:27Z","lastAt":"2022-08-23T19:41:26Z","messageCount":3,"participants":["Philippe Blain","Johannes Schindelin"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"461818","messageId":"ecf6f5be-22ca-299f-a8f1-bda38e5ca246@gmail.com","threadId":"58348","inReplyTo":null,"subject":"Regression in 'git add -p' with 'interactive.diffFilter' since builtin version is default","fromName":"Philippe Blain","fromEmail":"levraiphilippeblain@gmail.com","sentAt":"2022-08-22T22:15:16Z","receivedAt":"2022-08-22T22:15:27Z","isPatch":false,"sender":{"key":"levraiphilippeblain@gmail.com","avatar":"https://avatars.githubusercontent.com/u/44212482?v=4"},"body":"Hi Dscho,\n\nI found a regression in the builtin 'add -i'. I use diff-so-fancy [1]\nas a pager and also use it via 'interactive.diffFilter'. With the \nbuiltin implementation, this errors with:\n\n    error: could not parse colored hunk header '?[36m?[1m?[38;5;13m@ file:1 @?[1m?[0m'\n\nWith the Perl version, it works fine.\n\nThis has been reported in the 'diff-so-fancy' project here: [2].\n\nHere is a reproducer:\n\n~~~bash\n#!/bin/bash\n\nset -euEo pipefail\n\nrepo=repro\nrm -rf $repo\n\nTEST_AUTHOR_LOCALNAME=author\nTEST_AUTHOR_DOMAIN=example.com\nGIT_AUTHOR_EMAIL=${TEST_AUTHOR_LOCALNAME}@${TEST_AUTHOR_DOMAIN}\nGIT_AUTHOR_NAME='A U Thor'\nGIT_AUTHOR_DATE='1112354055 +0200'\nTEST_COMMITTER_LOCALNAME=committer\nTEST_COMMITTER_DOMAIN=example.com\nGIT_COMMITTER_EMAIL=${TEST_COMMITTER_LOCALNAME}@${TEST_COMMITTER_DOMAIN}\nGIT_COMMITTER_NAME='C O Mitter'\nGIT_COMMITTER_DATE='1112354055 +0200'\nexport GIT_AUTHOR_EMAIL GIT_AUTHOR_NAME\nexport GIT_COMMITTER_EMAIL GIT_COMMITTER_NAME\nexport GIT_COMMITTER_DATE GIT_AUTHOR_DATE\nexport HOME=\n\ngit -c init.defaultBranch=unimportant init $repo\ncd $repo\ndate>file\ngit add file\ngit commit -m file\ngit clone https://github.com/so-fancy/diff-so-fancy.git\ndate>>file\nexport PATH=\"diff-so-fancy:$PATH\"\ngit -c interactive.diffFilter=\"diff-so-fancy --patch\" -c add.interactive.useBuiltin=false add -p < <(echo y)\ndate>>file\ngit -c interactive.diffFilter=\"diff-so-fancy --patch\" add -p\n~~~\n\nCheers,\n\nPhilippe.\n\n[1] https://github.com/so-fancy/diff-so-fancy\n[2] https://github.com/so-fancy/diff-so-fancy/issues/437\n"},{"id":"461855","messageId":"s40ss309-3311-o08s-38r2-9144r33pq549@tzk.qr","threadId":"58348","inReplyTo":"ecf6f5be-22ca-299f-a8f1-bda38e5ca246@gmail.com","subject":"Re: Regression in 'git add -p' with 'interactive.diffFilter' since builtin version is default","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2022-08-23T13:08:40Z","receivedAt":"2022-08-23T16:41:26Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Philippe,\n\nOn Mon, 22 Aug 2022, Philippe Blain wrote:\n\n> I found a regression in the builtin 'add -i'. I use diff-so-fancy [1]\n> as a pager and also use it via 'interactive.diffFilter'. With the\n> builtin implementation, this errors with:\n>\n>     error: could not parse colored hunk header '?[36m?[1m?[38;5;13m@ file:1 @?[1m?[0m'\n>\n> With the Perl version, it works fine.\n\nHmm. This looks different than what Peff reported in\nhttps://lore.kernel.org/git/20201112184026.GB701197@coredump.intra.peff.net/,\nwhere the command errored out with:\n\n\t  $ git -c interactive.difffilter='diff-so-fancy' add -p\n\t  fatal: mismatched output from interactive.diffFilter\n\t  hint: Your filter must maintain a one-to-one correspondence\n\t  hint: between its input and output lines.\n\nI _think_ I have an idea how to address this. Stay tuned.\n\nCiao,\nDscho\n"},{"id":"461872","messageId":"2qpp7417-79qr-364s-3798-r471sp6ron54@tzk.qr","threadId":"58348","inReplyTo":"s40ss309-3311-o08s-38r2-9144r33pq549@tzk.qr","subject":"Re: Regression in 'git add -p' with 'interactive.diffFilter' since builtin version is default","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2022-08-23T18:38:27Z","receivedAt":"2022-08-23T19:41:26Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Philippe,\n\nOn Tue, 23 Aug 2022, Johannes Schindelin wrote:\n\n> Hi Philippe,\n>\n> On Mon, 22 Aug 2022, Philippe Blain wrote:\n>\n> > I found a regression in the builtin 'add -i'. I use diff-so-fancy [1]\n> > as a pager and also use it via 'interactive.diffFilter'. With the\n> > builtin implementation, this errors with:\n> >\n> >     error: could not parse colored hunk header '?[36m?[1m?[38;5;13m@ file:1 @?[1m?[0m'\n> >\n> > With the Perl version, it works fine.\n>\n> Hmm. This looks different than what Peff reported in\n> https://lore.kernel.org/git/20201112184026.GB701197@coredump.intra.peff.net/,\n> where the command errored out with:\n>\n> \t  $ git -c interactive.difffilter='diff-so-fancy' add -p\n> \t  fatal: mismatched output from interactive.diffFilter\n> \t  hint: Your filter must maintain a one-to-one correspondence\n> \t  hint: between its input and output lines.\n>\n> I _think_ I have an idea how to address this. Stay tuned.\n\nSeems that the Git mailing list is taking a mental health care day... it\ntook a while for the quoted reply to show up, and while I submitted\nhttps://github.com/gitgitgadget/git/pull/1336 half an hour ago, it also\nhas yet to arrive...\n\nCiao,\nDscho\n"}]}