<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/builtin/diff.c, branch v2.30.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.30.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.30.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2020-11-02T21:17:39Z</updated>
<entry>
<title>Merge branch 'dl/diff-merge-base'</title>
<updated>2020-11-02T21:17:39Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2020-11-02T21:17:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b6fb70c985a6fc113e971a6696f328abf8315dce'/>
<id>urn:sha1:b6fb70c985a6fc113e971a6696f328abf8315dce</id>
<content type='text'>
"git diff A...B" learned "git diff --merge-base A B", which is a
longer short-hand to say the same thing.

* dl/diff-merge-base:
  contrib/completion: complete `git diff --merge-base`
  builtin/diff-tree: learn --merge-base
  builtin/diff-index: learn --merge-base
  t4068: add --merge-base tests
  diff-lib: define diff_get_merge_base()
  diff-lib: accept option flags in run_diff_index()
  contrib/completion: extract common diff/difftool options
  git-diff.txt: backtick quote command text
  git-diff-index.txt: make --cached description a proper sentence
  t4068: remove unnecessary &gt;tmp
</content>
</entry>
<entry>
<title>diff: get rid of redundant 'dense' argument</title>
<updated>2020-09-29T18:54:53Z</updated>
<author>
<name>Sergey Organov</name>
<email>sorganov@gmail.com</email>
</author>
<published>2020-09-29T11:31:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d01141de5ab02cf4a156183ef4dc5ee8bf2638a3'/>
<id>urn:sha1:d01141de5ab02cf4a156183ef4dc5ee8bf2638a3</id>
<content type='text'>
Get rid of 'dense' argument that is redundant for every function that has
'struct rev_info *rev' argument as well, as the value of 'dense' passed is
always taken from 'rev-&gt;dense_combined_merges' field.

The only place where this was not the case is in 'submodule.c' where
'diff_tree_combined_merge()' was called with '1' for 'dense' argument. However,
at that call the 'revs' instance used is local to the function, and we now just
set 'revs-&gt;dense_combined_merges' to 1 in this local instance.

Signed-off-by: Sergey Organov &lt;sorganov@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>builtin/diff-tree: learn --merge-base</title>
<updated>2020-09-21T20:37:03Z</updated>
<author>
<name>Denton Liu</name>
<email>liu.denton@gmail.com</email>
</author>
<published>2020-09-14T18:36:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3d09c22869a7bd47f1683031937af0ed93b2fa3b'/>
<id>urn:sha1:3d09c22869a7bd47f1683031937af0ed93b2fa3b</id>
<content type='text'>
The previous commit introduced ---merge-base a way to take the diff
between the working tree or index and the merge base between an arbitrary
commit and HEAD. It makes sense to extend this option to support the
case where two commits are given too and behave in a manner identical to
`git diff A...B`.

Introduce the --merge-base flag as an alternative to triple-dot
notation. Thus, we would be able to write the above as
`git diff --merge-base A B`.

Signed-off-by: Denton Liu &lt;liu.denton@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>builtin/diff-index: learn --merge-base</title>
<updated>2020-09-21T04:30:26Z</updated>
<author>
<name>Denton Liu</name>
<email>liu.denton@gmail.com</email>
</author>
<published>2020-09-20T11:22:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=0f5a1d449b9538c2765de9d6683abbb83a7fb4e2'/>
<id>urn:sha1:0f5a1d449b9538c2765de9d6683abbb83a7fb4e2</id>
<content type='text'>
There is currently no easy way to take the diff between the working tree
or index and the merge base between an arbitrary commit and HEAD. Even
diff's `...` notation doesn't allow this because it only works between
commits. However, the ability to do this would be desirable to a user
who would like to see all the changes they've made on a branch plus
uncommitted changes without taking into account changes made in the
upstream branch.

Teach diff-index and diff (with one commit) the --merge-base option
which allows a user to use the merge base of a commit and HEAD as the
"before" side.

Signed-off-by: Denton Liu &lt;liu.denton@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>diff-lib: accept option flags in run_diff_index()</title>
<updated>2020-09-21T04:30:26Z</updated>
<author>
<name>Denton Liu</name>
<email>liu.denton@gmail.com</email>
</author>
<published>2020-09-20T11:22:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=4c3fe82ef17a6636c742b95cd292b83b02876e08'/>
<id>urn:sha1:4c3fe82ef17a6636c742b95cd292b83b02876e08</id>
<content type='text'>
In a future commit, we will teach run_diff_index() to accept more
options via flag bits. For now, change `cached` into a flag in the
`option` bitfield. The behaviour should remain exactly the same.

Signed-off-by: Denton Liu &lt;liu.denton@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'ct/diff-with-merge-base-clarification' into master</title>
<updated>2020-07-09T21:00:43Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2020-07-09T21:00:43Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=46be023084bd6ce4958f16427da7cdaf91cff205'/>
<id>urn:sha1:46be023084bd6ce4958f16427da7cdaf91cff205</id>
<content type='text'>
Recent update to "git diff" meant as a code clean-up introduced a
bug in its error handling code, which has been corrected.

* ct/diff-with-merge-base-clarification:
  diff: check for merge bases before assigning sym-&gt;base
</content>
</entry>
<entry>
<title>diff: check for merge bases before assigning sym-&gt;base</title>
<updated>2020-07-08T20:57:18Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2020-07-08T04:38:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=5f46e610cb43496612d7ec030d142b6b8515399d'/>
<id>urn:sha1:5f46e610cb43496612d7ec030d142b6b8515399d</id>
<content type='text'>
In symdiff_prepare(), we iterate over the set of parsed objects to pick
out any symmetric differences, including the left, right, and base
elements. We assign the results into pointers in a "struct symdiff", and
then complain if we didn't find a base, like so:

    sym-&gt;left = rev-&gt;pending.objects[lpos].name;
    sym-&gt;right = rev-&gt;pending.objects[rpos].name;
    sym-&gt;base = rev-&gt;pending.objects[basepos].name;
    if (basecount == 0)
            die(_("%s...%s: no merge base"), sym-&gt;left, sym-&gt;right);

But the least lines are backwards. If basecount is 0, then basepos will
be -1, and we will access memory outside of the pending array. This
isn't usually that big a deal, since we don't do anything besides a
single pointer-sized read before exiting anyway, but it does violate the
C standard, and of course memory-checking tools like ASan complain.

Let's put the basecount check first. Note that we haveto split it from
the other assignments, since the die() relies on sym-&gt;left and
sym-&gt;right having been assigned (this isn't strictly necessary, but is
easier to read than dereferencing the pending array again).

Reported-by: brian m. carlson &lt;sandals@crustytoothpaste.net&gt;
Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'dl/diff-usage-comment-update'</title>
<updated>2020-06-29T21:17:25Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2020-06-29T21:17:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1ea1f93fd9c6d299cbb94f74f0a1d80cb481a449'/>
<id>urn:sha1:1ea1f93fd9c6d299cbb94f74f0a1d80cb481a449</id>
<content type='text'>
An in-code comment in "git diff" has been updated.

* dl/diff-usage-comment-update:
  builtin/diff: fix botched update of usage comment
  builtin/diff: update usage comment
</content>
</entry>
<entry>
<title>Merge branch 'ct/diff-with-merge-base-clarification'</title>
<updated>2020-06-25T19:27:46Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2020-06-25T19:27:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1457886ce2004c49661c8769f3a5246f6a340c8d'/>
<id>urn:sha1:1457886ce2004c49661c8769f3a5246f6a340c8d</id>
<content type='text'>
"git diff" used to take arguments in random and nonsense range
notation, e.g. "git diff A..B C", "git diff A..B C...D", etc.,
which has been cleaned up.

* ct/diff-with-merge-base-clarification:
  Documentation: usage for diff combined commits
  git diff: improve range handling
  t/t3430: avoid undefined git diff behavior
</content>
</entry>
<entry>
<title>builtin/diff: fix botched update of usage comment</title>
<updated>2020-06-23T23:39:41Z</updated>
<author>
<name>Denton Liu</name>
<email>liu.denton@gmail.com</email>
</author>
<published>2020-06-23T09:19:49Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c592fd4c83021b4f098012b3307298fff923c6e7'/>
<id>urn:sha1:c592fd4c83021b4f098012b3307298fff923c6e7</id>
<content type='text'>
In the previous commit, an attempt was made to correct the "N=1, M=0"
case. However, the fix was botched and it introduced two half-correct
sections by mistake. Combine these half-correct sections into one fully
correct section.

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