<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/git.git, branch jc/maint-diff-patch-header</title>
<subtitle>github.com: git/git.git
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/git.git/'/>
<entry>
<title>diff -p: squelch "diff --git" header for stat-dirty paths</title>
<updated>2012-03-01T20:00:01+00:00</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2012-03-01T02:14:16+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/git.git/commit/?id=b3f01ff29f7131e959bcfdfd004744d74d5fa319'/>
<id>b3f01ff29f7131e959bcfdfd004744d74d5fa319</id>
<content type='text'>
The plumbing "diff" commands look at the working tree files without
refreshing the index themselves for performance reasons (the calling
script is expected to do that upfront just once, before calling one or
more of them).  In the early days of git, they showed the "diff --git"
header before they actually ask the xdiff machinery to produce patches,
and ended up showing only these headers if the real contents are the same
and the difference they noticed was only because the stat info cached in
the index did not match that of the working tree. It was too late for the
implementation to take the header that it already emitted back.

But 3e97c7c (No diff -b/-w output for all-whitespace changes, 2009-11-19)
introduced necessary logic to keep the meta-information headers in a
strbuf and delay their output until the xdiff machinery noticed actual
changes. This was primarily in order to generate patches that ignore
whitespaces. When operating under "-w" mode, we wouldn't know if the
header is needed until we actually look at the resulting patch, so it was
a sensible thing to do, but we did not realize that the same reasoning
applies to stat-dirty paths.

Later, 296c6bb (diff: fix "git show -C -C" output when renaming a binary
file, 2010-05-26) generalized this machinery and added must_show_header
toggle.  This is turned on when the header must be shown even when there
is no patch to be produced, e.g. only the mode was changed, or the path
was renamed, without changing the contents.  However, when it did so, it
still kept the special case for the "-w" mode, which meant that the
plumbing would keep showing these phantom changes.

This corrects this historical inconsistency by allowing the plumbing to
omit paths that are only stat-dirty from its output in the same way as it
handles whitespace only changes under "-w" option.

The change in the behaviour can be seen in the updated test.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The plumbing "diff" commands look at the working tree files without
refreshing the index themselves for performance reasons (the calling
script is expected to do that upfront just once, before calling one or
more of them).  In the early days of git, they showed the "diff --git"
header before they actually ask the xdiff machinery to produce patches,
and ended up showing only these headers if the real contents are the same
and the difference they noticed was only because the stat info cached in
the index did not match that of the working tree. It was too late for the
implementation to take the header that it already emitted back.

But 3e97c7c (No diff -b/-w output for all-whitespace changes, 2009-11-19)
introduced necessary logic to keep the meta-information headers in a
strbuf and delay their output until the xdiff machinery noticed actual
changes. This was primarily in order to generate patches that ignore
whitespaces. When operating under "-w" mode, we wouldn't know if the
header is needed until we actually look at the resulting patch, so it was
a sensible thing to do, but we did not realize that the same reasoning
applies to stat-dirty paths.

Later, 296c6bb (diff: fix "git show -C -C" output when renaming a binary
file, 2010-05-26) generalized this machinery and added must_show_header
toggle.  This is turned on when the header must be shown even when there
is no patch to be produced, e.g. only the mode was changed, or the path
was renamed, without changing the contents.  However, when it did so, it
still kept the special case for the "-w" mode, which meant that the
plumbing would keep showing these phantom changes.

This corrects this historical inconsistency by allowing the plumbing to
omit paths that are only stat-dirty from its output in the same way as it
handles whitespace only changes under "-w" option.

The change in the behaviour can be seen in the updated test.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>t4011: illustrate "diff-index -p" on stat-dirty paths</title>
<updated>2012-03-01T20:00:01+00:00</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2012-03-01T02:14:15+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/git.git/commit/?id=5597e84b514454f18bba7b13eee2feea04f0165b'/>
<id>5597e84b514454f18bba7b13eee2feea04f0165b</id>
<content type='text'>
The plumbing that looks at the working tree, i.e. "diff-index" and
"diff-files", always emit the "diff --git a/path b/path" header lines
without anything else for paths that are only stat-dirty (i.e. different
only because the cached stat information in the index no longer matches
that of the working tree, but the real contents are the same), when
these commands are run with "-p" option to produce patches.

Illustrate this current behaviour.  Also demonstrate that with the "-w"
option, we (correctly) hold off showing a "diff --git" header until actual
differences have been found.  This also suppresses the header for merely
stat-dirty files, which is inconsistent.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The plumbing that looks at the working tree, i.e. "diff-index" and
"diff-files", always emit the "diff --git a/path b/path" header lines
without anything else for paths that are only stat-dirty (i.e. different
only because the cached stat information in the index no longer matches
that of the working tree, but the real contents are the same), when
these commands are run with "-p" option to produce patches.

Illustrate this current behaviour.  Also demonstrate that with the "-w"
option, we (correctly) hold off showing a "diff --git" header until actual
differences have been found.  This also suppresses the header for merely
stat-dirty files, which is inconsistent.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>t4011: modernise style</title>
<updated>2012-03-01T19:59:51+00:00</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2012-03-01T02:14:14+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/git.git/commit/?id=13a4899886958c211b96bced228fdaaa42674491'/>
<id>13a4899886958c211b96bced228fdaaa42674491</id>
<content type='text'>
Match the style to more modern test scripts, namely:

 - The first line of each test has prereq, title and opening sq for the
   script body.  This makes the test shorter while reducing the need for
   backslashes.

 - Be prepared for the case in which the previous test may have failed.
   If a test wants to start from not having "frotz" that the previous test
   may have created, write "rm -f frotz", not "rm frotz".

 - Prepare the expected output inside your own test.

 - The order of comparison to check the result is "diff expected actual",
   so that the output will show how the output from the git you just broke
   is different from what is expected.

 - Write no SP between redirection '&gt;' (or '&lt;' for that matter) and the
   filename.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Match the style to more modern test scripts, namely:

 - The first line of each test has prereq, title and opening sq for the
   script body.  This makes the test shorter while reducing the need for
   backslashes.

 - Be prepared for the case in which the previous test may have failed.
   If a test wants to start from not having "frotz" that the previous test
   may have created, write "rm -f frotz", not "rm frotz".

 - Prepare the expected output inside your own test.

 - The order of comparison to check the result is "diff expected actual",
   so that the output will show how the output from the git you just broke
   is different from what is expected.

 - Write no SP between redirection '&gt;' (or '&lt;' for that matter) and the
   filename.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge branch 'jk/no-textconv-symlink'</title>
<updated>2010-11-17T22:59:10+00:00</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2010-11-17T22:59:10+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/git.git/commit/?id=6a2e93f1074d5a8b25c2020805e6b8d795d13e4d'/>
<id>6a2e93f1074d5a8b25c2020805e6b8d795d13e4d</id>
<content type='text'>
* jk/no-textconv-symlink:
  diff: don't use pathname-based diff drivers for symlinks
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* jk/no-textconv-symlink:
  diff: don't use pathname-based diff drivers for symlinks
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge branch 'dk/maint-blame-el'</title>
<updated>2010-11-17T22:59:04+00:00</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2010-11-17T22:59:04+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/git.git/commit/?id=fbfe5de5bdaaf9572c1811e3b4ddfaa35e6bb227'/>
<id>fbfe5de5bdaaf9572c1811e3b4ddfaa35e6bb227</id>
<content type='text'>
* dk/maint-blame-el:
  git-blame.el: Add (require 'format-spec)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* dk/maint-blame-el:
  git-blame.el: Add (require 'format-spec)
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge branch 'maint'</title>
<updated>2010-11-17T21:57:58+00:00</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2010-11-17T21:57:58+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/git.git/commit/?id=5a7a0fae8f964b5ad179018d6a50f25ef7550f97'/>
<id>5a7a0fae8f964b5ad179018d6a50f25ef7550f97</id>
<content type='text'>
* maint:
  clean: remove redundant variable baselen
  Documentation/git-pull: clarify configuration
  Document that rev-list --graph triggers parent rewriting.
  clean: avoid quoting twice
  document sigchain api
  Keep together options controlling the behaviour of diffcore-rename.
  t3402: test "rebase -s&lt;strategy&gt; -X&lt;opt&gt;"
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* maint:
  clean: remove redundant variable baselen
  Documentation/git-pull: clarify configuration
  Document that rev-list --graph triggers parent rewriting.
  clean: avoid quoting twice
  document sigchain api
  Keep together options controlling the behaviour of diffcore-rename.
  t3402: test "rebase -s&lt;strategy&gt; -X&lt;opt&gt;"
</pre>
</div>
</content>
</entry>
<entry>
<title>clean: remove redundant variable baselen</title>
<updated>2010-11-17T21:26:38+00:00</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2010-11-15T06:42:44+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/git.git/commit/?id=1c7d402b3e1e9d7e50abfbfb18c88bc79be468ea'/>
<id>1c7d402b3e1e9d7e50abfbfb18c88bc79be468ea</id>
<content type='text'>
baselen used to be the result of common_prefix() when it was made
builtin. Since 1d8842d (Add 'fill_directory()' helper function for
directory traversal - 2009-05-14), its value will always be
zero. Remove it because it's no longer variable.

Signed-off-by: Nguyễn Thái Ngọc Duy &lt;pclouds@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
baselen used to be the result of common_prefix() when it was made
builtin. Since 1d8842d (Add 'fill_directory()' helper function for
directory traversal - 2009-05-14), its value will always be
zero. Remove it because it's no longer variable.

Signed-off-by: Nguyễn Thái Ngọc Duy &lt;pclouds@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge branch 'mz/maint-rebase-X-fix' into maint</title>
<updated>2010-11-17T21:18:19+00:00</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2010-11-17T21:18:19+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/git.git/commit/?id=5d268edff8a271fe68f525e8d382a13b96c71a81'/>
<id>5d268edff8a271fe68f525e8d382a13b96c71a81</id>
<content type='text'>
* mz/maint-rebase-X-fix:
  t3402: test "rebase -s&lt;strategy&gt; -X&lt;opt&gt;"
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* mz/maint-rebase-X-fix:
  t3402: test "rebase -s&lt;strategy&gt; -X&lt;opt&gt;"
</pre>
</div>
</content>
</entry>
<entry>
<title>Documentation/git-pull: clarify configuration</title>
<updated>2010-11-17T21:17:46+00:00</updated>
<author>
<name>Martin von Zweigbergk</name>
<email>martin.von.zweigbergk@gmail.com</email>
</author>
<published>2010-11-12T18:55:58+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/git.git/commit/?id=11fe3f73cce13b759a728b0a9ac95e745470f251'/>
<id>11fe3f73cce13b759a728b0a9ac95e745470f251</id>
<content type='text'>
The sentence about 'branch.&lt;name&gt;.rebase' refers to the first sentence
in the paragraph and not to the sentence about avoiding rebasing
non-local changes. Clarify this.

Signed-off-by: Martin von Zweigbergk &lt;martin.von.zweigbergk@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The sentence about 'branch.&lt;name&gt;.rebase' refers to the first sentence
in the paragraph and not to the sentence about avoiding rebasing
non-local changes. Clarify this.

Signed-off-by: Martin von Zweigbergk &lt;martin.von.zweigbergk@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Document that rev-list --graph triggers parent rewriting.</title>
<updated>2010-11-17T21:16:48+00:00</updated>
<author>
<name>Yann Dirson</name>
<email>ydirson@altern.org</email>
</author>
<published>2010-11-12T08:48:58+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/git.git/commit/?id=6a6c54bafed84220bcd09b19b40c104d1ff687cc'/>
<id>6a6c54bafed84220bcd09b19b40c104d1ff687cc</id>
<content type='text'>
This may help to understand why --graph causes more comments to
be selected.

Signed-off-by: Yann Dirson &lt;ydirson@altern.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This may help to understand why --graph causes more comments to
be selected.

Signed-off-by: Yann Dirson &lt;ydirson@altern.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
