<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/diff.c, branch v2.11.4</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://www.git.shady.money/git/atom?h=v2.11.4</id>
<link rel='self' href='https://www.git.shady.money/git/atom?h=v2.11.4'/>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/'/>
<updated>2016-12-08T22:40:30Z</updated>
<entry>
<title>diff: handle --no-abbrev in no-index case</title>
<updated>2016-12-08T22:40:30Z</updated>
<author>
<name>Jack Bates</name>
<email>bk874k@nottheoilrig.com</email>
</author>
<published>2016-12-06T16:56:14Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=43d1948b7b84abc744227259dd1a3e8dfbb60358'/>
<id>urn:sha1:43d1948b7b84abc744227259dd1a3e8dfbb60358</id>
<content type='text'>
There are two different places where the --no-abbrev option is parsed,
and two different places where SHA-1s are abbreviated. We normally parse
--no-abbrev with setup_revisions(), but in the no-index case, "git diff"
calls diff_opt_parse() directly, and diff_opt_parse() didn't handle
--no-abbrev until now. (It did handle --abbrev, however.) We normally
abbreviate SHA-1s with find_unique_abbrev(), but commit 4f03666 ("diff:
handle sha1 abbreviations outside of repository, 2016-10-20) recently
introduced a special case when you run "git diff" outside of a
repository.

setup_revisions() does also call diff_opt_parse(), but not for --abbrev
or --no-abbrev, which it handles itself. setup_revisions() sets
rev_info-&gt;abbrev, and later copies that to diff_options-&gt;abbrev. It
handles --no-abbrev by setting abbrev to zero. (This change doesn't
touch that.)

Setting abbrev to zero was broken in the outside-of-a-repository special
case, which until now resulted in a truly zero-length SHA-1, rather than
taking zero to mean do not abbreviate. The only way to trigger this bug,
however, was by running "git diff --raw" without either the --abbrev or
--no-abbrev options, because 1) without --raw it doesn't respect abbrev
(which is bizarre, but has been that way forever), 2) we silently clamp
--abbrev=0 to MINIMUM_ABBREV, and 3) --no-abbrev wasn't handled until
now.

The outside-of-a-repository case is one of three no-index cases. The
other two are when one of the files you're comparing is outside of the
repository you're in, and the --no-index option.

Signed-off-by: Jack Bates &lt;jack@nottheoilrig.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'tk/diffcore-delta-remove-unused'</title>
<updated>2016-11-17T21:45:22Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2016-11-17T21:45:22Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=6d40812e4b5d2128665351f4b427c7da7c7d86d5'/>
<id>urn:sha1:6d40812e4b5d2128665351f4b427c7da7c7d86d5</id>
<content type='text'>
Code cleanup.

* tk/diffcore-delta-remove-unused:
  diffcore-delta: remove unused parameter to diffcore_count_changes()
</content>
</entry>
<entry>
<title>diffcore-delta: remove unused parameter to diffcore_count_changes()</title>
<updated>2016-11-14T17:24:04Z</updated>
<author>
<name>Tobias Klauser</name>
<email>tklauser@distanz.ch</email>
</author>
<published>2016-11-14T13:39:05Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=974e0044d65dc22e8137e93b8ea13aec23d3a5a3'/>
<id>urn:sha1:974e0044d65dc22e8137e93b8ea13aec23d3a5a3</id>
<content type='text'>
The delta_limit parameter to diffcore_count_changes() has been unused
since commit ba23bbc8e ("diffcore-delta: make change counter to byte
oriented again.", 2006-03-04).

Remove the parameter and adjust all callers.

Signed-off-by: Tobias Klauser &lt;tklauser@distanz.ch&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'nd/ita-empty-commit'</title>
<updated>2016-10-27T21:58:50Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2016-10-27T21:58:50Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=650360210afbd585f33ed622d3e700b1941b1ddb'/>
<id>urn:sha1:650360210afbd585f33ed622d3e700b1941b1ddb</id>
<content type='text'>
When new paths were added by "git add -N" to the index, it was
enough to circumvent the check by "git commit" to refrain from
making an empty commit without "--allow-empty".  The same logic
prevented "git status" to show such a path as "new file" in the
"Changes not staged for commit" section.

* nd/ita-empty-commit:
  commit: don't be fooled by ita entries when creating initial commit
  commit: fix empty commit creation when there's no changes but ita entries
  diff: add --ita-[in]visible-in-index
  diff-lib: allow ita entries treated as "not yet exist in index"
</content>
</entry>
<entry>
<title>Merge branch 'jk/no-looking-at-dotgit-outside-repo'</title>
<updated>2016-10-27T21:58:48Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2016-10-27T21:58:48Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=0d9c527d5963fca098ea4964f4129511bd5d82d8'/>
<id>urn:sha1:0d9c527d5963fca098ea4964f4129511bd5d82d8</id>
<content type='text'>
Update "git diff --no-index" codepath not to try to peek into .git/
directory that happens to be under the current directory, when we
know we are operating outside any repository.

* jk/no-looking-at-dotgit-outside-repo:
  diff: handle sha1 abbreviations outside of repository
  diff_aligned_abbrev: use "struct oid"
  diff_unique_abbrev: rename to diff_aligned_abbrev
  find_unique_abbrev: use 4-buffer ring
  test-*-cache-tree: setup git dir
  read info/{attributes,exclude} only when in repository
</content>
</entry>
<entry>
<title>Merge branch 'lt/abbrev-auto'</title>
<updated>2016-10-27T21:58:47Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2016-10-27T21:58:47Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=580d820ece78100c5e2b8b5874d7aed5d76715f2'/>
<id>urn:sha1:580d820ece78100c5e2b8b5874d7aed5d76715f2</id>
<content type='text'>
Allow the default abbreviation length, which has historically been
7, to scale as the repository grows.  The logic suggests to use 12
hexdigits for the Linux kernel, and 9 to 10 for Git itself.

* lt/abbrev-auto:
  abbrev: auto size the default abbreviation
  abbrev: prepare for new world order
  abbrev: add FALLBACK_DEFAULT_ABBREV to prepare for auto sizing
</content>
</entry>
<entry>
<title>diff: handle sha1 abbreviations outside of repository</title>
<updated>2016-10-26T20:30:51Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2016-10-20T06:21:25Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=4f03666ac69ec4799998f010d04916c12e38edf8'/>
<id>urn:sha1:4f03666ac69ec4799998f010d04916c12e38edf8</id>
<content type='text'>
When generating diffs outside a repository (e.g., with "diff
--no-index"), we may write abbreviated sha1s as part of
"--raw" output or the "index" lines of "--patch" output.
Since we have no object database, we never find any
collisions, and these sha1s get whatever static abbreviation
length is configured (typically 7).

However, we do blindly look in ".git/objects" to see if any
objects exist, even though we know we are not in a
repository. This is usually harmless because such a
directory is unlikely to exist, but could be wrong in rare
circumstances.

Let's instead notice when we are not in a repository and
behave as if the object database is empty (i.e., just use
the default abbrev length). It would perhaps make sense to
be conservative and show full sha1s in that case, but
showing the default abbreviation is what we've always done
(and is certainly less ugly).

Note that this does mean that:

  cd /not/a/repo
  GIT_OBJECT_DIRECTORY=/some/real/objdir git diff --no-index ...

used to look for collisions in /some/real/objdir but now
does not. This could be considered either a bugfix (we do
not look at objects if we have no repository) or a
regression, but it seems unlikely that anybody would care
much either way.

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>diff_aligned_abbrev: use "struct oid"</title>
<updated>2016-10-26T20:30:51Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2016-10-20T06:20:07Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=d6cece51b83db5d8a523c4ba857013c4242e310e'/>
<id>urn:sha1:d6cece51b83db5d8a523c4ba857013c4242e310e</id>
<content type='text'>
Since we're modifying this function anyway, it's a good time
to update it to the more modern "struct oid". We can also
drop some of the magic numbers in favor of GIT_SHA1_HEXSZ,
along with some descriptive comments.

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>diff_unique_abbrev: rename to diff_aligned_abbrev</title>
<updated>2016-10-26T20:30:51Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2016-10-20T06:19:43Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=d5e3b01e5bd6b06c06dbd5d1e2257d57e6b1deb7'/>
<id>urn:sha1:d5e3b01e5bd6b06c06dbd5d1e2257d57e6b1deb7</id>
<content type='text'>
The word "align" describes how the function actually differs
from find_unique_abbrev, and will make it less confusing
when we add more diff-specific abbrevation functions that do
not do this alignment.

Since this is a globally available function, let's also move
its descriptive comment to the header file, where we
typically document function interfaces.

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 'va/i18n'</title>
<updated>2016-10-26T20:14:47Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2016-10-26T20:14:47Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=a5ed26702b438de0ca90d11bd314596773f3c4aa'/>
<id>urn:sha1:a5ed26702b438de0ca90d11bd314596773f3c4aa</id>
<content type='text'>
More i18n.

* va/i18n:
  i18n: diff: mark warnings for translation
  i18n: credential-cache--daemon: mark advice for translation
  i18n: convert mark error messages for translation
  i18n: apply: mark error message for translation
  i18n: apply: mark error messages for translation
  i18n: apply: mark info messages for translation
  i18n: apply: mark plural string for translation
</content>
</entry>
</feed>
