<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/diff-no-index.c, branch v2.6.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.6.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.6.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2015-03-26T21:08:43Z</updated>
<entry>
<title>diff-no-index: align D/F handling with that of normal Git</title>
<updated>2015-03-26T21:08:43Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-03-22T05:11:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=06151739988601b0fe6179c6c67a0031b85b536f'/>
<id>urn:sha1:06151739988601b0fe6179c6c67a0031b85b536f</id>
<content type='text'>
When a commit changes a path P that used to be a file to a directory
and creates a new path P/X in it, "git show" would say that file P
was removed and file P/X was created for such a commit.

However, if we compare two directories, D1 and D2, where D1 has a
file D1/P in it and D2 has a directory D2/P under which there is a
file D2/P/X, and ask "git diff --no-index D1 D2" to show their
differences, we simply get a refusal "file/directory conflict".

Surely, that may be what GNU diff does, but we can do better and it
is easy to do so.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>diff-no-index: DWIM "diff D F" into "diff D/F F"</title>
<updated>2015-03-26T05:39:07Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-03-25T23:11:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c9e1f2c7f2acca17c629255b96761a4a1047a28a'/>
<id>urn:sha1:c9e1f2c7f2acca17c629255b96761a4a1047a28a</id>
<content type='text'>
"git diff --no-index" was supposed to be a poor-man's approach to
allow using Git diff goodies outside of a Git repository, without
having to patch mainstream diff implementations.

Unlike a POSIX diff that treats "diff D F" (or "diff F D") as a
request to compare D/F and F (or F and D/F) when D is a directory
and F is a file, however, we did not accept such a command line and
instead barfed with "file/directory conflict".

Imitate what POSIX diff does and append the basename of the file
after the name of the directory before comparing.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'jc/fix-diff-no-index-diff-opt-parse'</title>
<updated>2014-04-03T19:38:42Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2014-04-03T19:38:42Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=7b6bc4d8350029fed82824a33ea9039f22788eec'/>
<id>urn:sha1:7b6bc4d8350029fed82824a33ea9039f22788eec</id>
<content type='text'>
"diff --no-index -Mq a b" fell into an infinite loop.

* jc/fix-diff-no-index-diff-opt-parse:
  diff-no-index: correctly diagnose error return from diff_opt_parse()
</content>
</entry>
<entry>
<title>diff-no-index: correctly diagnose error return from diff_opt_parse()</title>
<updated>2014-03-31T18:48:26Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2014-03-31T18:47:17Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ad1c3fbd26d0aae50abfb3c7d654f7229ba9370d'/>
<id>urn:sha1:ad1c3fbd26d0aae50abfb3c7d654f7229ba9370d</id>
<content type='text'>
diff_opt_parse() returns the number of options parsed, or often
returns error() which is defined to return -1.  Yes, return value of
0 is "I did not process that option at all", which should cause the
caller to say that, but negative return should not be forgotten.

This bug caused "diff --no-index" to infinitely show the same error
message because the returned value was used to decrement the loop
control variable, e.g.

        $ git diff --no-index --color=words a b
        error: option `color' expects "always", "auto", or "never"
        error: option `color' expects "always", "auto", or "never"
        ...

Instead, make it act like so:

        $ git diff --no-index --color=words a b
        error: option `color' expects "always", "auto", or "never"
        fatal: invalid diff option/value: --color=words

Reported-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'bb/diff-no-index-dotdot'</title>
<updated>2014-03-25T18:08:31Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2014-03-25T18:08:31Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=37943cc6b9a24c1636472f670aba972d12757ba7'/>
<id>urn:sha1:37943cc6b9a24c1636472f670aba972d12757ba7</id>
<content type='text'>
* bb/diff-no-index-dotdot:
  diff-no-index: replace manual "."/".." check with is_dot_or_dotdot()
  diff-no-index: rename read_directory()
</content>
</entry>
<entry>
<title>diff-no-index: replace manual "."/".." check with is_dot_or_dotdot()</title>
<updated>2014-03-19T18:49:39Z</updated>
<author>
<name>Brian Bourn</name>
<email>ba.bourn@gmail.com</email>
</author>
<published>2014-03-19T15:58:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=fd3aeeab0d41474af86e41d207196abbb7bf78f6'/>
<id>urn:sha1:fd3aeeab0d41474af86e41d207196abbb7bf78f6</id>
<content type='text'>
Helped-by: Eric Sunshine &lt;sunshine@sunshineco.com&gt;
Signed-off-by: Brian Bourn &lt;ba.bourn@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>diff-no-index: rename read_directory()</title>
<updated>2014-03-19T18:49:35Z</updated>
<author>
<name>Brian Bourn</name>
<email>ba.bourn@gmail.com</email>
</author>
<published>2014-03-19T15:58:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=9daf0ef065bfef4fb9dcc1710a39a8177695c84f'/>
<id>urn:sha1:9daf0ef065bfef4fb9dcc1710a39a8177695c84f</id>
<content type='text'>
In the next patch, we will replace a manual checking of "." or ".."
with a call to is_dot_or_dotdot() defined in dir.h.  The private
function read_directory() defined in this file will conflict with
the global function declared there when we do so.

As a preparatory step, rename the private read_directory() to avoid
the name collision.

Helped-by: Eric Sunshine &lt;sunshine@sunshineco.com&gt;
Signed-off-by: Brian Bourn &lt;ba.bourn@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'jc/hold-diff-remove-q-synonym-for-no-deletion'</title>
<updated>2014-03-07T23:17:41Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2014-03-07T23:17:40Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2687ffdeb76816a1645a5c3e3c7aaf654cc923bc'/>
<id>urn:sha1:2687ffdeb76816a1645a5c3e3c7aaf654cc923bc</id>
<content type='text'>
Remove a confusing and deprecated "-q" option from "git diff-files";
"git diff-files --diff-filter=d" can be used instead.
</content>
</entry>
<entry>
<title>diff: move no-index detection to builtin/diff.c</title>
<updated>2013-12-12T20:23:02Z</updated>
<author>
<name>Thomas Gummerer</name>
<email>t.gummerer@gmail.com</email>
</author>
<published>2013-12-11T09:58:42Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=470faf96544c1844ad775c695dfa370fe0ef3756'/>
<id>urn:sha1:470faf96544c1844ad775c695dfa370fe0ef3756</id>
<content type='text'>
Currently the --no-index option is parsed in diff_no_index().  Move the
detection if a no-index diff should be executed to builtin/diff.c, where
we can use it for executing diff_no_index() conditionally.  This will
also allow us to execute other operations conditionally, which will be
done in the next patch.

There are no functional changes.

Helped-by: Jonathan Nieder &lt;jrnieder@gmail.com&gt;
Signed-off-by: Thomas Gummerer &lt;t.gummerer@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'dw/diff-no-index-doc'</title>
<updated>2013-09-17T18:42:44Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2013-09-17T18:42:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=cd8c891b7403754cc7f4b5ace0f799adb83d3218'/>
<id>urn:sha1:cd8c891b7403754cc7f4b5ace0f799adb83d3218</id>
<content type='text'>
When the user types "git diff" outside a working tree, thinking he
is inside one, the current error message that is a single-liner
"usage: git diff --no-index &lt;path&gt; &lt;path&gt;" may not be sufficient to
make him realize the mistake. Add "Not a git repository" to the
error message when we fell into the "--no-index" mode without an
explicit command line option to instruct us to do so.

* dw/diff-no-index-doc:
  diff --no-index: describe in a separate paragraph
  diff --no-index: clarify operation when not inside a repository
</content>
</entry>
</feed>
