git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: js/add-p-diff-parsing-fix (was: What's cooking in git.git (Aug 2022, #10; Tue, 30))
Date: Wed, 31 Aug 2022 10:29:46 +0200	[thread overview]
Message-ID: <220831.86bks0ajy7.gmgdl@evledraar.gmail.com> (raw)
In-Reply-To: <xmqqilm9k0bc.fsf@gitster.g>


On Tue, Aug 30 2022, Junio C Hamano wrote:

> * js/add-p-diff-parsing-fix (2022-08-29) 5 commits
>  - add -p: ignore dirty submodules
>  - add -p: handle `diff-so-fancy`'s hunk headers better
>  - add -p: insert space in colored hunk header as needed
>  - add -p: gracefully ignore unparseable hunk headers in colored diffs
>  - t3701: redefine what is "bogus" output of a diff filter
>
>  Those who use diff-so-fancy as the diff-filter noticed a regression
>  or two in the reimplemented "add -p", which has been corrected.
>
>  Will merge to 'next'?
>  source: <pull.1336.v3.git.1661785916.gitgitgadget@gmail.com>

This LGTM.

For the release notes you might want to tweak this. While this series
fixes an issue that some users ran into with "diff-so-fancy" it's really
just a generic set of fixes for "git add -p". The issue just happens to
have been discovered with that tool.

E.g. on master now you can try this in git.git:

	echo hi >README.mda
	./git -c interactive.diffFilter=tac add -p
	error: could not parse colored hunk header '?[31m-[Documentation/gitcvs-migration.txt]: Documentation/gitcvs-migration.txt?[m'

I.e. just reversing the output with tac(1) is enough to trigger the
failure fixed in this series.

Maybe?:

	'git-add -p' can now parse diffs that don't contain the line
	information that "git diff" itself would emit within "@@
	... @@". As a result the reimplemented "add -p" can now be used
	with the popular "diff-so-fancy" utility.


  parent reply	other threads:[~2022-08-31  8:36 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-30 19:17 What's cooking in git.git (Aug 2022, #10; Tue, 30) Junio C Hamano
2022-08-30 20:40 ` js/bisect-in-c, was " Johannes Schindelin
2022-08-31  8:00 ` jk/unused-annotation + ab/unused-annotation (was: What's cooking in git.git (Aug 2022, #10; Tue, 30)) Ævar Arnfjörð Bjarmason
2022-08-31 15:27   ` Jeff King
2022-08-31 16:23     ` jk/unused-annotation + ab/unused-annotation Junio C Hamano
2022-08-31 17:21       ` Ævar Arnfjörð Bjarmason
2022-08-31  8:29 ` Ævar Arnfjörð Bjarmason [this message]
2022-08-31  9:31   ` js/add-p-diff-parsing-fix (was: What's cooking in git.git (Aug 2022, #10; Tue, 30)) Phillip Wood
2022-08-31 19:54     ` Johannes Schindelin
2022-08-31 20:15       ` js/add-p-diff-parsing-fix Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=220831.86bks0ajy7.gmgdl@evledraar.gmail.com \
    --to=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).