git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Git 2.8.1 - bug in patience diff algorithm when used with --ignore-space-at-eol?

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Jul 9, 2016, 06:24 UTC
Message-ID
<alpine.DEB.2.20.1607090823270.6426@virtualbox>
In-Reply-To
<3153d359-2b82-d5e2-9e92-7a28bcd8bc48@autistici.org>
Hi Naja,
On Fri, 8 Jul 2016, Naja Melan wrote:
> When diffing with --patience and --ignore-space-at-eol, a change that
> adds or removes just one character a the end of a line isn't picked up.

Confirmed with the current 'master'. I am on it, building on top of this diff:

-- snipsnap --
diff --git a/t/t4033-diff-patience.sh b/t/t4033-diff-patience.sh
index 3c9932e..6da435b 100755
--- a/t/t4033-diff-patience.sh
+++ b/t/t4033-diff-patience.sh
@@ -5,6 +5,13 @@ test_description='patience diff algorithm'
 . ./test-lib.sh
 . "$TEST_DIRECTORY"/lib-diff-alternative.sh
 
+test_expect_failure '--ignore-space-at-eol with a single appended character' '
+	printf "a\nb\nc\n" >pre &&
+	printf "a\nbX\nc\n" >post &&
+	git diff --no-index --patience --ignore-space-at-eol pre post >diff &&
+	grep "^+.*X" diff
+'
+
 test_diff_frobnitz "patience"
 
 test_diff_unique "patience"
Previous: Naja MelanNext: Johannes Schindelin
Message 2 of 3 in “Git 2.8.1 - bug in patience diff algorithm when used with --ignore-space-at-eol?”
  1. Naja MelanJul 8, 2016
  2. Johannes SchindelinJul 9, 2016
  3. Johannes SchindelinJul 9, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.