<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/builtin/commit.c, 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-11-18T09:23:53Z</updated>
<entry>
<title>Merge branch 'jk/unused-parameter-fixes'</title>
<updated>2018-11-18T09:23:53Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-11-18T09:23:53Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ab96f28ba4deb71ff64b31bd63cee96314db7112'/>
<id>urn:sha1:ab96f28ba4deb71ff64b31bd63cee96314db7112</id>
<content type='text'>
Various functions have been audited for "-Wunused-parameter" warnings
and bugs in them got fixed.

* jk/unused-parameter-fixes:
  midx: double-check large object write loop
  assert NOARG/NONEG behavior of parse-options callbacks
  parse-options: drop OPT_DATE()
  apply: return -1 from option callback instead of calling exit(1)
  cat-file: report an error on multiple --batch options
  tag: mark "--message" option with NONEG
  show-branch: mark --reflog option as NONEG
  format-patch: mark "--no-numbered" option with NONEG
  status: mark --find-renames option with NONEG
  cat-file: mark batch options with NONEG
  pack-objects: mark index-version option as NONEG
  ls-files: mark exclude options as NONEG
  am: handle --no-patch-format option
  apply: mark include/exclude options as NONEG
</content>
</entry>
<entry>
<title>assert NOARG/NONEG behavior of parse-options callbacks</title>
<updated>2018-11-06T03:56:29Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2018-11-05T06:45:42Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=517fe807d6903c629a739b23fe0e75b892096998'/>
<id>urn:sha1:517fe807d6903c629a739b23fe0e75b892096998</id>
<content type='text'>
When we define a parse-options callback, the flags we put in the option
struct must match what the callback expects. For example, a callback
which does not handle the "unset" parameter should only be used with
PARSE_OPT_NONEG. But since the callback and the option struct are not
defined next to each other, it's easy to get this wrong (as earlier
patches in this series show).

Fortunately, the compiler can help us here: compiling with
-Wunused-parameters can show us which callbacks ignore their "unset"
parameters (and likewise, ones that ignore "arg" expect to be triggered
with PARSE_OPT_NOARG).

But after we've inspected a callback and determined that all of its
callers use the right flags, what do we do next? We'd like to silence
the compiler warning, but do so in a way that will catch any wrong calls
in the future.

We can do that by actually checking those variables and asserting that
they match our expectations. Because this is such a common pattern,
we'll introduce some helper macros. The resulting messages aren't
as descriptive as we could make them, but the file/line information from
BUG() is enough to identify the problem (and anyway, the point is that
these should never be seen).

Each of the annotated callbacks in this patch triggers
-Wunused-parameters, and was manually inspected to make sure all callers
use the correct options (so none of these BUGs should be triggerable).

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>status: mark --find-renames option with NONEG</title>
<updated>2018-11-06T03:55:35Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2018-11-05T06:40:53Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d6627fb8999ac7275c1eeb42482dabd4fabfbd61'/>
<id>urn:sha1:d6627fb8999ac7275c1eeb42482dabd4fabfbd61</id>
<content type='text'>
If you run "git status --no-find-renames", it will behave the same as
"--find-renames", because we ignore the "unset" parameter (we see a NULL
"arg", but since the score argument is optional, we just think that the
user did not provide a score).

We already have a separate "--no-renames" to disable renames, so there's
not much point in supporting "--no-find-renames". Let's just flag it as
an error.

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>refresh_index: remove unnecessary calls to preload_index()</title>
<updated>2018-11-06T03:49:59Z</updated>
<author>
<name>Ben Peart</name>
<email>benpeart@microsoft.com</email>
</author>
<published>2018-11-05T19:27:51Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=6c5b7f55a845bccf7b3abda92a78c621898d838d'/>
<id>urn:sha1:6c5b7f55a845bccf7b3abda92a78c621898d838d</id>
<content type='text'>
With refresh_index() learning to utilize preload_index() to speed up its
operation there is no longer any benefit to having the caller preload the
index first. Remove those unneeded calls by calling read_index() instead of
the preload variant.

There is no measurable performance impact of this patch - the 2nd call to
preload_index() bails out quickly but there is no reason to call it twice.

Signed-off-by: Ben Peart &lt;benpeart@microsoft.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'nd/status-refresh-progress'</title>
<updated>2018-10-19T04:34:03Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-10-19T04:34:03Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=4d87b38e6c1a73dbe744a30b9b3cdf88e69de7b4'/>
<id>urn:sha1:4d87b38e6c1a73dbe744a30b9b3cdf88e69de7b4</id>
<content type='text'>
"git status" learns to show progress bar when refreshing the index
takes a long time.

* nd/status-refresh-progress:
  status: show progress bar if refreshing the index takes too long
</content>
</entry>
<entry>
<title>Merge branch 'ss/wt-status-committable'</title>
<updated>2018-10-19T04:34:02Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-10-19T04:34:02Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=929e85ade811a1adaa573f79130b35843bed805e'/>
<id>urn:sha1:929e85ade811a1adaa573f79130b35843bed805e</id>
<content type='text'>
Code clean-up in the internal machinery used by "git status" and
"git commit --dry-run".

* ss/wt-status-committable:
  roll wt_status_state into wt_status and populate in the collect phase
  wt-status.c: set the committable flag in the collect phase
  t7501: add test of "commit --dry-run --short"
  wt-status: rename commitable to committable
  wt-status.c: move has_unmerged earlier in the file
</content>
</entry>
<entry>
<title>Merge branch 'nd/the-index'</title>
<updated>2018-10-19T04:34:02Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-10-19T04:34:02Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=11877b9ebec87175a9cc55676311ef2d98585cca'/>
<id>urn:sha1:11877b9ebec87175a9cc55676311ef2d98585cca</id>
<content type='text'>
Various codepaths in the core-ish part learn to work on an
arbitrary in-core index structure, not necessarily the default
instance "the_index".

* nd/the-index: (23 commits)
  revision.c: reduce implicit dependency the_repository
  revision.c: remove implicit dependency on the_index
  ws.c: remove implicit dependency on the_index
  tree-diff.c: remove implicit dependency on the_index
  submodule.c: remove implicit dependency on the_index
  line-range.c: remove implicit dependency on the_index
  userdiff.c: remove implicit dependency on the_index
  rerere.c: remove implicit dependency on the_index
  sha1-file.c: remove implicit dependency on the_index
  patch-ids.c: remove implicit dependency on the_index
  merge.c: remove implicit dependency on the_index
  merge-blobs.c: remove implicit dependency on the_index
  ll-merge.c: remove implicit dependency on the_index
  diff-lib.c: remove implicit dependency on the_index
  read-cache.c: remove implicit dependency on the_index
  diff.c: remove implicit dependency on the_index
  grep.c: remove implicit dependency on the_index
  diff.c: remove the_index dependency in textconv() functions
  blame.c: rename "repo" argument to "r"
  combine-diff.c: remove implicit dependency on the_index
  ...
</content>
</entry>
<entry>
<title>Merge branch 'en/status-multiple-renames-to-the-same-target-fix'</title>
<updated>2018-10-16T07:16:05Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-10-16T07:16:05Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=98f3f007f520de518c732c74085234dede144926'/>
<id>urn:sha1:98f3f007f520de518c732c74085234dede144926</id>
<content type='text'>
The code in "git status" sometimes hit an assertion failure.  This
was caused by a structure that was reused without cleaning the data
used for the first run, which has been corrected.

* en/status-multiple-renames-to-the-same-target-fix:
  commit: fix erroneous BUG, 'multiple renames on the same target? how?'
</content>
</entry>
<entry>
<title>Merge branch 'ab/commit-graph-progress'</title>
<updated>2018-10-16T07:15:58Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-10-16T07:15:58Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=36d767d02e12c1ff991511b7bd8c1d023340f2ca'/>
<id>urn:sha1:36d767d02e12c1ff991511b7bd8c1d023340f2ca</id>
<content type='text'>
Generation of (experimental) commit-graph files have so far been
fairly silent, even though it takes noticeable amount of time in a
meaningfully large repository.  The users will now see progress
output.

* ab/commit-graph-progress:
  gc: fix regression in 7b0f229222 impacting --quiet
  commit-graph verify: add progress output
  commit-graph write: add progress output
</content>
</entry>
<entry>
<title>roll wt_status_state into wt_status and populate in the collect phase</title>
<updated>2018-10-04T06:38:20Z</updated>
<author>
<name>Stephen P. Smith</name>
<email>ischis2@cox.net</email>
</author>
<published>2018-09-30T14:12:45Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=73ba5d78b4e5d96b2c521e3d0a2ec86c26a2d25b'/>
<id>urn:sha1:73ba5d78b4e5d96b2c521e3d0a2ec86c26a2d25b</id>
<content type='text'>
Status variables were initialized in the collect phase and some
variables were later freed in the print functions.

A "struct wt_status" used to be sufficient for the output phase to
work.  It was designed to be filled in the collect phase and consumed
in the output phase, but over time some fields were added and output
phase started filling the fields.

A "struct wt_status_state" that was used in other codepaths turned out
to be useful in the "git status" output.  This is not tied to "struct
wt_status", so filling in the collect phase was not consistently
followed.

Move the status state structure variables into the status state
structure and populate them in the collect functions.

Create a new function to free the buffers that were being freed in the
print function.  Call this new function in commit.c where both the
collect and print functions were being called.

Based on a patch suggestion by Junio C Hamano. [1]

[1] https://public-inbox.org/git/xmqqr2i5ueg4.fsf@gitster-ct.c.googlers.com/

Signed-off-by: Stephen P. Smith &lt;ischis2@cox.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
