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

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

From
Naja Melan <najamelan@autistici.org>
Date
Jul 8, 2016, 16:51 UTC
Message-ID
<3153d359-2b82-d5e2-9e92-7a28bcd8bc48@autistici.org>

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.

Other diff algorithms don't suffer from this and patience doesn't if I don't put --ignore-space-at-eol.

See the following output for a proof:
$ git diff --ignore-space-at-eol lib/gitomate/facts/path.rb
diff --git a/lib/gitomate/facts/path.rb b/lib/gitomate/facts/path.rb
index bc99661..a5cd184 100644
--- a/lib/gitomate/facts/path.rb
+++ b/lib/gitomate/facts/path.rb
@@ -77,7 +77,7 @@ def check( update = false )
      options( :exist ) and warn "#{@info[ :path ].inspect} does not exist."
      options( :exist ) or  warn "#{@info[ :path ].inspect} exists but
it shouldn't."

-     @checked = true
+     @checked = trued
      return @checkPassed = false

   end

$ git diff --patience --ignore-space-at-eol lib/gitomate/facts/path.rb
-> no output

$ git diff --patience lib/gitomate/facts/path.rb

diff --git a/lib/gitomate/facts/path.rb b/lib/gitomate/facts/path.rb
index bc99661..a5cd184 100644
--- a/lib/gitomate/facts/path.rb
+++ b/lib/gitomate/facts/path.rb
@@ -77,7 +77,7 @@ def check( update = false )
      options( :exist ) and warn "#{@info[ :path ].inspect} does not exist."
      options( :exist ) or  warn "#{@info[ :path ].inspect} exists but
it shouldn't."

-     @checked = true
+     @checked = trued
      return @checkPassed = false

   end


Naja Melan
Next: Johannes Schindelin
Message 1 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.