<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/builtin/diff.c, branch v2.12.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.12.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.12.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2017-01-30T22:17:00Z</updated>
<entry>
<title>use SWAP macro</title>
<updated>2017-01-30T22:17:00Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2017-01-28T21:40:58Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=35d803bc9a0d21c36b1381f6e42455beeb73b715'/>
<id>urn:sha1:35d803bc9a0d21c36b1381f6e42455beeb73b715</id>
<content type='text'>
Apply the semantic patch swap.cocci to convert hand-rolled swaps to use
the macro SWAP.  The resulting code is shorter and easier to read, the
object code is effectively unchanged.

The patch for object.c had to be hand-edited in order to preserve the
comment before the change; Coccinelle tried to eat it for some reason.

Signed-off-by: Rene Scharfe &lt;l.s.r@web.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'jk/setup-sequence-update'</title>
<updated>2016-09-21T22:15:24Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2016-09-21T22:15:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d845d727cb1935202b61a3b7b6c8cfa7c09bd204'/>
<id>urn:sha1:d845d727cb1935202b61a3b7b6c8cfa7c09bd204</id>
<content type='text'>
There were numerous corner cases in which the configuration files
are read and used or not read at all depending on the directory a
Git command was run, leading to inconsistent behaviour.  The code
to set-up repository access at the beginning of a Git process has
been updated to fix them.

* jk/setup-sequence-update:
  t1007: factor out repeated setup
  init: reset cached config when entering new repo
  init: expand comments explaining config trickery
  config: only read .git/config from configured repos
  test-config: setup git directory
  t1302: use "git -C"
  pager: handle early config
  pager: use callbacks instead of configset
  pager: make pager_program a file-local static
  pager: stop loading git_default_config()
  pager: remove obsolete comment
  diff: always try to set up the repository
  diff: handle --no-index prefixes consistently
  diff: skip implicit no-index check when given --no-index
  patch-id: use RUN_SETUP_GENTLY
  hash-object: always try to set up the git repository
</content>
</entry>
<entry>
<title>diff: always try to set up the repository</title>
<updated>2016-09-13T22:45:45Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2016-09-13T03:23:36Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=28a4e580218b79dd5a7d55c2a30431469129321d'/>
<id>urn:sha1:28a4e580218b79dd5a7d55c2a30431469129321d</id>
<content type='text'>
If we see an explicit "--no-index", we do not bother calling
setup_git_directory_gently() at all. This means that we may
miss out on reading repo-specific config.

It's arguable whether this is correct or not. If we were
designing from scratch, making "git diff --no-index"
completely ignore the repository makes some sense. But we
are nowhere near scratch, so let's look at the existing
behavior:

  1. If you're in the top-level of a repository and run an
     explicit "diff --no-index", the config subsystem falls
     back to reading ".git/config", and we will respect repo
     config.

  2. If you're in a subdirectory of a repository, then we
     still try to read ".git/config", but it generally
     doesn't exist. So "diff --no-index" there does not
     respect repo config.

  3. If you have $GIT_DIR set in the environment, we read
     and respect $GIT_DIR/config,

  4. If you run "git diff /tmp/foo /tmp/bar" to get an
     implicit no-index, we _do_ run the repository setup,
     and set $GIT_DIR (or respect an existing $GIT_DIR
     variable). We find the repo config no matter where we
     started, and respect it.

So we already respect the repository config in a number of
common cases, and case (2) is the only one that does not.
And at least one of our tests, t4034, depends on case (1)
behaving as it does now (though it is just incidental, not
an explicit test for this behavior).

So let's bring case (2) in line with the others by always
running the repository setup, even with an explicit
"--no-index". We shouldn't need to change anything else, as the
implicit case already handles the prefix.

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: skip implicit no-index check when given --no-index</title>
<updated>2016-09-13T22:45:45Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2016-09-13T03:23:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=475b362c2a326ddc9987ee0ff6448e795f009d5d'/>
<id>urn:sha1:475b362c2a326ddc9987ee0ff6448e795f009d5d</id>
<content type='text'>
We can invoke no-index mode in two ways: by an explicit
request from the user, or implicitly by noticing that we
have two paths, and at least one is outside the repository.

If the user already told us --no-index, there is no need for
us to do the implicit test at all.  However, we currently
do, and downgrade our "explicit" to DIFF_NO_INDEX_IMPLICIT.

This doesn't have any user-visible behavior, though it's not
immediately obvious why. We only trigger the implicit check
when we have exactly two non-option arguments. And the only
code that cares about implicit versus explicit is an error
message that we show when we _don't_ have two non-option
arguments.

However, it's worth fixing anyway. Besides being slightly
more efficient, it makes the code easier to follow, which
will help when we modify it in future patches.

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 'ar/diff-args-osx-precompose' into maint</title>
<updated>2016-06-06T21:27:35Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2016-06-06T21:27:35Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=05781d37fa43b5dada77d1bcfd4cdc42742e7421'/>
<id>urn:sha1:05781d37fa43b5dada77d1bcfd4cdc42742e7421</id>
<content type='text'>
Many commands normalize command line arguments from NFD to NFC
variant of UTF-8 on OSX, but commands in the "diff" family did
not, causing "git diff $path" to complain that no such path is
known to Git.  They have been taught to do the normalization.

* ar/diff-args-osx-precompose:
  diff: run arguments through precompose_argv
</content>
</entry>
<entry>
<title>Merge branch 'ar/diff-args-osx-precompose'</title>
<updated>2016-05-23T21:54:35Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2016-05-23T21:54:35Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=53c4b3ed0e4c43fcd95473733b61e560ee21b4bc'/>
<id>urn:sha1:53c4b3ed0e4c43fcd95473733b61e560ee21b4bc</id>
<content type='text'>
Many commands normalize command line arguments from NFD to NFC
variant of UTF-8 on OSX, but commands in the "diff" family did
not, causing "git diff $path" to complain that no such path is
known to Git.  They have been taught to do the normalization.

* ar/diff-args-osx-precompose:
  diff: run arguments through precompose_argv
</content>
</entry>
<entry>
<title>diff: run arguments through precompose_argv</title>
<updated>2016-05-13T21:35:49Z</updated>
<author>
<name>Alexander Rinass</name>
<email>alex@fournova.com</email>
</author>
<published>2016-05-13T20:41:02Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=90a78b83e0b812d1f42501a54372720def4ddd84'/>
<id>urn:sha1:90a78b83e0b812d1f42501a54372720def4ddd84</id>
<content type='text'>
When running diff commands, a pathspec containing decomposed
unicode code points is not converted to precomposed unicode form
under Mac OS X, but we normalize the paths in the index and the
history to precomposed form on that platform.  As a result, the
pathspec would not match and no diff is shown.

Unlike many builtin commands, the "diff" family of commands do
not use parse_options(), which is how other builtin commands
indirectly call precompose_argv() to normalize argv[] into
precomposed form on Mac OSX.  Teach these commands to call
precompose_argv() themselves.

Note that precomopose_argv() normalizes not just paths but all
command line arguments, so things like "git diff -G $string"
when $string has the decomposed form would first be normalized
into the precomposed form and would stop hitting the same string
in the decomposed form in the diff output with this change.

It is not a problem per-se, as "log" family of commands already use
parse_options() and call precompose_argv()--we can think of this
change as making the "diff" family of commands behave in a similar
way as the commands in the "log" family.

Signed-off-by: Alexander Rinass &lt;alex@fournova.com&gt;
Helped-by: Torsten Bögershausen &lt;tboegi@web.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>diff: activate diff.renames by default</title>
<updated>2016-02-25T19:31:02Z</updated>
<author>
<name>Matthieu Moy</name>
<email>Matthieu.Moy@imag.fr</email>
</author>
<published>2016-02-25T08:59:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=5404c116aa921d7e2f9408e103c80b7801735d08'/>
<id>urn:sha1:5404c116aa921d7e2f9408e103c80b7801735d08</id>
<content type='text'>
Rename detection is a very convenient feature, and new users shouldn't
have to dig in the documentation to benefit from it.

Potential objections to activating rename detection are that it
sometimes fail, and it is sometimes slow. But rename detection is
already activated by default in several cases like "git status" and "git
merge", so activating diff.renames does not fundamentally change the
situation. When the rename detection fails, it now fails consistently
between "git diff" and "git status".

This setting does not affect plumbing commands, hence well-written
scripts will not be affected.

Signed-off-by: Matthieu Moy &lt;Matthieu.Moy@imag.fr&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'nd/diff-with-path-params'</title>
<updated>2016-02-03T22:16:04Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2016-02-03T22:16:04Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c167a96e68b9fb49cab7eb1f2814d7b32f7c0a1a'/>
<id>urn:sha1:c167a96e68b9fb49cab7eb1f2814d7b32f7c0a1a</id>
<content type='text'>
A few options of "git diff" did not work well when the command was
run from a subdirectory.

* nd/diff-with-path-params:
  diff: make -O and --output work in subdirectory
  diff-no-index: do not take a redundant prefix argument
</content>
</entry>
<entry>
<title>diff-no-index: do not take a redundant prefix argument</title>
<updated>2016-01-21T18:45:11Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2016-01-20T11:06:02Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e5f7a5d16f2c890e7dda96e5681ee8f6687b45e4'/>
<id>urn:sha1:e5f7a5d16f2c890e7dda96e5681ee8f6687b45e4</id>
<content type='text'>
Prefix is already set up in "revs". The same prefix should be used for
all options parsing. So kill the last argument. This patch does not
actually change anything because the only caller does use the same
prefix for init_revisions() and diff_no_index().

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>
</entry>
</feed>
