<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/builtin/commit.c, branch v2.33.6</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.33.6</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.33.6'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2021-08-15T16:44:08Z</updated>
<entry>
<title>commit: restore --edit when combined with --fixup</title>
<updated>2021-08-15T16:44:08Z</updated>
<author>
<name>Joel Klinghed</name>
<email>the_jk@spawned.biz</email>
</author>
<published>2021-08-14T21:40:30Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=8ef6aad664715c16caf6e36a7f6b174a06574477'/>
<id>urn:sha1:8ef6aad664715c16caf6e36a7f6b174a06574477</id>
<content type='text'>
Recent changes to --fixup, adding amend suboption, caused the
--edit flag to be ignored as use_editor was always set to zero.

Restore edit_flag having higher priority than fixup_message when
deciding the value of use_editor by moving the edit flag condition
later in the method.

Signed-off-by: Joel Klinghed &lt;the_jk@spawned.biz&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'ds/commit-and-checkout-with-sparse-index'</title>
<updated>2021-08-04T20:28:53Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2021-08-04T20:28:53Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=506d2a354a9b24c531634094292b11ed8b8c2514'/>
<id>urn:sha1:506d2a354a9b24c531634094292b11ed8b8c2514</id>
<content type='text'>
"git checkout" and "git commit" learn to work without unnecessarily
expanding sparse indexes.

* ds/commit-and-checkout-with-sparse-index:
  unpack-trees: resolve sparse-directory/file conflicts
  t1092: document bad 'git checkout' behavior
  checkout: stop expanding sparse indexes
  sparse-index: recompute cache-tree
  commit: integrate with sparse-index
  p2000: compress repo names
  p2000: add 'git checkout -' test and decrease depth
</content>
</entry>
<entry>
<title>Merge branch 'ds/status-with-sparse-index'</title>
<updated>2021-07-28T20:18:02Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2021-07-28T20:18:01Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b271a3034fc54a7c84ae5803d72f14a29b172c78'/>
<id>urn:sha1:b271a3034fc54a7c84ae5803d72f14a29b172c78</id>
<content type='text'>
"git status" codepath learned to work with sparsely populated index
without hydrating it fully.

* ds/status-with-sparse-index:
  t1092: document bad sparse-checkout behavior
  fsmonitor: integrate with sparse index
  wt-status: expand added sparse directory entries
  status: use sparse-index throughout
  status: skip sparse-checkout percentage with sparse-index
  diff-lib: handle index diffs with sparse dirs
  dir.c: accept a directory as part of cone-mode patterns
  unpack-trees: unpack sparse directory entries
  unpack-trees: rename unpack_nondirectories()
  unpack-trees: compare sparse directories correctly
  unpack-trees: preserve cache_bottom
  t1092: add tests for status/add and sparse files
  t1092: expand repository data shape
  t1092: replace incorrect 'echo' with 'cat'
  sparse-index: include EXTENDED flag when expanding
  sparse-index: skip indexes with unmerged entries
</content>
</entry>
<entry>
<title>commit: integrate with sparse-index</title>
<updated>2021-07-14T22:05:53Z</updated>
<author>
<name>Derrick Stolee</name>
<email>dstolee@microsoft.com</email>
</author>
<published>2021-06-29T02:13:04Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=daa1acefc55bb6492c00519634e0a7622b3b6d69'/>
<id>urn:sha1:daa1acefc55bb6492c00519634e0a7622b3b6d69</id>
<content type='text'>
Update 'git commit' to allow using the sparse-index in memory without
expanding to a full one. The only place that had an ensure_full_index()
call was in cache_tree_update(). The recursive algorithm for
update_one() was already updated in 2de37c536 (cache-tree: integrate
with sparse directory entries, 2021-03-03) to handle sparse directory
entries in the index.

Most of this change involves testing different command-line options that
allow specifying which on-disk changes should be included in the commit.
This includes no options (only take currently-staged changes), -a (take
all tracked changes), and --include (take a list of specific changes).
To simplify testing that these options do not expand the index, update
the test that previously verified that 'git status' does not expand the
index with a helper method, ensure_not_expanded().

This allows 'git commit' to operate much faster when the sparse-checkout
cone is much smaller than the full list of files at HEAD.

Here are the relevant lines from p2000-sparse-operations.sh:

Test                                      HEAD~1           HEAD
----------------------------------------------------------------------------------
2000.14: git commit -a -m A (full-v3)     0.35(0.26+0.06)  0.36(0.28+0.07) +2.9%
2000.15: git commit -a -m A (full-v4)     0.32(0.26+0.05)  0.34(0.28+0.06) +6.3%
2000.16: git commit -a -m A (sparse-v3)   0.63(0.59+0.06)  0.04(0.05+0.05) -93.7%
2000.17: git commit -a -m A (sparse-v4)   0.64(0.59+0.08)  0.04(0.04+0.04) -93.8%

It is important to compare the full-index case to the sparse-index case,
so the improvement for index version v4 is actually an 88% improvement in
this synthetic example.

In a real repository with over two million files at HEAD and 60,000
files in the sparse-checkout definition, the time for 'git commit -a'
went from 2.61 seconds to 134ms. I compared this to the result if the
index only contained the paths in the sparse-checkout definition and
found the theoretical optimum to be 120ms, so the out-of-cone paths only
add a 12% overhead.

Signed-off-by: Derrick Stolee &lt;dstolee@microsoft.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>status: use sparse-index throughout</title>
<updated>2021-07-14T20:42:49Z</updated>
<author>
<name>Derrick Stolee</name>
<email>dstolee@microsoft.com</email>
</author>
<published>2021-07-14T13:12:37Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d76723ee5313d0176e8777af4aa104d7562543c1'/>
<id>urn:sha1:d76723ee5313d0176e8777af4aa104d7562543c1</id>
<content type='text'>
By testing 'git -c core.fsmonitor= status -uno', we can check for the
simplest index operations that can be made sparse-aware. The necessary
implementation details are already integrated with sparse-checkout, so
modify command_requires_full_index to be zero for cmd_status().

In refresh_index(), we loop through the index entries to refresh their
stat() information. However, sparse directories have no stat()
information to populate. Ignore these entries.

This allows 'git status' to no longer expand a sparse index to a full
one. This is further tested by dropping the "-uno" option and adding an
untracked file into the worktree.

The performance test p2000-sparse-checkout-operations.sh demonstrates
these improvements:

Test                                  HEAD~1           HEAD
-----------------------------------------------------------------------------
2000.2: git status (full-index-v3)    0.31(0.30+0.05)  0.31(0.29+0.06) +0.0%
2000.3: git status (full-index-v4)    0.31(0.29+0.07)  0.34(0.30+0.08) +9.7%
2000.4: git status (sparse-index-v3)  2.35(2.28+0.10)  0.04(0.04+0.05) -98.3%
2000.5: git status (sparse-index-v4)  2.35(2.24+0.15)  0.05(0.04+0.06) -97.9%

Note that since HEAD~1 was expanding the sparse index by parsing trees,
it was artificially slower than the full index case. Thus, the 98%
improvement is misleading, and instead we should celebrate the 0.34s to
0.05s improvement of 85%. This is more indicative of the peformance
gains we are expecting by using a sparse index.

Note: we are dropping the assignment of core.fsmonitor here. This is not
necessary for the test script as we are not altering the config any
other way. Correct integration with FS Monitor will be validated in
later changes.

Reviewed-by: Elijah Newren &lt;newren@gmail.com&gt;
Signed-off-by: Derrick Stolee &lt;dstolee@microsoft.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>commit: remove irrelavent prompt on `--allow-empty-message`</title>
<updated>2021-07-09T19:08:18Z</updated>
<author>
<name>Hu Jialun</name>
<email>hujialun@comp.nus.edu.sg</email>
</author>
<published>2021-07-09T18:07:32Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=6f70f00b4f94c036767cbe0f4cd23db573a4e8ba'/>
<id>urn:sha1:6f70f00b4f94c036767cbe0f4cd23db573a4e8ba</id>
<content type='text'>
Even when the `--allow-empty-message` option is given, "git commit"
offers an interactive editor session with prefilled message that says
the commit will be aborted if the buffer is emptied, which is wrong.

Remove the "an empty message aborts" part from the message when the
option is given to fix it.

Helped-by: Junio C Hamano &lt;gitster@pobox.com&gt;
Helped-by: Đoàn Trần Công Danh &lt;congdanhqx@gmail.com&gt;
Helped-by: Felipe Contreras &lt;felipe.contreras@gmail.com&gt;
Signed-off-by: Hu Jialun &lt;hujialun@comp.nus.edu.sg&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>commit: reorganise commit hint strings</title>
<updated>2021-07-09T19:04:51Z</updated>
<author>
<name>Hu Jialun</name>
<email>hujialun@comp.nus.edu.sg</email>
</author>
<published>2021-07-09T18:07:31Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=54ba2f1862df7144eb3a8b192d992b520bdc3743'/>
<id>urn:sha1:54ba2f1862df7144eb3a8b192d992b520bdc3743</id>
<content type='text'>
Strings of hint messages inserted into editor on interactive commit was
scattered in-line, rendering the code harder to understand at first
glance.

Extract those messages out into separate variables to make the code
outline easier to follow.

Helped-by: Junio C Hamano &lt;gitster@pobox.com&gt;
Helped-by: Đoàn Trần Công Danh &lt;congdanhqx@gmail.com&gt;
Signed-off-by: Hu Jialun &lt;hujialun@comp.nus.edu.sg&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'ds/sparse-index-protections'</title>
<updated>2021-04-30T04:50:26Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2021-04-30T04:50:26Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=8e97852919fa422bc5fe57bc7e71826cf2b5224d'/>
<id>urn:sha1:8e97852919fa422bc5fe57bc7e71826cf2b5224d</id>
<content type='text'>
Builds on top of the sparse-index infrastructure to mark operations
that are not ready to mark with the sparse index, causing them to
fall back on fully-populated index that they always have worked with.

* ds/sparse-index-protections: (47 commits)
  name-hash: use expand_to_path()
  sparse-index: expand_to_path()
  name-hash: don't add directories to name_hash
  revision: ensure full index
  resolve-undo: ensure full index
  read-cache: ensure full index
  pathspec: ensure full index
  merge-recursive: ensure full index
  entry: ensure full index
  dir: ensure full index
  update-index: ensure full index
  stash: ensure full index
  rm: ensure full index
  merge-index: ensure full index
  ls-files: ensure full index
  grep: ensure full index
  fsck: ensure full index
  difftool: ensure full index
  commit: ensure full index
  checkout: ensure full index
  ...
</content>
</entry>
<entry>
<title>commit: ensure full index</title>
<updated>2021-04-14T20:47:06Z</updated>
<author>
<name>Derrick Stolee</name>
<email>dstolee@microsoft.com</email>
</author>
<published>2021-04-01T01:49:45Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=cb8388df5b3252802a0149ca558f99307e42074c'/>
<id>urn:sha1:cb8388df5b3252802a0149ca558f99307e42074c</id>
<content type='text'>
These two loops iterate over all cache entries, so ensure that a sparse
index is expanded to a full index before we do so.

Signed-off-by: Derrick Stolee &lt;dstolee@microsoft.com&gt;
Reviewed-by: Elijah Newren &lt;newren@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'zh/commit-trailer'</title>
<updated>2021-04-07T23:54:08Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2021-04-07T23:54:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=68e15e0c231bfa50e254fc87d054649161a7e301'/>
<id>urn:sha1:68e15e0c231bfa50e254fc87d054649161a7e301</id>
<content type='text'>
"git commit" learned "--trailer &lt;key&gt;[=&lt;value&gt;]" option; together
with the interpret-trailers command, this will make it easier to
support custom trailers.

* zh/commit-trailer:
  commit: add --trailer option
</content>
</entry>
</feed>
