<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/xdiff, branch v2.7.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.7.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.7.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2016-01-27T18:21:53Z</updated>
<entry>
<title>merge-file: ensure that conflict sections match eol style</title>
<updated>2016-01-27T18:21:53Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>johannes.schindelin@gmx.de</email>
</author>
<published>2016-01-27T16:37:40Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=15980deab9f41324aba5cc9536e463d204bafe63'/>
<id>urn:sha1:15980deab9f41324aba5cc9536e463d204bafe63</id>
<content type='text'>
In the previous patch, we made sure that the conflict markers themselves
match the end-of-line style of the input files. However, this still left
out the conflicting text itself: if it lacks a trailing newline, we
add one, and should add a carriage return when appropriate, too.

Signed-off-by: Johannes Schindelin &lt;johannes.schindelin@gmx.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>merge-file: let conflict markers match end-of-line style of the context</title>
<updated>2016-01-27T18:21:26Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>johannes.schindelin@gmx.de</email>
</author>
<published>2016-01-27T16:37:36Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=86efa215276aaeaef0c556c73f1993b6f36dcf91'/>
<id>urn:sha1:86efa215276aaeaef0c556c73f1993b6f36dcf91</id>
<content type='text'>
When merging files with CR/LF line endings, the conflict markers should
match those, lest the output file has mixed line endings.

This is particularly of interest on Windows, where some editors get
*really* confused by mixed line endings.

The original version of this patch by Beat Bolli respected core.eol, and
a subsequent improvement by this developer also respected gitattributes.
This approach was suboptimal, though: `git merge-file` was invented as a
drop-in replacement for GNU merge and as such has no problem operating
outside of any repository at all!

Another problem with the original approach was pointed out by Junio
Hamano: legacy repositories might have their text files committed using
CR/LF line endings (and core.eol and the gitattributes would give us a
false impression there). Therefore, the much superior approach is to
simply match the context's line endings, if any.

We actually do not have to look at the *entire* context at all: if the
files are all LF-only, or if they all have CR/LF line endings, it is
sufficient to look at just a *single* line to match that style. And if
the line endings are mixed anyway, it is *still* okay to imitate just a
single line's eol: we will just add to the pile of mixed line endings,
and there is nothing we can do about that.

So what we do is: we look at the line preceding the conflict, falling
back to the line preceding that in case it was the last line and had no
line ending, falling back to the first line, first in the first
post-image, then the second post-image, and finally the pre-image.
If we find consistent CR/LF (or undecided) end-of-line style, we match
that, otherwise we use LF-only line endings for the conflict markers.

Note that while it is true that there have to be at least two lines we
can look at (otherwise there would be no conflict), the same is not true
for line *endings*: the three files in question could all consist of a
single line without any line ending, each. In this case we fall back to
using LF-only.

Signed-off-by: Johannes Schindelin &lt;johannes.schindelin@gmx.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>git-merge-file: do not add LF at EOF while applying unrelated change</title>
<updated>2014-06-30T21:07:58Z</updated>
<author>
<name>Max Kirillov</name>
<email>max@max630.net</email>
</author>
<published>2014-06-28T22:04:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ba311807f8408761a48d4cd596259ca30a4375f2'/>
<id>urn:sha1:ba311807f8408761a48d4cd596259ca30a4375f2</id>
<content type='text'>
If 'current-file' does not contain LF at EOF, and change between
'base-file' and 'other-file' does not change any line close to EOF, the
3-way merge should not add LF to EOF.  This is what 'diff3 -m' does, and
seems to be a reasonable expectation.

The change which introduced the behavior is cd1d61c44f. It always calls
function xdl_recs_copy() for sides with add_nl == 1. In fact, it looks
like the only case when this is needed is when 2 files are being
union-merged, and they do not have LF at EOF (strictly speaking, the
first of them).

Add tests:
* "merge without conflict (missing LF at EOF, away from change in the
other file)" and "merge does not add LF away of change", to demonstrate
the changed behavior.
* "conflict at EOF without LF resolved by --union", to verify that the
union-merge at the end inerts newline between versions.
* some more tests which I felt like not covering the functionality well

Signed-off-by: Max Kirillov &lt;max@max630.net&gt;
Acked-by: Johannes Schindelin &lt;johannes.schindelin@gmx.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>C: have space around &amp;&amp; and || operators</title>
<updated>2013-10-16T17:26:39Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2013-10-16T17:26:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c01499ef6933bd0e3fc65277559dc80f13d6a49e'/>
<id>urn:sha1:c01499ef6933bd0e3fc65277559dc80f13d6a49e</id>
<content type='text'>
Correct all hits from

    git grep -e '\(&amp;&amp;\|||\)[^ ]' -e '[^	 ]\(&amp;&amp;\|||\)' -- '*.c'

i.e. &amp;&amp; or || operators that are followed by anything but a SP,
or that follow something other than a SP or a HT, so that these
operators have a SP around it when necessary.

We usually refrain from making this kind of a tree-wide change in
order to avoid unnecessary conflicts with other "real work" patches,
but in this case, the end result does not have a potentially
cumbersome tree-wide impact, while this is a tree-wide cleanup.

Fixes to compat/regex/regcomp.c and xdiff/xemit.c are to replace a
HT immediately after &amp;&amp; with a SP.

This is based on Felipe's patch to bultin/symbolic-ref.c; I did all
the finding out what other files in the whole tree need to be fixed
and did the fix and also the log message while reviewing that single
liner, so any screw-ups in this version are mine.

Signed-off-by: Felipe Contreras &lt;felipe.contreras@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>diff: add --ignore-blank-lines option</title>
<updated>2013-06-19T22:17:45Z</updated>
<author>
<name>Antoine Pelisse</name>
<email>apelisse@gmail.com</email>
</author>
<published>2013-06-19T18:46:07Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=36617af7ed594d1928554356d809bd611c642dd2'/>
<id>urn:sha1:36617af7ed594d1928554356d809bd611c642dd2</id>
<content type='text'>
The goal of the patch is to introduce the GNU diff
-B/--ignore-blank-lines as closely as possible. The short option is not
available because it's already used for "break-rewrites".

When this option is used, git-diff will not create hunks that simply
add or remove empty lines, but will still show empty lines
addition/suppression if they are close enough to "valuable" changes.

There are two differences between this option and GNU diff -B option:
- GNU diff doesn't have "--inter-hunk-context", so this must be handled
- The following sequence looks like a bug (context is displayed twice):

    $ seq 5 &gt;file1
    $ cat &lt;&lt;EOF &gt;file2
    change
    1
    2

    3
    4
    5
    change
    EOF
    $ diff -u -B file1 file2
    --- file1	2013-06-08 22:13:04.471517834 +0200
    +++ file2	2013-06-08 22:13:23.275517855 +0200
    @@ -1,5 +1,7 @@
    +change
     1
     2
    +
     3
     4
     5
    @@ -3,3 +5,4 @@
     3
     4
     5
    +change

So here is a more thorough description of the option:
- real changes are interesting
- blank lines that are close enough (less than context size) to
interesting changes are considered interesting (recursive definition)
- "context" lines are used around each hunk of interesting changes
- If two hunks are separated by less than "inter-hunk-context", they
will be merged into one.

The implementation does the "interesting changes selection" in a single
pass.

Signed-off-by: Antoine Pelisse &lt;apelisse@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Correct common spelling mistakes in comments and tests</title>
<updated>2013-04-12T20:38:40Z</updated>
<author>
<name>Stefano Lattarini</name>
<email>stefano.lattarini@gmail.com</email>
</author>
<published>2013-04-11T22:36:10Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=41ccfdd9c931ee71b09f38f4eb19cf44a8e4381d'/>
<id>urn:sha1:41ccfdd9c931ee71b09f38f4eb19cf44a8e4381d</id>
<content type='text'>
Most of these were found using Lucas De Marchi's codespell tool.

Signed-off-by: Stefano Lattarini &lt;stefano.lattarini@gmail.com&gt;
Signed-off-by: Jonathan Nieder &lt;jrnieder@gmail.com&gt;
Acked-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 'rs/xdiff-fast-hash-fix'</title>
<updated>2012-05-25T19:05:02Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2012-05-25T19:05:02Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=0bc8bea2b4d73b20ce418b88300f498396d0a924'/>
<id>urn:sha1:0bc8bea2b4d73b20ce418b88300f498396d0a924</id>
<content type='text'>
Fixes compilation issue on 32-bit in an earlier series.
</content>
</entry>
<entry>
<title>xdiff: import new 32-bit version of count_masked_bytes()</title>
<updated>2012-05-23T16:10:17Z</updated>
<author>
<name>René Scharfe</name>
<email>rene.scharfe@lsrfire.ath.cx</email>
</author>
<published>2012-05-22T20:36:57Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=8072766cc6756e9218ea7c9433b097b696329407'/>
<id>urn:sha1:8072766cc6756e9218ea7c9433b097b696329407</id>
<content type='text'>
Import the latest 32-bit implementation of count_masked_bytes() from
Linux (arch/x86/include/asm/word-at-a-time.h).  It's shorter and avoids
overflows and negative numbers.

This fixes test failures on 32-bit, where negative partial results had
been shifted right using the "wrong" method (logical shift right instead
of arithmetic short right).  The compiler is free to chose the method,
so it was only wrong in the sense that it didn't work as intended by us.

Reported-by: Øyvind A. Holm &lt;sunny@sunbase.org&gt;
Signed-off-by: Rene Scharfe &lt;rene.scharfe@lsrfire.ath.cx&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>xdiff: avoid more compiler warnings with XDL_FAST_HASH on 32-bit machines</title>
<updated>2012-05-23T16:10:03Z</updated>
<author>
<name>René Scharfe</name>
<email>rene.scharfe@lsrfire.ath.cx</email>
</author>
<published>2012-05-22T20:36:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=7e356a979459092d10450e66d8512381e89c2570'/>
<id>urn:sha1:7e356a979459092d10450e66d8512381e89c2570</id>
<content type='text'>
Hide literals that can cause compiler warnings for 32-bit architectures in
expressions that evaluate to small numbers there.  Some compilers warn that
0x0001020304050608 won't fit into a 32-bit long, others that shifting right
by 56 bits clears a 32-bit value completely.

The correct values are calculated in the 64-bit case, which is all that matters
in this if-branch.

Reported-by: Øyvind A. Holm &lt;sunny@sunbase.org&gt;
Signed-off-by: Rene Scharfe &lt;rene.scharfe@lsrfire.ath.cx&gt;
Acked-by: Thomas Rast &lt;trast@student.ethz.ch&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>xdiff: avoid compiler warnings with XDL_FAST_HASH on 32-bit machines</title>
<updated>2012-05-22T21:39:49Z</updated>
<author>
<name>René Scharfe</name>
<email>rene.scharfe@lsrfire.ath.cx</email>
</author>
<published>2012-05-22T20:36:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=9322ce21eeb4ad92d0cdd37d0d62a69368042fec'/>
<id>urn:sha1:9322ce21eeb4ad92d0cdd37d0d62a69368042fec</id>
<content type='text'>
Import macro REPEAT_BYTE from Linux (arch/x86/include/asm/word-at-a-time.h)
to avoid 64-bit integer literals, which cause some 32-bit compilers to
print warnings.

Reported-by: Øyvind A. Holm &lt;sunny@sunbase.org&gt;
Signed-off-by: Rene Scharfe &lt;rene.scharfe@lsrfire.ath.cx&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
