git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Regression in 'git add -p' with 'interactive.diffFilter' since builtin version is default
@ 2022-08-22 22:15 Philippe Blain
  2022-08-23 13:08 ` Johannes Schindelin
  0 siblings, 1 reply; 3+ messages in thread
From: Philippe Blain @ 2022-08-22 22:15 UTC (permalink / raw)
  To: Johannes Schindelin, Git mailing list

Hi Dscho,

I found a regression in the builtin 'add -i'. I use diff-so-fancy [1]
as a pager and also use it via 'interactive.diffFilter'. With the 
builtin implementation, this errors with:

    error: could not parse colored hunk header '?[36m?[1m?[38;5;13m@ file:1 @?[1m?[0m'

With the Perl version, it works fine.

This has been reported in the 'diff-so-fancy' project here: [2].

Here is a reproducer:

~~~bash
#!/bin/bash

set -euEo pipefail

repo=repro
rm -rf $repo

TEST_AUTHOR_LOCALNAME=author
TEST_AUTHOR_DOMAIN=example.com
GIT_AUTHOR_EMAIL=${TEST_AUTHOR_LOCALNAME}@${TEST_AUTHOR_DOMAIN}
GIT_AUTHOR_NAME='A U Thor'
GIT_AUTHOR_DATE='1112354055 +0200'
TEST_COMMITTER_LOCALNAME=committer
TEST_COMMITTER_DOMAIN=example.com
GIT_COMMITTER_EMAIL=${TEST_COMMITTER_LOCALNAME}@${TEST_COMMITTER_DOMAIN}
GIT_COMMITTER_NAME='C O Mitter'
GIT_COMMITTER_DATE='1112354055 +0200'
export GIT_AUTHOR_EMAIL GIT_AUTHOR_NAME
export GIT_COMMITTER_EMAIL GIT_COMMITTER_NAME
export GIT_COMMITTER_DATE GIT_AUTHOR_DATE
export HOME=

git -c init.defaultBranch=unimportant init $repo
cd $repo
date>file
git add file
git commit -m file
git clone https://github.com/so-fancy/diff-so-fancy.git
date>>file
export PATH="diff-so-fancy:$PATH"
git -c interactive.diffFilter="diff-so-fancy --patch" -c add.interactive.useBuiltin=false add -p < <(echo y)
date>>file
git -c interactive.diffFilter="diff-so-fancy --patch" add -p
~~~

Cheers,

Philippe.

[1] https://github.com/so-fancy/diff-so-fancy
[2] https://github.com/so-fancy/diff-so-fancy/issues/437

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Regression in 'git add -p' with 'interactive.diffFilter' since builtin version is default
  2022-08-22 22:15 Regression in 'git add -p' with 'interactive.diffFilter' since builtin version is default Philippe Blain
@ 2022-08-23 13:08 ` Johannes Schindelin
  2022-08-23 18:38   ` Johannes Schindelin
  0 siblings, 1 reply; 3+ messages in thread
From: Johannes Schindelin @ 2022-08-23 13:08 UTC (permalink / raw)
  To: Philippe Blain; +Cc: Git mailing list

Hi Philippe,

On Mon, 22 Aug 2022, Philippe Blain wrote:

> I found a regression in the builtin 'add -i'. I use diff-so-fancy [1]
> as a pager and also use it via 'interactive.diffFilter'. With the
> builtin implementation, this errors with:
>
>     error: could not parse colored hunk header '?[36m?[1m?[38;5;13m@ file:1 @?[1m?[0m'
>
> With the Perl version, it works fine.

Hmm. This looks different than what Peff reported in
https://lore.kernel.org/git/20201112184026.GB701197@coredump.intra.peff.net/,
where the command errored out with:

	  $ git -c interactive.difffilter='diff-so-fancy' add -p
	  fatal: mismatched output from interactive.diffFilter
	  hint: Your filter must maintain a one-to-one correspondence
	  hint: between its input and output lines.

I _think_ I have an idea how to address this. Stay tuned.

Ciao,
Dscho

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Regression in 'git add -p' with 'interactive.diffFilter' since builtin version is default
  2022-08-23 13:08 ` Johannes Schindelin
@ 2022-08-23 18:38   ` Johannes Schindelin
  0 siblings, 0 replies; 3+ messages in thread
From: Johannes Schindelin @ 2022-08-23 18:38 UTC (permalink / raw)
  To: Philippe Blain; +Cc: Git mailing list

Hi Philippe,

On Tue, 23 Aug 2022, Johannes Schindelin wrote:

> Hi Philippe,
>
> On Mon, 22 Aug 2022, Philippe Blain wrote:
>
> > I found a regression in the builtin 'add -i'. I use diff-so-fancy [1]
> > as a pager and also use it via 'interactive.diffFilter'. With the
> > builtin implementation, this errors with:
> >
> >     error: could not parse colored hunk header '?[36m?[1m?[38;5;13m@ file:1 @?[1m?[0m'
> >
> > With the Perl version, it works fine.
>
> Hmm. This looks different than what Peff reported in
> https://lore.kernel.org/git/20201112184026.GB701197@coredump.intra.peff.net/,
> where the command errored out with:
>
> 	  $ git -c interactive.difffilter='diff-so-fancy' add -p
> 	  fatal: mismatched output from interactive.diffFilter
> 	  hint: Your filter must maintain a one-to-one correspondence
> 	  hint: between its input and output lines.
>
> I _think_ I have an idea how to address this. Stay tuned.

Seems that the Git mailing list is taking a mental health care day... it
took a while for the quoted reply to show up, and while I submitted
https://github.com/gitgitgadget/git/pull/1336 half an hour ago, it also
has yet to arrive...

Ciao,
Dscho

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-08-23 19:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-22 22:15 Regression in 'git add -p' with 'interactive.diffFilter' since builtin version is default Philippe Blain
2022-08-23 13:08 ` Johannes Schindelin
2022-08-23 18:38   ` Johannes Schindelin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).