git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* 'git sparse-checkout add' hangs if local repo is using alternative objects store
@ 2022-07-12 13:58 Dian Xu
  2022-07-15  3:06 ` Derrick Stolee
  0 siblings, 1 reply; 3+ messages in thread
From: Dian Xu @ 2022-07-12 13:58 UTC (permalink / raw)
  To: Git Mailing List

Dear Git developers,

Reporting Issue:
    'git sparse-checkout add' hangs if local repo is using alternative
objects store

Found in:
    Git 2.37.0

Reproduction steps:
    1. Local repo setup:
        git init
        git remote add origin <repo_url>
        echo <alternative_objects_store> >! .git/objects/info/alternates
        git config --unset-all remote.origin.fetch
        git config --unset-all remote.origin.tagopt
        git config --add remote.origin.tagopt --no-tags
        git config --add remote.origin.fetch
+refs/heads/main:refs/remotes/origin/main
        git config core.sparsecheckout true
        git config core.sparsecheckoutcone true
        git fetch

    2. Sparse checkout <dir1>:
        git sparse-checkout set <dir1>
        git checkout -b tmp1 origin/main

    3. Add another <dir2> via sparse-checkout, which hangs:
        git sparse-checkout add <dir2>
            09:39:11.169116 read-cache.c:2451       performance:
6.326754679 s:  read cache .git/index
            09:39:11.731989 unpack-trees.c:496      performance:
0.197235658 s:   check_updates
            09:39:11.732031 unpack-trees.c:2062     performance:
0.512473791 s:  update_sparsity
            09:39:17.162018 read-cache.c:3135       performance:
5.429975480 s:  write index, changed mask = 2
            09:39:17.637510 cache-tree.c:483        performance:
0.154317183 s:  cache_tree_update
            09:39:17.857204 cache-tree.c:483        performance:
0.019983088 s:  cache_tree_update

Repo and dir info:
    <repo_url> is a large repo, containing large number of directories
and 2 million files;
    Local repo is using <alternative_objects_store>, which is working
by verifying: git count-objects -vH;
    <dir1> used here is one level deep, <dir2> used here is 5 level deep

Observations:
    1. Even 'sparse-checkout add' hangs, scm code from <dir2> was
actually downloaded pretty fast
    2. If waited out 'sparse-checkout add', git seems start to
download large number of objects from alternative objects store into
local .git/objects

Please help us take a look at this issue and let us know if you need
more information.

Thanks,

Dian Xu
Mathworks, Inc
1 Lakeside Campus Drive, Natick, MA 01760
508-647-3583

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-07-18 19:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-07-12 13:58 'git sparse-checkout add' hangs if local repo is using alternative objects store Dian Xu
2022-07-15  3:06 ` Derrick Stolee
2022-07-18 19:29   ` Dian Xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).