<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/commit-graph.c, branch v2.24.2</title>
<subtitle>Fork of git SCM with my patches.</subtitle>
<id>http://git.kilabit.info/git/atom?h=v2.24.2</id>
<link rel='self' href='http://git.kilabit.info/git/atom?h=v2.24.2'/>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/'/>
<updated>2019-11-04T04:33:06Z</updated>
<entry>
<title>Merge branch 'ds/commit-graph-on-fetch'</title>
<updated>2019-11-04T04:33:06Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2019-11-04T04:33:06Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=dac1d83c919430aa73f8df21854a08a7b9a95837'/>
<id>urn:sha1:dac1d83c919430aa73f8df21854a08a7b9a95837</id>
<content type='text'>
Regression fix.

* ds/commit-graph-on-fetch:
  commit-graph: fix writing first commit-graph during fetch
  t5510-fetch.sh: demonstrate fetch.writeCommitGraph bug
</content>
</entry>
<entry>
<title>commit-graph: fix writing first commit-graph during fetch</title>
<updated>2019-10-25T02:19:16Z</updated>
<author>
<name>Derrick Stolee</name>
<email>dstolee@microsoft.com</email>
</author>
<published>2019-10-24T13:40:42Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=cb99a34e23e32ca8e94bafaa9699cfd133a17fd3'/>
<id>urn:sha1:cb99a34e23e32ca8e94bafaa9699cfd133a17fd3</id>
<content type='text'>
The previous commit includes a failing test for an issue around
fetch.writeCommitGraph and fetching in a repo with a submodule. Here, we
fix that bug and set the test to "test_expect_success".

The problem arises with this set of commands when the remote repo at
&lt;url&gt; has a submodule. Note that --recurse-submodules is not needed to
demonstrate the bug.

	$ git clone &lt;url&gt; test
	$ cd test
	$ git -c fetch.writeCommitGraph=true fetch origin
	Computing commit graph generation numbers: 100% (12/12), done.
	BUG: commit-graph.c:886: missing parent &lt;hash1&gt; for commit &lt;hash2&gt;
	Aborted (core dumped)

As an initial fix, I converted the code in builtin/fetch.c that calls
write_commit_graph_reachable() to instead launch a "git commit-graph
write --reachable --split" process. That code worked, but is not how we
want the feature to work long-term.

That test did demonstrate that the issue must be something to do with
internal state of the 'git fetch' process.

The write_commit_graph() method in commit-graph.c ensures the commits we
plan to write are "closed under reachability" using close_reachable().
This method walks from the input commits, and uses the UNINTERESTING
flag to mark which commits have already been visited. This allows the
walk to take O(N) time, where N is the number of commits, instead of
O(P) time, where P is the number of paths. (The number of paths can be
exponential in the number of commits.)

However, the UNINTERESTING flag is used in lots of places in the
codebase. This flag usually means some barrier to stop a commit walk,
such as in revision-walking to compare histories. It is not often
cleared after the walk completes because the starting points of those
walks do not have the UNINTERESTING flag, and clear_commit_marks() would
stop immediately.

This is happening during a 'git fetch' call with a remote. The fetch
negotiation is comparing the remote refs with the local refs and marking
some commits as UNINTERESTING.

I tested running clear_commit_marks_many() to clear the UNINTERESTING
flag inside close_reachable(), but the tips did not have the flag, so
that did nothing.

It turns out that the calculate_changed_submodule_paths() method is at
fault. Thanks, Peff, for pointing out this detail! More specifically,
for each submodule, the collect_changed_submodules() runs a revision
walk to essentially do file-history on the list of submodules. That
revision walk marks commits UNININTERESTING if they are simplified away
by not changing the submodule.

Instead, I finally arrived on the conclusion that I should use a flag
that is not used in any other part of the code. In commit-reach.c, a
number of flags were defined for commit walk algorithms. The REACHABLE
flag seemed like it made the most sense, and it seems it was not
actually used in the file. The REACHABLE flag was used in early versions
of commit-reach.c, but was removed by 4fbcca4 (commit-reach: make
can_all_from_reach... linear, 2018-07-20).

Add the REACHABLE flag to commit-graph.c and use it instead of
UNINTERESTING in close_reachable(). This fixes the bug in manual
testing.

Reported-by: Johannes Schindelin &lt;johannes.schindelin@gmx.de&gt;
Helped-by: Jeff King &lt;peff@peff.net&gt;
Helped-by: Szeder Gábor &lt;szeder.dev@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>Merge branch 'ah/cleanups'</title>
<updated>2019-10-09T05:01:00Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2019-10-09T05:01:00Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=6e12570822a904e2be554b05755c08f4d24be7e9'/>
<id>urn:sha1:6e12570822a904e2be554b05755c08f4d24be7e9</id>
<content type='text'>
Miscellaneous code clean-ups.

* ah/cleanups:
  git_mkstemps_mode(): replace magic numbers with computed value
  wrapper: use a loop instead of repetitive statements
  diffcore-break: use a goto instead of a redundant if statement
  commit-graph: remove a duplicate assignment
</content>
</entry>
<entry>
<title>Merge branch 'tb/commit-graph-harden'</title>
<updated>2019-10-07T02:32:58Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2019-10-07T02:32:58Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=80693e3f09ab80cfe4a5a83467e765626ad0b15a'/>
<id>urn:sha1:80693e3f09ab80cfe4a5a83467e765626ad0b15a</id>
<content type='text'>
The code to parse and use the commit-graph file has been made more
robust against corrupted input.

* tb/commit-graph-harden:
  commit-graph.c: handle corrupt/missing trees
  commit-graph.c: handle commit parsing errors
  t/t5318: introduce failing 'git commit-graph write' tests
</content>
</entry>
<entry>
<title>Merge branch 'gs/commit-graph-progress'</title>
<updated>2019-10-07T02:32:57Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2019-10-07T02:32:57Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=caf150ce7d60e4070292226ec208478b801b8d4b'/>
<id>urn:sha1:caf150ce7d60e4070292226ec208478b801b8d4b</id>
<content type='text'>
* gs/commit-graph-progress:
  commit-graph: add --[no-]progress to write and verify
</content>
</entry>
<entry>
<title>Merge branch 'rs/commit-graph-use-list-count'</title>
<updated>2019-10-07T02:32:57Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2019-10-07T02:32:57Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=13981713785dea1048ae01b5124e364f92d7cb00'/>
<id>urn:sha1:13981713785dea1048ae01b5124e364f92d7cb00</id>
<content type='text'>
Code cleanup.

* rs/commit-graph-use-list-count:
  commit-graph: use commit_list_count()
</content>
</entry>
<entry>
<title>Merge branch 'jk/disable-commit-graph-during-upload-pack'</title>
<updated>2019-10-07T02:32:55Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2019-10-07T02:32:55Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=098e8c6716b8c6abc29b6788acdb3ac8725f835d'/>
<id>urn:sha1:098e8c6716b8c6abc29b6788acdb3ac8725f835d</id>
<content type='text'>
The "upload-pack" (the counterpart of "git fetch") needs to disable
commit-graph when responding to a shallow clone/fetch request, but
the way this was done made Git panic, which has been corrected.

* jk/disable-commit-graph-during-upload-pack:
  upload-pack: disable commit graph more gently for shallow traversal
  commit-graph: bump DIE_ON_LOAD check to actual load-time
</content>
</entry>
<entry>
<title>Merge branch 'jk/commit-graph-cleanup'</title>
<updated>2019-10-07T02:32:55Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2019-10-07T02:32:55Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=cda8faa37e997f5db3458c1454ffe70f5c460d2a'/>
<id>urn:sha1:cda8faa37e997f5db3458c1454ffe70f5c460d2a</id>
<content type='text'>
A pair of small fixups to "git commit-graph" have been applied.

* jk/commit-graph-cleanup:
  commit-graph: turn off save_commit_buffer
  commit-graph: don't show progress percentages while expanding reachable commits
</content>
</entry>
<entry>
<title>commit-graph: remove a duplicate assignment</title>
<updated>2019-10-02T06:04:16Z</updated>
<author>
<name>Alex Henrie</name>
<email>alexhenrie24@gmail.com</email>
</author>
<published>2019-10-01T02:29:34Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=8da02ce62a4e76aea7a02d56b66b10eedc8e6db8'/>
<id>urn:sha1:8da02ce62a4e76aea7a02d56b66b10eedc8e6db8</id>
<content type='text'>
Leave the variable 'g' uninitialized before it is set just before its
first use in front of a loop, which is a much more appropriate place to
indicate what it is used for.

Also initialize the variable 'num_commits' just before the loop instead
of at the beginning of the function for the same reason.

Reviewed-by: Derrick Stolee &lt;stolee@gmail.com&gt;
Signed-off-by: Alex Henrie &lt;alexhenrie24@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>commit-graph: add --[no-]progress to write and verify</title>
<updated>2019-09-18T21:23:09Z</updated>
<author>
<name>Garima Singh</name>
<email>garima.singh@microsoft.com</email>
</author>
<published>2019-08-26T16:29:58Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=7371612255492f062ee905e6d88c6234c6d4752a'/>
<id>urn:sha1:7371612255492f062ee905e6d88c6234c6d4752a</id>
<content type='text'>
Add --[no-]progress to git commit-graph write and verify.
The progress feature was introduced in 7b0f229
("commit-graph write: add progress output", 2018-09-17) but
the ability to opt-out was overlooked.

Signed-off-by: Garima Singh &lt;garima.singh@microsoft.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
