<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/Documentation/diff-options.txt, branch v2.20.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.20.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.20.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2018-08-15T22:08:22Z</updated>
<entry>
<title>Merge branch 'es/diff-color-moved-fix'</title>
<updated>2018-08-15T22:08:22Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-08-15T22:08:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=706b0b5e8d683b06e99bdfb2349228b360e4cf03'/>
<id>urn:sha1:706b0b5e8d683b06e99bdfb2349228b360e4cf03</id>
<content type='text'>
One of the "diff --color-moved" mode "dimmed_zebra" that was named
in an unusual way has been deprecated and replaced by
"dimmed-zebra".

* es/diff-color-moved-fix:
  diff: --color-moved: rename "dimmed_zebra" to "dimmed-zebra"
</content>
</entry>
<entry>
<title>Merge branch 'sb/diff-color-move-more'</title>
<updated>2018-08-02T22:30:40Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-08-02T22:30:40Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a81575aa91a015535374bb5b1e0e6dc2a81c74ab'/>
<id>urn:sha1:a81575aa91a015535374bb5b1e0e6dc2a81c74ab</id>
<content type='text'>
"git diff --color-moved" feature has further been tweaked.

* sb/diff-color-move-more:
  diff.c: offer config option to control ws handling in move detection
  diff.c: add white space mode to move detection that allows indent changes
  diff.c: factor advance_or_nullify out of mark_color_as_moved
  diff.c: decouple white space treatment from move detection algorithm
  diff.c: add a blocks mode for moved code detection
  diff.c: adjust hash function signature to match hashmap expectation
  diff.c: do not pass diff options as keydata to hashmap
  t4015: avoid git as a pipe input
  xdiff/xdiffi.c: remove unneeded function declarations
  xdiff/xdiff.h: remove unused flags
</content>
</entry>
<entry>
<title>diff: --color-moved: rename "dimmed_zebra" to "dimmed-zebra"</title>
<updated>2018-07-25T21:23:52Z</updated>
<author>
<name>Eric Sunshine</name>
<email>sunshine@sunshineco.com</email>
</author>
<published>2018-07-24T21:58:45Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e3f2f5f9cd9238ae106434278d325eada2719842'/>
<id>urn:sha1:e3f2f5f9cd9238ae106434278d325eada2719842</id>
<content type='text'>
The --color-moved "dimmed_zebra" mode (with an underscore) is an
anachronism. Most options and modes are hyphenated. It is more difficult
to type and somewhat more difficult to read than those which are
hyphenated. Therefore, rename it to "dimmed-zebra", and nominally
deprecate "dimmed_zebra".

Signed-off-by: Eric Sunshine &lt;sunshine@sunshineco.com&gt;
Reviewed-by: Jonathan Nieder &lt;jrnieder@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>diff.c: offer config option to control ws handling in move detection</title>
<updated>2018-07-19T19:02:54Z</updated>
<author>
<name>Stefan Beller</name>
<email>sbeller@google.com</email>
</author>
<published>2018-07-18T19:31:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=626c0b5d395196ddabcf9b9a430db385722689d4'/>
<id>urn:sha1:626c0b5d395196ddabcf9b9a430db385722689d4</id>
<content type='text'>
Signed-off-by: Stefan Beller &lt;sbeller@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>diff.c: add white space mode to move detection that allows indent changes</title>
<updated>2018-07-19T19:02:54Z</updated>
<author>
<name>Stefan Beller</name>
<email>sbeller@google.com</email>
</author>
<published>2018-07-18T19:31:55Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ca1f4ae4dfade677647928d28728a0cad125981d'/>
<id>urn:sha1:ca1f4ae4dfade677647928d28728a0cad125981d</id>
<content type='text'>
The option of --color-moved has proven to be useful as observed on the
mailing list. However when refactoring sometimes the indentation changes,
for example when partitioning a functions into smaller helper functions
the code usually mostly moved around except for a decrease in indentation.

To just review the moved code ignoring the change in indentation, a mode
to ignore spaces in the move detection as implemented in a previous patch
would be enough.  However the whole move coloring as motivated in commit
2e2d5ac (diff.c: color moved lines differently, 2017-06-30), brought
up the notion of the reviewer being able to trust the move of a "block".

As there are languages such as python, which depend on proper relative
indentation for the control flow of the program, ignoring any white space
change in a block would not uphold the promises of 2e2d5ac that allows
reviewers to pay less attention to the inside of a block, as inside
the reviewer wants to assume the same program flow.

This new mode of white space ignorance will take this into account and will
only allow the same white space changes per line in each block. This patch
even allows only for the same change at the beginning of the lines.

As this is a white space mode, it is made exclusive to other white space
modes in the move detection.

This patch brings some challenges, related to the detection of blocks.
We need a wide net to catch the possible moved lines, but then need to
narrow down to check if the blocks are still intact. Consider this
example (ignoring block sizes):

 - A
 - B
 - C
 +    A
 +    B
 +    C

At the beginning of a block when checking if there is a counterpart
for A, we have to ignore all space changes. However at the following
lines we have to check if the indent change stayed the same.

Checking if the indentation change did stay the same, is done by computing
the indentation change by the difference in line length, and then assume
the change is only in the beginning of the longer line, the common tail
is the same. That is why the test contains lines like:

 - &lt;TAB&gt; A
 ...
 + A &lt;TAB&gt;
 ...

As the first line starting a block is caught using a compare function that
ignores white spaces unlike the rest of the block, where the white space
delta is taken into account for the comparison, we also have to think about
the following situation:

 - A
 - B
 -   A
 -   B
 +    A
 +    B
 +      A
 +      B

When checking if the first A (both in the + and - lines) is a start of
a block, we have to check all 'A' and record all the white space deltas
such that we can find the example above to be just one block that is
indented.

Signed-off-by: Stefan Beller &lt;sbeller@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>diff.c: decouple white space treatment from move detection algorithm</title>
<updated>2018-07-17T18:25:31Z</updated>
<author>
<name>Stefan Beller</name>
<email>sbeller@google.com</email>
</author>
<published>2018-07-16T23:05:40Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b3095712f9d81572c3658d579e50db907b72f46d'/>
<id>urn:sha1:b3095712f9d81572c3658d579e50db907b72f46d</id>
<content type='text'>
In the original implementation of the move detection logic the choice for
ignoring white space changes is the same for the move detection as it is
for the regular diff.  Some cases came up where different treatment would
have been nice.

Allow the user to specify that white space should be ignored differently
during detection of moved lines than during generation of added and removed
lines. This is done by providing analogs to the --ignore-space-at-eol,
-b, and -w options by introducing the option --color-moved-ws=&lt;modes&gt;
with the modes named "ignore-space-at-eol", "ignore-space-change" and
"ignore-all-space", which is used only during the move detection phase.

As we change the default, we'll adjust the tests.

For now we do not infer any options to treat white spaces in the move
detection from the generic white space options given to diff.
This can be tuned later to reasonable default.

As we plan on adding more white space related options in a later patch,
that interferes with the current white space options, use a flag field
and clamp it down to  XDF_WHITESPACE_FLAGS, as that (a) allows to easily
check at parse time if we give invalid combinations and (b) can reuse
parts of this patch.

By having the white space treatment in its own option, we'll also
make it easier for a later patch to have an config option for
spaces in the move detection.

Signed-off-by: Stefan Beller &lt;sbeller@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>diff.c: add a blocks mode for moved code detection</title>
<updated>2018-07-17T18:25:31Z</updated>
<author>
<name>Stefan Beller</name>
<email>sbeller@google.com</email>
</author>
<published>2018-07-16T23:05:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=51da15eb2301667c6ac01dd18851b7a424fbf2b1'/>
<id>urn:sha1:51da15eb2301667c6ac01dd18851b7a424fbf2b1</id>
<content type='text'>
The new "blocks" mode provides a middle ground between plain and zebra.
It is as intuitive (few colors) as plain, but still has the requirement
for a minimum of lines/characters to count a block as moved.

Suggested-by: Ævar Arnfjörð Bjarmason &lt;avarab@gmail.com&gt;
 (https://public-inbox.org/git/87o9j0uljo.fsf@evledraar.gmail.com/)
Signed-off-by: Stefan Beller &lt;sbeller@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>doc: fix typos in documentation and release notes</title>
<updated>2018-06-19T16:01:12Z</updated>
<author>
<name>Karthikeyan Singaravelan</name>
<email>tir.karthi@gmail.com</email>
</author>
<published>2018-06-17T04:35:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1f2abe68d032c72d450c5afd1271953596e6258f'/>
<id>urn:sha1:1f2abe68d032c72d450c5afd1271953596e6258f</id>
<content type='text'>
Signed-off-by: Karthikeyan Singaravelan &lt;tir.karthi@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'rd/diff-options-typofix'</title>
<updated>2018-06-18T17:18:41Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-06-18T17:18:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d676cc512a7aa17f6c7db53792c1e21c4ddfea42'/>
<id>urn:sha1:d676cc512a7aa17f6c7db53792c1e21c4ddfea42</id>
<content type='text'>
Typofix.

* rd/diff-options-typofix:
  diff-options.txt: fix minor typos, font inconsistencies, in docs
</content>
</entry>
<entry>
<title>diff-options.txt: fix minor typos, font inconsistencies, in docs</title>
<updated>2018-06-11T20:11:09Z</updated>
<author>
<name>Robert P. J. Day</name>
<email>rpjday@crashcourse.ca</email>
</author>
<published>2018-06-11T13:56:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=7eedad15df615e1a2e34cb76920d5c60e9f8d8dd'/>
<id>urn:sha1:7eedad15df615e1a2e34cb76920d5c60e9f8d8dd</id>
<content type='text'>
Signed-off-by: Robert P. J. Day &lt;rpjday@crashcourse.ca&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
