<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/diff.h, branch v2.32.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.32.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.32.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2021-02-26T00:43:30Z</updated>
<entry>
<title>Merge branch 'jc/diffcore-rotate'</title>
<updated>2021-02-26T00:43:30Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2021-02-26T00:43:30Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=845d6030f81da3bb43bd24a78ef8c441a441c5d5'/>
<id>urn:sha1:845d6030f81da3bb43bd24a78ef8c441a441c5d5</id>
<content type='text'>
"git {diff,log} --{skip,rotate}-to=&lt;path&gt;" allows the user to
discard diff output for early paths or move them to the end of the
output.

* jc/diffcore-rotate:
  diff: --{rotate,skip}-to=&lt;path&gt;
</content>
</entry>
<entry>
<title>diff: --{rotate,skip}-to=&lt;path&gt;</title>
<updated>2021-02-16T17:30:42Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2021-02-11T19:57:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1eb4136ac2a24764257567b930535fcece01719f'/>
<id>urn:sha1:1eb4136ac2a24764257567b930535fcece01719f</id>
<content type='text'>
In the implementation of "git difftool", there is a case where the
user wants to start viewing the diffs at a specific path and
continue on to the rest, optionally wrapping around to the
beginning.  Since it is somewhat cumbersome to implement such a
feature as a post-processing step of "git diff" output, let's
support it internally with two new options.

 - "git diff --rotate-to=C", when the resulting patch would show
   paths A B C D E without the option, would "rotate" the paths to
   shows patch to C D E A B instead.  It is an error when there is
   no patch for C is shown.

 - "git diff --skip-to=C" would instead "skip" the paths before C,
   and shows patch to C D E.  Again, it is an error when there is no
   patch for C is shown.

 - "git log [-p]" also accepts these two options, but it is not an
   error if there is no change to the specified path.  Instead, the
   set of output paths are rotated or skipped to the specified path
   or the first path that sorts after the specified path.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>diff: add an API for deferred freeing</title>
<updated>2021-02-11T17:21:05Z</updated>
<author>
<name>Ævar Arnfjörð Bjarmason</name>
<email>avarab@gmail.com</email>
</author>
<published>2021-02-11T10:45:34Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e900d494dcff7bb9033865e61b452128ff232481'/>
<id>urn:sha1:e900d494dcff7bb9033865e61b452128ff232481</id>
<content type='text'>
Add a diff_free() function to free anything we may have allocated in
the "diff_options" struct, and the ability to make calling it a noop
by setting "no_free" in "diff_options".

This is required because when e.g. "git diff" is run we'll allocate
things in that struct, use the diff machinery once, and then exit.

But if we run e.g. "git log -p" we're going to re-use what we
allocated across multiple diff_flush() calls, and only want to free
things at the end.

We've thus ended up with features like the recently added "diff -I"[1]
where we'll leak memory. As it turns out it could have simply used the
pattern established in 6ea57703f6 (log: prepare log/log-tree to reuse
the diffopt.close_file attribute, 2016-06-22).

Manually adding more such flags to things log_tree_commit() every time
we need to allocate something would be tedious. Let's instead move
that fclose() code it to a new diff_free(), in anticipation of freeing
more things in that function in follow-up commits.

Some functions such as log_tree_commit() need an idiom of optionally
retaining a previous "no_free", as they may either free the memory
themselves, or their caller may do so. I'm keeping that idiom in
log_show_early() for good measure, even though I don't think it's
currently called in this manner. It also gets passed an existing
"struct rev_info", so future callers may want to set the "no_free"
flag.

This change is a bit hard to read because while the freeing pattern
we're introducing isn't unusual, the "file" member is a special
snowflake. We usually don't want to fclose() it. This is because
"file" is usually stdout, in which case we don't want to fclose()
it. We only want to opt-in to closing it when we e.g. open a file on
the filesystem. Thus the opt-in "close_file" flag.

So the API in general just needs a "no_free" flag to defer freeing,
but the "file" member still needs its "close_file" flag. This is made
more confusing because while refactoring this code we could replace
some "close_file=0" with "no_free=1", whereas others need to set both
flags.

This is because there were some cases where an existing "close_file=0"
meant "let's defer deallocation", and others where it meant "we don't
want to close this file handle at all".

1. 296d4a94e7 (diff: add -I&lt;regex&gt; that ignores matching changes,
   2020-10-20)

Signed-off-by: Ævar Arnfjörð Bjarmason &lt;avarab@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'sj/untracked-files-in-submodule-directory-is-not-dirty'</title>
<updated>2021-01-25T22:19:18Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2021-01-25T22:19:18Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=080627942802e767b068a491f3d349227f4e2cdc'/>
<id>urn:sha1:080627942802e767b068a491f3d349227f4e2cdc</id>
<content type='text'>
"git diff" showed a submodule working tree with untracked cruft as
"Submodule commit &lt;objectname&gt;-dirty", but a natural expectation is
that the "-dirty" indicator would align with "git describe --dirty",
which does not consider having untracked files in the working tree
as source of dirtiness.  The inconsistency has been fixed.

* sj/untracked-files-in-submodule-directory-is-not-dirty:
  diff: do not show submodule with untracked files as "-dirty"
</content>
</entry>
<entry>
<title>diff: do not show submodule with untracked files as "-dirty"</title>
<updated>2020-12-08T22:27:35Z</updated>
<author>
<name>Sangeeta Jain</name>
<email>sangunb09@gmail.com</email>
</author>
<published>2020-11-10T08:39:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=8ef93124645f89c45c9ec3edd3b268b38154061a'/>
<id>urn:sha1:8ef93124645f89c45c9ec3edd3b268b38154061a</id>
<content type='text'>
Git diff reports a submodule directory as -dirty even when there are
only untracked files in the submodule directory. This is inconsistent
with what `git describe --dirty` says when run in the submodule
directory in that state.

Make `--ignore-submodules=untracked` the default for `git diff` when
there is no configuration variable or command line option, so that the
command would not give '-dirty' suffix to a submodule whose working
tree has untracked files, to make it consistent with `git
describe --dirty` that is run in the submodule working tree.

And also make `--ignore-submodules=none` the default for `git status`
so that the user doesn't end up deleting a submodule that has
uncommitted (untracked) files.

Signed-off-by: Sangeeta Jain &lt;sangunb09@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'mk/diff-ignore-regex'</title>
<updated>2020-11-02T21:17:44Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2020-11-02T21:17:43Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1ae0949a036864de1f5caa7b375b875284d1c69e'/>
<id>urn:sha1:1ae0949a036864de1f5caa7b375b875284d1c69e</id>
<content type='text'>
"git diff" family of commands learned the "-I&lt;regex&gt;" option to
ignore hunks whose changed lines all match the given pattern.

* mk/diff-ignore-regex:
  diff: add -I&lt;regex&gt; that ignores matching changes
  merge-base, xdiff: zero out xpparam_t structures
</content>
</entry>
<entry>
<title>Merge branch 'dl/diff-merge-base'</title>
<updated>2020-11-02T21:17:39Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2020-11-02T21:17:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b6fb70c985a6fc113e971a6696f328abf8315dce'/>
<id>urn:sha1:b6fb70c985a6fc113e971a6696f328abf8315dce</id>
<content type='text'>
"git diff A...B" learned "git diff --merge-base A B", which is a
longer short-hand to say the same thing.

* dl/diff-merge-base:
  contrib/completion: complete `git diff --merge-base`
  builtin/diff-tree: learn --merge-base
  builtin/diff-index: learn --merge-base
  t4068: add --merge-base tests
  diff-lib: define diff_get_merge_base()
  diff-lib: accept option flags in run_diff_index()
  contrib/completion: extract common diff/difftool options
  git-diff.txt: backtick quote command text
  git-diff-index.txt: make --cached description a proper sentence
  t4068: remove unnecessary &gt;tmp
</content>
</entry>
<entry>
<title>diff: add -I&lt;regex&gt; that ignores matching changes</title>
<updated>2020-10-20T19:53:26Z</updated>
<author>
<name>Michał Kępień</name>
<email>michal@isc.org</email>
</author>
<published>2020-10-20T06:48:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=296d4a94e7231a1d57356889f51bff57a1a3c5a1'/>
<id>urn:sha1:296d4a94e7231a1d57356889f51bff57a1a3c5a1</id>
<content type='text'>
Add a new diff option that enables ignoring changes whose all lines
(changed, removed, and added) match a given regular expression.  This is
similar to the -I/--ignore-matching-lines option in standalone diff
utilities and can be used e.g. to ignore changes which only affect code
comments or to look for unrelated changes in commits containing a large
number of automatically applied modifications (e.g. a tree-wide string
replacement).  The difference between -G/-S and the new -I option is
that the latter filters output on a per-change basis.

Use the 'ignore' field of xdchange_t for marking a change as ignored or
not.  Since the same field is used by --ignore-blank-lines, identical
hunk emitting rules apply for --ignore-blank-lines and -I.  These two
options can also be used together in the same git invocation (they are
complementary to each other).

Rename xdl_mark_ignorable() to xdl_mark_ignorable_lines(), to indicate
that it is logically a "sibling" of xdl_mark_ignorable_regex() rather
than its "parent".

Signed-off-by: Michał Kępień &lt;michal@isc.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'so/combine-diff-simplify'</title>
<updated>2020-10-05T21:01:51Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2020-10-05T21:01:51Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=34415c76c8f67c8692090ef4911d1626689e8f38'/>
<id>urn:sha1:34415c76c8f67c8692090ef4911d1626689e8f38</id>
<content type='text'>
Code simplification.

* so/combine-diff-simplify:
  diff: get rid of redundant 'dense' argument
</content>
</entry>
<entry>
<title>Merge branch 'tb/bloom-improvements'</title>
<updated>2020-09-29T21:01:20Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2020-09-29T21:01:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=288ed98bf768f4df9b569d51a52c233a1402c0f5'/>
<id>urn:sha1:288ed98bf768f4df9b569d51a52c233a1402c0f5</id>
<content type='text'>
"git commit-graph write" learned to limit the number of bloom
filters that are computed from scratch with the --max-new-filters
option.

* tb/bloom-improvements:
  commit-graph: introduce 'commitGraph.maxNewFilters'
  builtin/commit-graph.c: introduce '--max-new-filters=&lt;n&gt;'
  commit-graph: rename 'split_commit_graph_opts'
  bloom: encode out-of-bounds filters as non-empty
  bloom/diff: properly short-circuit on max_changes
  bloom: use provided 'struct bloom_filter_settings'
  bloom: split 'get_bloom_filter()' in two
  commit-graph.c: store maximum changed paths
  commit-graph: respect 'commitGraph.readChangedPaths'
  t/helper/test-read-graph.c: prepare repo settings
  commit-graph: pass a 'struct repository *' in more places
  t4216: use an '&amp;&amp;'-chain
  commit-graph: introduce 'get_bloom_filter_settings()'
</content>
</entry>
</feed>
