<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/xdiff, branch v2.7.3</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.7.3</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.7.3'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2016-03-10T19:13:49Z</updated>
<entry>
<title>Merge branch 'ps/plug-xdl-merge-leak' into maint</title>
<updated>2016-03-10T19:13:49Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2016-03-10T19:13:49Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=4da402695d2998b4735dd219b03848b47d2389cf'/>
<id>urn:sha1:4da402695d2998b4735dd219b03848b47d2389cf</id>
<content type='text'>
* ps/plug-xdl-merge-leak:
  xdiff/xmerge: fix memory leak in xdl_merge
</content>
</entry>
<entry>
<title>Merge branch 'jk/no-diff-emit-common' into maint</title>
<updated>2016-03-10T19:13:42Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2016-03-10T19:13:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=6044329cf14e922aad270778db88767e97147875'/>
<id>urn:sha1:6044329cf14e922aad270778db88767e97147875</id>
<content type='text'>
"git merge-tree" used to mishandle "both sides added" conflict with
its own "create a fake ancestor file that has the common parts of
what both sides have added and do a 3-way merge" logic; this has
been updated to use the usual "3-way merge with an empty blob as
the fake common ancestor file" approach used in the rest of the
system.

* jk/no-diff-emit-common:
  xdiff: drop XDL_EMIT_COMMON
  merge-tree: drop generate_common strategy
  merge-one-file: use empty blob for add/add base
</content>
</entry>
<entry>
<title>xdiff/xmerge: fix memory leak in xdl_merge</title>
<updated>2016-02-23T20:58:26Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2016-02-23T11:59:17Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=4867f1184c943f7738bb7b42cab2e62cf16cdb18'/>
<id>urn:sha1:4867f1184c943f7738bb7b42cab2e62cf16cdb18</id>
<content type='text'>
When building the script for the second file that is to be merged
we have already allocated memory for data structures related to
the first file. When we encounter an error in building the second
script we only free allocated memory related to the second file
before erroring out.

Fix this memory leak by also releasing allocated memory related
to the first file.

Helped-by: Johannes Schindelin &lt;Johannes.Schindelin@gmx.de&gt;
Signed-off-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>xdiff: drop XDL_EMIT_COMMON</title>
<updated>2016-02-23T06:36:09Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2016-02-23T06:07:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=907681e940d095a0ab96756a8cddfd4f63cd71e1'/>
<id>urn:sha1:907681e940d095a0ab96756a8cddfd4f63cd71e1</id>
<content type='text'>
There are no more callers that use this mode, and none
likely to be added (as our xdl_merge() eliminates the common
use of it for generating 3-way merge bases).

This is effectively a revert of a9ed376 (xdiff: generate
"anti-diffs" aka what is common to two files, 2006-06-28),
though of course trying to revert that ancient commit
directly produces many textual conflicts.

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