<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/diff.h, branch v1.7.0.5</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://www.git.shady.money/git/atom?h=v1.7.0.5</id>
<link rel='self' href='https://www.git.shady.money/git/atom?h=v1.7.0.5'/>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/'/>
<updated>2010-01-25T01:35:58Z</updated>
<entry>
<title>Merge branch 'jc/fix-tree-walk'</title>
<updated>2010-01-25T01:35:58Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2010-01-25T01:35:58Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=026680f881e751311674d97d0f6ed87f06a92bfb'/>
<id>urn:sha1:026680f881e751311674d97d0f6ed87f06a92bfb</id>
<content type='text'>
* jc/fix-tree-walk:
  read-tree --debug-unpack
  unpack-trees.c: look ahead in the index
  unpack-trees.c: prepare for looking ahead in the index
  Aggressive three-way merge: fix D/F case
  traverse_trees(): handle D/F conflict case sanely
  more D/F conflict tests
  tests: move convenience regexp to match object names to test-lib.sh

Conflicts:
	builtin-read-tree.c
	unpack-trees.c
	unpack-trees.h
</content>
</entry>
<entry>
<title>Performance optimization for detection of modified submodules</title>
<updated>2010-01-19T01:28:21Z</updated>
<author>
<name>Jens Lehmann</name>
<email>Jens.Lehmann@web.de</email>
</author>
<published>2010-01-18T20:26:18Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=e3d42c4773bccebb50f01b108d20b06c6a11e615'/>
<id>urn:sha1:e3d42c4773bccebb50f01b108d20b06c6a11e615</id>
<content type='text'>
In the worst case is_submodule_modified() got called three times for
each submodule. The information we got from scanning the whole
submodule tree the first time can be reused instead.

New parameters have been added to diff_change() and diff_addremove(),
the information is stored in a new member of struct diff_filespec. Its
value is then reused instead of calling is_submodule_modified() again.

When no explicit "-dirty" is needed in the output the call to
is_submodule_modified() is not necessary when the submodules HEAD
already disagrees with the ref of the superproject, as this alone
marks it as modified. To achieve that, get_stat_data() got an extra
argument.

Signed-off-by: Jens Lehmann &lt;Jens.Lehmann@web.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>unpack-trees.c: look ahead in the index</title>
<updated>2010-01-07T23:00:14Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2009-09-20T07:03:39Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=730f72840cc50c523fe4cdd796ea2d2fc4571a28'/>
<id>urn:sha1:730f72840cc50c523fe4cdd796ea2d2fc4571a28</id>
<content type='text'>
This makes the traversal of index be in sync with the tree traversal.
When unpack_callback() is fed a set of tree entries from trees, it
inspects the name of the entry and checks if the an index entry with
the same name could be hiding behind the current index entry, and

 (1) if the name appears in the index as a leaf node, it is also
     fed to the n_way_merge() callback function;

 (2) if the name is a directory in the index, i.e. there are entries in
     that are underneath it, then nothing is fed to the n_way_merge()
     callback function;

 (3) otherwise, if the name comes before the first eligible entry in the
     index, the index entry is first unpacked alone.

When traverse_trees_recursive() descends into a subdirectory, the
cache_bottom pointer is moved to walk index entries within that directory.

All of these are omitted for diff-index, which does not even want to be
fed an index entry and a tree entry with D/F conflicts.

This fixes 3-way read-tree and exposes a bug in other parts of the system
in t6035, test #5.  The test prepares these three trees:

 O = HEAD^
    100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391    a/b-2/c/d
    100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391    a/b/c/d
    100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391    a/x

 A = HEAD
    100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391    a/b-2/c/d
    100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391    a/b/c/d
    100644 blob 587be6b4c3f93f93c489c0111bba5596147a26cb    a/x

 B = master
    120000 blob a36b77384451ea1de7bd340ffca868249626bc52    a/b
    100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391    a/b-2/c/d
    100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391    a/x

With a clean index that matches HEAD, running

    git read-tree -m -u --aggressive $O $A $B

now yields

    120000 a36b77384451ea1de7bd340ffca868249626bc52 3       a/b
    100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0       a/b-2/c/d
    100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 1       a/b/c/d
    100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 2       a/b/c/d
    100644 587be6b4c3f93f93c489c0111bba5596147a26cb 0       a/x

which is correct.  "master" created "a/b" symlink that did not exist,
and removed "a/b/c/d" while HEAD did not do touch either path.

Before this series, read-tree did not notice the situation and resolved
addition of "a/b" and removal of "a/b/c/d" independently.  If A = HEAD had
another path "a/b/c/e" added, this merge should conflict but instead it
silently resolved "a/b" and then immediately overwrote it to add
"a/b/c/e", which was quite bogus.

Tests in t1012 start to work with this.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'jc/1.7.0-diff-whitespace-only-status'</title>
<updated>2009-12-26T22:03:18Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2009-12-26T22:03:18Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=3cc3fb7df67dc9c83b71fec82e5bfb1df3724089'/>
<id>urn:sha1:3cc3fb7df67dc9c83b71fec82e5bfb1df3724089</id>
<content type='text'>
* jc/1.7.0-diff-whitespace-only-status:
  diff.c: fix typoes in comments
  Make test case number unique
  diff: Rename QUIET internal option to QUICK
  diff: change semantics of "ignore whitespace" options

Conflicts:
	diff.h
</content>
</entry>
<entry>
<title>Give the hunk comment its own color</title>
<updated>2009-11-28T18:05:44Z</updated>
<author>
<name>Bert Wesarg</name>
<email>bert.wesarg@googlemail.com</email>
</author>
<published>2009-11-27T06:55:18Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=89cb73a19ac94d15babf77af490fa5db78908234'/>
<id>urn:sha1:89cb73a19ac94d15babf77af490fa5db78908234</id>
<content type='text'>
Inspired by the coloring of quilt.

Introduce a separate color and paint the hunk comment part, i.e. the name
of the function, in a separate color "diff.func" (defaults to plain).

Whitespace between hunk header and hunk comment is printed in plain color.

Signed-off-by: Bert Wesarg &lt;bert.wesarg@googlemail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Add the --submodule option to the diff option family</title>
<updated>2009-10-20T05:31:00Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>johannes.schindelin@gmx.de</email>
</author>
<published>2009-10-19T12:38:32Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=752c0c24926aacbceca0d27de6ad22cbb7dd0709'/>
<id>urn:sha1:752c0c24926aacbceca0d27de6ad22cbb7dd0709</id>
<content type='text'>
When you use the option --submodule=log you can see the submodule
summaries inlined in the diff, instead of not-quite-helpful SHA-1 pairs.

The format imitates what "git submodule summary" shows.

To do that, &lt;path&gt;/.git/objects/ is added to the alternate object
databases (if that directory exists).

This option was requested by Jens Lehmann at the GitTogether in Berlin.

Signed-off-by: Johannes Schindelin &lt;johannes.schindelin@gmx.de&gt;
Signed-off-by: Jens Lehmann &lt;Jens.Lehmann@web.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>diff: Rename QUIET internal option to QUICK</title>
<updated>2009-07-29T17:22:39Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2009-05-23T08:15:35Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=90b1994170900514a1ce7a3345e25cb7216915cc'/>
<id>urn:sha1:90b1994170900514a1ce7a3345e25cb7216915cc</id>
<content type='text'>
The option "QUIET" primarily meant "find if we have _any_ difference as
quick as possible and report", which means we often do not even have to
look at blobs if we know the trees are different by looking at the higher
level (e.g. "diff-tree A B").  As a side effect, because there is no point
showing one change that we happened to have found first, it also enables
NO_OUTPUT and EXIT_WITH_STATUS options, making the end result look quiet.

Rename the internal option to QUICK to reflect this better; it also makes
grepping the source tree much easier, as there are other kinds of QUIET
option everywhere.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>diff: change semantics of "ignore whitespace" options</title>
<updated>2009-07-29T17:22:39Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2009-05-22T19:45:29Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=f245194f9a13d5108c3a59fd4ab1770ae9fd5b65'/>
<id>urn:sha1:f245194f9a13d5108c3a59fd4ab1770ae9fd5b65</id>
<content type='text'>
Traditionally, the --ignore-whitespace* options have merely meant to tell
the diff output routine that some class of differences are not worth
showing in the textual diff output, so that the end user has easier time
to review the remaining (presumably more meaningful) changes.  These
options never affected the outcome of the command, given as the exit
status when the --exit-code option was in effect (either directly or
indirectly).

When you have only whitespace changes, however, you might expect

	git diff -b --exit-code

to report that there is _no_ change with zero exit status.

Change the semantics of --ignore-whitespace* options to mean more than
"omit showing the difference in text".

The exit status, when --exit-code is in effect, is computed by checking if
we found any differences at the path level, while diff frontends feed
filepairs to the diffcore engine.  When "ignore whitespace" options are in
effect, we defer this determination until the very end of diffcore
transformation.  We simply do not know until the textual diff is
generated, which comes very late in the pipeline.

When --quiet is in effect, various diff frontends optimize by breaking out
early from the loop that enumerates the filepairs, when we find the first
path level difference; when --ignore-whitespace* is used the above change
automatically disables this optimization.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Use DIFF_XDL_SET/DIFF_OPT_SET instead of raw bit-masking</title>
<updated>2009-03-04T08:56:51Z</updated>
<author>
<name>Keith Cascio</name>
<email>keith@cs.ucla.edu</email>
</author>
<published>2009-02-17T03:26:49Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=628d5c2b707db207e47c42ca112b182aa171cfaa'/>
<id>urn:sha1:628d5c2b707db207e47c42ca112b182aa171cfaa</id>
<content type='text'>
Signed-off-by: Keith Cascio &lt;keith@cs.ucla.edu&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Generalize and libify index_is_dirty() to index_differs_from(...)</title>
<updated>2009-02-11T06:25:39Z</updated>
<author>
<name>Stephan Beyer</name>
<email>s-beyer@gmx.net</email>
</author>
<published>2009-02-10T14:30:35Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=75f3ff2eeaba820b37016f464b6d1078cb6260e2'/>
<id>urn:sha1:75f3ff2eeaba820b37016f464b6d1078cb6260e2</id>
<content type='text'>
index_is_dirty() in builtin-revert.c checks if the index is dirty.
This patch generalizes this function to check if the index differs
from a revision, i.e. the former index_is_dirty() behavior can now be
achieved by index_differs_from("HEAD", 0).

The second argument "diff_flags" allows to set further diff option
flags like DIFF_OPT_IGNORE_SUBMODULES. See DIFF_OPT_* macros in diff.h
for a list.

index_differs_from() seems to be useful for more than builtin-revert.c,
so it is moved into diff-lib.c and also used in builtin-commit.c.

Yet to mention:

 - "rev.abbrev = 0;" can be safely removed.
   This has no impact on performance or functioning of neither
   setup_revisions() nor run_diff_index().

 - rev.pending.objects is free()d because this fixes a leak.
   (Also see 295dd2ad "Fix memory leak in traverse_commit_list")

Mentored-by: Daniel Barkalow &lt;barkalow@iabervon.org&gt;
Mentored-by: Christian Couder &lt;chriscool@tuxfamily.org&gt;
Signed-off-by: Stephan Beyer &lt;s-beyer@gmx.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
