<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/builtin/clone.c, branch v2.36.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.36.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.36.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2022-05-01T05:22:12Z</updated>
<entry>
<title>clone: plug a miniscule leak</title>
<updated>2022-05-01T05:22:12Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2022-05-01T05:17:15Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=6dfadc8981a3f2fd3fb552eb956fe12a542f8ee8'/>
<id>urn:sha1:6dfadc8981a3f2fd3fb552eb956fe12a542f8ee8</id>
<content type='text'>
The remote_name variable is first assigned a copy of the value of
the "clone.defaultremotename" configuration variable and then by the
value of the "--origin" command line option.  The former is prepared
to see multiple instances of the configuration variable by freeing
the current value of the variable before a copy of the newly
discovered value gets assigned to it.  The latter however blindly
assigned a copy of the new value to the variable, thereby leaking
the value read from the configuration variable.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'ds/partial-bundles'</title>
<updated>2022-03-21T22:14:24Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2022-03-21T22:14:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=7391ecd338edcd0317687399c915927c1b4e25dd'/>
<id>urn:sha1:7391ecd338edcd0317687399c915927c1b4e25dd</id>
<content type='text'>
Bundle file format gets extended to allow a partial bundle,
filtered by similar criteria you would give when making a
partial/lazy clone.

* ds/partial-bundles:
  clone: fail gracefully when cloning filtered bundle
  bundle: unbundle promisor packs
  bundle: create filtered bundles
  rev-list: move --filter parsing into revision.c
  bundle: parse filter capability
  list-objects: handle NULL function pointers
  MyFirstObjectWalk: update recommended usage
  list-objects: consolidate traverse_commit_list[_filtered]
  pack-bitmap: drop filter in prepare_bitmap_walk()
  pack-objects: use rev.filter when possible
  revision: put object filter into struct rev_info
  list-objects-filter-options: create copy helper
  index-pack: document and test the --promisor option
</content>
</entry>
<entry>
<title>Merge branch 'gc/parse-tree-indirect-errors'</title>
<updated>2022-03-13T22:56:17Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2022-03-13T22:56:17Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=bde1e3e80a16a850da95af836ef85c5669c989a2'/>
<id>urn:sha1:bde1e3e80a16a850da95af836ef85c5669c989a2</id>
<content type='text'>
Check the return value from parse_tree_indirect() to turn segfaults
into calls to die().

* gc/parse-tree-indirect-errors:
  checkout, clone: die if tree cannot be parsed
</content>
</entry>
<entry>
<title>clone: fail gracefully when cloning filtered bundle</title>
<updated>2022-03-09T18:25:28Z</updated>
<author>
<name>Derrick Stolee</name>
<email>derrickstolee@github.com</email>
</author>
<published>2022-03-09T16:01:43Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=86fdd94d723b7fa1870a64e8080d3540a434f29b'/>
<id>urn:sha1:86fdd94d723b7fa1870a64e8080d3540a434f29b</id>
<content type='text'>
Users can create a new repository using 'git clone &lt;bundle-file&gt;'. The
new "@filter" capability for bundles means that we can generate a bundle
that does not contain all reachable objects, even if the header has no
negative commit OIDs.

It is feasible to think that we could make a filtered bundle work with
the command

  git clone --filter=$filter --bare &lt;bundle-file&gt;

or possibly replacing --bare with --no-checkout. However, this requires
having some repository-global config that specifies the specified object
filter and notifies Git about the existence of promisor pack-files.
Without a remote, that is currently impossible.

As a stop-gap, parse the bundle header during 'git clone' and die() with
a helpful error message instead of the current behavior of failing due
to "missing objects".

Most of the existing logic for handling bundle clones actually happens
in fetch-pack.c, but that logic is the same as if the user specified
'git fetch &lt;bundle&gt;', so we want to avoid failing to fetch a filtered
bundle when in an existing repository that has the proper config set up
for at least one remote.

Carefully comment around the test that this is not the desired long-term
behavior of 'git clone' in this case, but instead that we need to do
more work before that is possible.

Signed-off-by: Derrick Stolee &lt;derrickstolee@github.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>checkout, clone: die if tree cannot be parsed</title>
<updated>2022-03-02T07:27:09Z</updated>
<author>
<name>Glen Choo</name>
<email>chooglen@google.com</email>
</author>
<published>2022-03-02T00:36:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=8d2eaf649abd28baa083a723d1e041b26d2be83e'/>
<id>urn:sha1:8d2eaf649abd28baa083a723d1e041b26d2be83e</id>
<content type='text'>
When a tree oid is invalid, parse_tree_indirect() can return NULL. Check
for NULL instead of proceeding as though it were a valid pointer and
segfaulting.

Signed-off-by: Glen Choo &lt;chooglen@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'js/apply-partial-clone-filters-recursively'</title>
<updated>2022-02-25T23:47:35Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2022-02-25T23:47:35Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2e65591ed61ab488395c454004106a5e9424648e'/>
<id>urn:sha1:2e65591ed61ab488395c454004106a5e9424648e</id>
<content type='text'>
"git clone --filter=... --recurse-submodules" only makes the
top-level a partial clone, while submodules are fully cloned.  This
behaviour is changed to pass the same filter down to the submodules.

* js/apply-partial-clone-filters-recursively:
  clone, submodule: pass partial clone filters to submodules
</content>
</entry>
<entry>
<title>Merge branch 'ab/release-transport-ls-refs-options'</title>
<updated>2022-02-18T21:53:29Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2022-02-18T21:53:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=18636afdce5f272d79fe6c3036e4e74f69a0845a'/>
<id>urn:sha1:18636afdce5f272d79fe6c3036e4e74f69a0845a</id>
<content type='text'>
* ab/release-transport-ls-refs-options:
  ls-remote &amp; transport API: release "struct transport_ls_refs_options"
</content>
</entry>
<entry>
<title>clone, submodule: pass partial clone filters to submodules</title>
<updated>2022-02-09T23:38:36Z</updated>
<author>
<name>Josh Steadmon</name>
<email>steadmon@google.com</email>
</author>
<published>2022-02-05T05:00:49Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f05da2b48b48a46db65fc768b3ffecaf996dd655'/>
<id>urn:sha1:f05da2b48b48a46db65fc768b3ffecaf996dd655</id>
<content type='text'>
When cloning a repo with a --filter and with --recurse-submodules
enabled, the partial clone filter only applies to the top-level repo.
This can lead to unexpected bandwidth and disk usage for projects which
include large submodules. For example, a user might wish to make a
partial clone of Gerrit and would run:
`git clone --recurse-submodules --filter=blob:5k https://gerrit.googlesource.com/gerrit`.
However, only the superproject would be a partial clone; all the
submodules would have all blobs downloaded regardless of their size.
With this change, the same filter can also be applied to submodules,
meaning the expected bandwidth and disk savings apply consistently.

To avoid changing default behavior, add a new clone flag,
`--also-filter-submodules`. When this is set along with `--filter` and
`--recurse-submodules`, the filter spec is passed along to git-submodule
and git-submodule--helper, such that submodule clones also have the
filter applied.

This applies the same filter to the superproject and all submodules.
Users who need to customize the filter per-submodule would need to clone
with `--no-recurse-submodules` and then manually initialize each
submodule with the proper filter.

Applying filters to submodules should be safe thanks to Jonathan Tan's
recent work [1, 2, 3] eliminating the use of alternates as a method of
accessing submodule objects, so any submodule object access now triggers
a lazy fetch from the submodule's promisor remote if the accessed object
is missing. This patch is a reworked version of [4], which was created
prior to Jonathan Tan's work.

[1]: 8721e2e (Merge branch 'jt/partial-clone-submodule-1', 2021-07-16)
[2]: 11e5d0a (Merge branch 'jt/grep-wo-submodule-odb-as-alternate',
	2021-09-20)
[3]: 162a13b (Merge branch 'jt/no-abuse-alternate-odb-for-submodules',
	2021-10-25)
[4]: https://lore.kernel.org/git/52bf9d45b8e2b72ff32aa773f2415bf7b2b86da2.1563322192.git.steadmon@google.com/

Signed-off-by: Josh Steadmon &lt;steadmon@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'jt/clone-not-quite-empty'</title>
<updated>2022-02-09T22:21:01Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2022-02-09T22:21:01Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d991df4bf6259bc53223feb71957c961b7b8fa84'/>
<id>urn:sha1:d991df4bf6259bc53223feb71957c961b7b8fa84</id>
<content type='text'>
Cloning from a repository that does not yet have any branches or
tags but has other refs resulted in a "remote transport reported
error", which has been corrected.

* jt/clone-not-quite-empty:
  clone: support unusual remote ref configurations
</content>
</entry>
<entry>
<title>Merge branch 'ab/config-based-hooks-2'</title>
<updated>2022-02-09T22:21:00Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2022-02-09T22:21:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c70bc338e9a35b45263c3c68913ad516e9e70d62'/>
<id>urn:sha1:c70bc338e9a35b45263c3c68913ad516e9e70d62</id>
<content type='text'>
More "config-based hooks".

* ab/config-based-hooks-2:
  run-command: remove old run_hook_{le,ve}() hook API
  receive-pack: convert push-to-checkout hook to hook.h
  read-cache: convert post-index-change to use hook.h
  commit: convert {pre-commit,prepare-commit-msg} hook to hook.h
  git-p4: use 'git hook' to run hooks
  send-email: use 'git hook run' for 'sendemail-validate'
  git hook run: add an --ignore-missing flag
  hooks: convert worktree 'post-checkout' hook to hook library
  hooks: convert non-worktree 'post-checkout' hook to hook library
  merge: convert post-merge to use hook.h
  am: convert applypatch-msg to use hook.h
  rebase: convert pre-rebase to use hook.h
  hook API: add a run_hooks_l() wrapper
  am: convert {pre,post}-applypatch to use hook.h
  gc: use hook library for pre-auto-gc hook
  hook API: add a run_hooks() wrapper
  hook: add 'run' subcommand
</content>
</entry>
</feed>
