<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/diff-no-index.c, branch v2.40.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.40.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.40.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2022-12-01T23:25:29Z</updated>
<entry>
<title>diff: factor out add_diff_options()</title>
<updated>2022-12-01T23:25:29Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2022-12-01T22:49:11Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c5630c4868c74aab2fc4e8a4ef4bfc9c51534e0e'/>
<id>urn:sha1:c5630c4868c74aab2fc4e8a4ef4bfc9c51534e0e</id>
<content type='text'>
Add a function for appending the parseopts member of struct diff_options
to a struct option array.  Use it in two sites instead of accessing the
parseopts member directly.  Decoupling callers from diff internals like
that allows us to change the latter.

Signed-off-by: René Scharfe &lt;l.s.r@web.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>diff-no-index: simplify argv index calculation</title>
<updated>2022-09-07T19:36:43Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2022-09-07T11:45:42Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2b43dd0eb5f3f035b9bd9d019ec405dd55ec15e1'/>
<id>urn:sha1:2b43dd0eb5f3f035b9bd9d019ec405dd55ec15e1</id>
<content type='text'>
Since 16bb3d714d (diff --no-index: use parse_options() instead of
diff_opt_parse(), 2019-03-24) argc must be 2 if we reach the loop, i.e.
argc - 2 == 0.  Remove that inconsequential term.

Signed-off-by: René Scharfe &lt;l.s.r@web.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>diff-no-index: release prefixed filenames</title>
<updated>2022-09-07T19:34:03Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2022-09-07T11:37:02Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=07a6f94a6d06947d325881460a3798dda0a98cf8'/>
<id>urn:sha1:07a6f94a6d06947d325881460a3798dda0a98cf8</id>
<content type='text'>
Callers of prefix_filename() are responsible for freeing its result.
Remember the returned strings and release them to appease leak checkers.

Signed-off-by: René Scharfe &lt;l.s.r@web.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>diff-no-index: release strbuf on queue error</title>
<updated>2022-09-07T19:33:28Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2022-09-07T11:36:53Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=fffe7d81a402ced9ede961f55cfc617fe08e71ef'/>
<id>urn:sha1:fffe7d81a402ced9ede961f55cfc617fe08e71ef</id>
<content type='text'>
The strbuf is small and we are about to exit, so we could leave its
cleanup to the OS.  If we release it explicitly at all, however, then we
should do it on early exit as well.  Move the strbuf_release call to a
new cleanup section at the end and make sure all execution paths go
through it.

Suggested-by: Johannes Schindelin &lt;johannes.schindelin@gmx.de&gt;
Signed-off-by: René 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 'en/dir-traversal'</title>
<updated>2021-05-19T23:54:59Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2021-05-19T23:54:58Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=33be431c0c7284c1adf0fe49f7838dbc8aee6ea9'/>
<id>urn:sha1:33be431c0c7284c1adf0fe49f7838dbc8aee6ea9</id>
<content type='text'>
"git clean" and "git ls-files -i" had confusion around working on
or showing ignored paths inside an ignored directory, which has
been corrected.

* en/dir-traversal:
  dir: introduce readdir_skip_dot_and_dotdot() helper
  dir: update stale description of treat_directory()
  dir: traverse into untracked directories if they may have ignored subfiles
  dir: avoid unnecessary traversal into ignored directory
  t3001, t7300: add testcase showcasing missed directory traversal
  t7300: add testcase showing unnecessary traversal into ignored directory
  ls-files: error out on -i unless -o or -c are specified
  dir: report number of visited directories and paths with trace2
  dir: convert trace calls to trace2 equivalents
</content>
</entry>
<entry>
<title>dir: introduce readdir_skip_dot_and_dotdot() helper</title>
<updated>2021-05-12T23:45:03Z</updated>
<author>
<name>Elijah Newren</name>
<email>newren@gmail.com</email>
</author>
<published>2021-05-12T17:28:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b548f0f1568f6b01e55ca69c24d3cb19489f92aa'/>
<id>urn:sha1:b548f0f1568f6b01e55ca69c24d3cb19489f92aa</id>
<content type='text'>
Many places in the code were doing
    while ((d = readdir(dir)) != NULL) {
        if (is_dot_or_dotdot(d-&gt;d_name))
            continue;
        ...process d...
    }
Introduce a readdir_skip_dot_and_dotdot() helper to make that a one-liner:
    while ((d = readdir_skip_dot_and_dotdot(dir)) != NULL) {
        ...process d...
    }

This helper particularly simplifies checks for empty directories.

Also use this helper in read_cached_dir() so that our statistics are
consistent across platforms.  (In other words, read_cached_dir() should
have been using is_dot_or_dotdot() and skipping such entries, but did
not and left it to treat_path() to detect and mark such entries as
path_none.)

Signed-off-by: Elijah Newren &lt;newren@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>hash: provide per-algorithm null OIDs</title>
<updated>2021-04-27T07:31:39Z</updated>
<author>
<name>brian m. carlson</name>
<email>sandals@crustytoothpaste.net</email>
</author>
<published>2021-04-26T01:02:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=14228447c9ce664a4e9c31ba10344ec5e4ea4ba5'/>
<id>urn:sha1:14228447c9ce664a4e9c31ba10344ec5e4ea4ba5</id>
<content type='text'>
Up until recently, object IDs did not have an algorithm member, only a
hash.  Consequently, it was possible to share one null (all-zeros)
object ID among all hash algorithms.  Now that we're going to be
handling objects from multiple hash algorithms, it's important to make
sure that all object IDs have a correct algorithm field.

Introduce a per-algorithm null OID, and add it to struct hash_algo.
Introduce a wrapper function as well, and use it everywhere we used to
use the null_oid constant.

Signed-off-by: brian m. carlson &lt;sandals@crustytoothpaste.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'nd/diff-parseopt-4'</title>
<updated>2019-04-25T07:41:12Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2019-04-25T07:41:12Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=dcd6a8c09a36a500c4e612a52eba1c6c5e298951'/>
<id>urn:sha1:dcd6a8c09a36a500c4e612a52eba1c6c5e298951</id>
<content type='text'>
Fourth batch to teach the diff machinery to use the parse-options
API.

* nd/diff-parseopt-4:
  am: avoid diff_opt_parse()
  diff --no-index: use parse_options() instead of diff_opt_parse()
  range-diff: use parse_options() instead of diff_opt_parse()
  diff.c: allow --no-color-moved-ws
  diff-parseopt: convert --color-moved-ws
  diff-parseopt: convert --[no-]color-moved
  diff-parseopt: convert --inter-hunk-context
  diff-parseopt: convert --no-prefix
  diff-parseopt: convert --line-prefix
  diff-parseopt: convert --[src|dst]-prefix
  diff-parseopt: convert --[no-]abbrev
  diff-parseopt: convert --diff-filter
  diff-parseopt: convert --find-object
  diff-parseopt: convert -O
  diff-parseopt: convert --pickaxe-all|--pickaxe-regex
  diff-parseopt: convert -S|-G
  diff-parseopt: convert -l
  diff-parseopt: convert -z
  diff-parseopt: convert --ita-[in]visible-in-index
  diff-parseopt: convert --ws-error-highlight
</content>
</entry>
<entry>
<title>diff --no-index: use parse_options() instead of diff_opt_parse()</title>
<updated>2019-03-24T13:21:24Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2019-03-24T08:20:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=16bb3d714dcb1bf50f7f96b957c4306dc6df137e'/>
<id>urn:sha1:16bb3d714dcb1bf50f7f96b957c4306dc6df137e</id>
<content type='text'>
While at there, move exit() back to the caller. It's easier to see the
flow that way than burying it in diff-no-index.c

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>
<entry>
<title>diff: reuse diff setup for --no-index case</title>
<updated>2019-02-24T15:08:34Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2019-02-16T06:57:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=287ab28bfae14431f3f57abeb92149c460044850'/>
<id>urn:sha1:287ab28bfae14431f3f57abeb92149c460044850</id>
<content type='text'>
When "--no-index" is in effect (or implied by the arguments), git-diff
jumps early to a special code path to perform that diff. This means we
miss out on some settings like enabling --ext-diff and --textconv by
default.

Let's jump to the no-index path _after_ we've done more setup on
rev.diffopt. Since some of the options don't affect us (e.g., items
related to the index), let's re-order the setup into two blocks (see the
in-code comments).

Note that we also need to stop re-initializing the diffopt struct in
diff_no_index(). This should not be necessary, as it will already have
been initialized by cmd_diff() (and there are no other callers). That in
turn lets us drop the "repository" argument from diff_no_index (which
never made much sense, since the whole point is that you don't need a
repository).

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
