<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/git.git/diff.c, branch v1.6.5.4</title>
<subtitle>Git
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/git.git/atom?h=v1.6.5.4</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/atom?h=v1.6.5.4'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/'/>
<updated>2009-11-16T08:01:56Z</updated>
<entry>
<title>Merge branch 'js/maint-diff-color-words' into maint</title>
<updated>2009-11-16T08:01:56Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2009-11-16T08:01:56Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=d404a3e1a5588fa075e4fae6679603a5add2e4df'/>
<id>urn:sha1:d404a3e1a5588fa075e4fae6679603a5add2e4df</id>
<content type='text'>
* js/maint-diff-color-words:
  diff --color-words: bit of clean-up
  diff --color-words -U0: fix the location of hunk headers
  t4034-diff-words: add a test for word diff without context

Conflicts:
	diff.c
</content>
</entry>
<entry>
<title>Merge branch 'jc/maint-blank-at-eof' into maint</title>
<updated>2009-11-16T07:06:34Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2009-11-16T07:06:34Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=6dbdba00ea2175894e1ad7a5e96899b7b087ed1d'/>
<id>urn:sha1:6dbdba00ea2175894e1ad7a5e96899b7b087ed1d</id>
<content type='text'>
* jc/maint-blank-at-eof:
  diff -B: colour whitespace errors
  diff.c: emit_add_line() takes only the rest of the line
  diff.c: split emit_line() from the first char and the rest of the line
  diff.c: shuffling code around
  diff --whitespace: fix blank lines at end
  core.whitespace: split trailing-space into blank-at-{eol,eof}
  diff --color: color blank-at-eof
  diff --whitespace=warn/error: fix blank-at-eof check
  diff --whitespace=warn/error: obey blank-at-eof
  diff.c: the builtin_diff() deals with only two-file comparison
  apply --whitespace: warn blank but not necessarily empty lines at EOF
  apply --whitespace=warn/error: diagnose blank at EOF
  apply.c: split check_whitespace() into two
  apply --whitespace=fix: detect new blank lines at eof correctly
  apply --whitespace=fix: fix handling of blank lines at the eof
</content>
</entry>
<entry>
<title>diff --color-words: bit of clean-up</title>
<updated>2009-10-31T21:25:15Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2009-10-30T17:09:06Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=76fd28283f7eeea246a06994edd43ab60e59d853'/>
<id>urn:sha1:76fd28283f7eeea246a06994edd43ab60e59d853</id>
<content type='text'>
When we introduced the "word diff" mode, we could have done one of three
things:

 * change fn_out_consume() to "this is called every time a line worth of
   diff becomes ready from the lower-level diff routine.  This function
   knows two sets of helpers (one for line-oriented diff, another for word
   diff), and each set has various functions to be called at certain
   places (e.g. hunk header, context, ...).  The function's role is to
   inspect the incoming line, and dispatch appropriate helpers to produce
   either line- or word- oriented diff output."

 * introduce fn_out_consume_word_diff() that is "this is called every time
   a line worth of diff becomes ready from the lower-level diff routine,
   and here is what we do to prepare word oriented diff using that line."
   without touching fn_out_consume() at all.

 * Do neither of the above, and keep fn_out_consume() to "this is called
   every time a line worth of diff becomes ready from the lower-level diff
   routine, and here is what we do to output line oriented diff using that
   line."  but sprinkle a handful of 'are we in word-diff mode?  if so do
   this totally different thing' at random places.

This patch is to at least abstract the details of "this totally different
thing" out from the main codepath, in order to improve readability.

We can later refactor it by introducing fn_out_consume_word_diff(), taking
the second route above, but that is a separate topic.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>diff --color-words -U0: fix the location of hunk headers</title>
<updated>2009-10-30T16:42:56Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>Johannes.Schindelin@gmx.de</email>
</author>
<published>2009-10-29T10:45:03Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=a4ca1465ec8afee798bf8f11d727179ca3da64a9'/>
<id>urn:sha1:a4ca1465ec8afee798bf8f11d727179ca3da64a9</id>
<content type='text'>
Colored word diff without context lines firstly printed all the hunk
headers among each other and then printed the diff.

This was due to the code relying on getting at least one context line at
the end of each hunk, where the colored words would be flushed (it is
done that way to be able to ignore rewrapped lines).

Noticed by Markus Heidelberg.

Signed-off-by: Johannes Schindelin &lt;johannes.schindelin@gmx.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'jc/maint-1.6.0-blank-at-eof' into jc/maint-blank-at-eof</title>
<updated>2009-09-15T18:21:10Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2009-09-15T18:21:10Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=d91ba8fa88a83ec70588700a56c8a4c1e8beb1be'/>
<id>urn:sha1:d91ba8fa88a83ec70588700a56c8a4c1e8beb1be</id>
<content type='text'>
* jc/maint-1.6.0-blank-at-eof:
  diff -B: colour whitespace errors
</content>
</entry>
<entry>
<title>Merge branch 'jc/maint-1.6.0-blank-at-eof' (early part) into jc/maint-blank-at-eof</title>
<updated>2009-09-15T18:20:46Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2009-09-15T18:20:46Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=61c6457e893f568524155b4197a6be076a27ce3d'/>
<id>urn:sha1:61c6457e893f568524155b4197a6be076a27ce3d</id>
<content type='text'>
* 'jc/maint-1.6.0-blank-at-eof' (early part):
  diff.c: emit_add_line() takes only the rest of the line
  diff.c: split emit_line() from the first char and the rest of the line
</content>
</entry>
<entry>
<title>Merge branch 'jc/maint-1.6.0-blank-at-eof' (early part) into jc/maint-blank-at-eof</title>
<updated>2009-09-15T10:38:30Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2009-09-15T10:38:30Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=bb35fefbc952d5661d8b675aa5e0c1c49c515487'/>
<id>urn:sha1:bb35fefbc952d5661d8b675aa5e0c1c49c515487</id>
<content type='text'>
* 'jc/maint-1.6.0-blank-at-eof' (early part):
  diff.c: shuffling code around
</content>
</entry>
<entry>
<title>Merge branch 'jc/maint-1.6.0-blank-at-eof' (early part) into jc/maint-blank-at-eof</title>
<updated>2009-09-15T10:28:08Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2009-09-15T10:28:08Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=afd9db4173b99fb2fb103ec604498896a6bedaa7'/>
<id>urn:sha1:afd9db4173b99fb2fb103ec604498896a6bedaa7</id>
<content type='text'>
* 'jc/maint-1.6.0-blank-at-eof' (early part):
  diff --whitespace: fix blank lines at end
  core.whitespace: split trailing-space into blank-at-{eol,eof}
  diff --color: color blank-at-eof
  diff --whitespace=warn/error: fix blank-at-eof check
  diff --whitespace=warn/error: obey blank-at-eof
  diff.c: the builtin_diff() deals with only two-file comparison
  apply --whitespace: warn blank but not necessarily empty lines at EOF
  apply --whitespace=warn/error: diagnose blank at EOF
  apply.c: split check_whitespace() into two
  apply --whitespace=fix: detect new blank lines at eof correctly
  apply --whitespace=fix: fix handling of blank lines at the eof
</content>
</entry>
<entry>
<title>diff -B: colour whitespace errors</title>
<updated>2009-09-15T09:41:03Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2009-09-15T01:44:01Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=7f7ee2ff2dfbb8435a4b46750f573ef0f7d0b853'/>
<id>urn:sha1:7f7ee2ff2dfbb8435a4b46750f573ef0f7d0b853</id>
<content type='text'>
We used to send the old and new contents more or less straight out to the
output with only the original "old is red, new is green" colouring.  Now
all the necessary support routines have been prepared, call them with a
line of data at a time from the output code and have them check and color
whitespace errors in exactly the same way as they are called from the low
level diff callback routines.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>diff.c: emit_add_line() takes only the rest of the line</title>
<updated>2009-09-15T09:41:02Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2009-09-15T01:44:01Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=018cff70462eb59779c96a383531c4440fb35b9c'/>
<id>urn:sha1:018cff70462eb59779c96a383531c4440fb35b9c</id>
<content type='text'>
As the first character on the line that is fed to this function is always
"+", it is pointless to send that along with the rest of the line.

This change will make it easier to reuse the logic when emitting the
rewrite diff, as we do not want to copy a line only to add "+"/"-"/" "
immediately before its first character when we produce rewrite diff
output.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
