git/list[1] front-page[2] threads[3] people[4] search[5] about
 

git gc taking forever to reflog expire --all

From
GBGeert Bosch <bosch@adacore.com>
Date
May 10, 2010, 17:58 UTC
Message-ID
<0C5B1A89-551A-4EC8-862A-C306A286FAF4@adacore.com>

On my recent MacBook Pro, I gave up after reflog expire --all had chewed up 30 minutes of perfectly fine CPU time.

Basically, I have a SVN import of a single branch of a repository with just a single directory with 3K files or so (this SVN import is part of a bigger repository). There are about 117K commits in the GIT history. I have a few local branches of just a couple commits each. The total .git size is 450MB, with about 3K loose objects.

This seems something that should be "git gc"-ed in about a minute or less, so I'm puzzled what is going on in this git reflog expire. From a cursory look it seems that we're in a loop finding a merge base for each commit, or similar. I'm including a log of a random interruption (using Ubuntu here instead of MacOS for better debugging).

  -Geert
#0  0x080b1c8c in clear_commit_marks (commit=0x87b2d60, mark=983040)
    at commit.c:403
#1  0x080b2d44 in get_merge_bases_many (one=0x90a9120, n=1, twos=0xbffff344, 
    cleanup=1) at commit.c:655
#2  0x080b2e67 in get_merge_bases (one=0x90a9120, two=0x819f720, cleanup=1)
    at commit.c:704
#3  0x080b2e9b in in_merge_bases (commit=0x90a9120, reference=0xbffff51c, 
    num=1) at commit.c:728
#4  0x08092ffa in unreachable (cb=0xbffff514, commit=0x5, 
    sha1=0xbffff484 "\264\252\244\232\320=Q\213\243Ҋ\323\070%[T\232\360,\032\214=\226\340\001\253\335tZ ", <incomplete sequence \303>) at builtin/reflog.c:233
#5  0x080930f5 in expire_reflog_ent (
    osha1=0xbffff498 "\232\360,\032\214=\226\340\001\253\335tZ ", <incomplete sequence \303>, 
    nsha1=0xbffff484 "\264\252\244\232\320=Q\213\243Ҋ\323\070%[T\232\360,\032\214=\226\340\001\253\335tZ ", <incomplete sequence \303>, 
    email=0x81c0ada "Geert Bosch <bosch@gnat.com>", timestamp=1265908541, 
    tz=0, message=0x81c0b08 "r4741\n", cb_data=0xbffff514)
    at builtin/reflog.c:298
#6  0x080e2c1f in for_each_recent_reflog_ent (
    ref=0x818066c "refs/remotes/git-svn@130115", 
    fn=0x8093030 <expire_reflog_ent>, ofs=0, cb_data=0xbffff514) at refs.c:1623
#7  0x080e2d27 in for_each_reflog_ent (
    ref=0x818066c "refs/remotes/git-svn@130115", 
    fn=0x8093030 <expire_reflog_ent>, cb_data=0xbffff514) at refs.c:1635
#8  0x080924d7 in expire_reflog (ref=0x818066c "refs/remotes/git-svn@130115", 
    sha1=0x819f720 "\005", unused=<value optimized out>, cb_data=0xbffff594)
    at builtin/reflog.c:353
#9  0x08092ab6 in cmd_reflog_expire (argc=2, argv=0xbffffb2c, prefix=0x0)
    at builtin/reflog.c:599
#10 0x0804b374 in run_builtin (argc=3, argv=0xbffffb28) at git.c:260
#11 handle_internal_command (argc=3, argv=0xbffffb28) at git.c:416
#12 0x0804b572 in run_argv (argc=3, argv=0xbffffb28) at git.c:458
#13 main (argc=3, argv=0xbffffb28) at git.c:529
Next: Jeff King
Message 1 of 5 in “git gc taking forever to reflog expire --all”
  1. Geert BoschMay 10, 2010
  2. Jeff KingMay 11, 2010
  3. Geert BoschMay 11, 2010
  4. Jeff KingMay 11, 2010
  5. Jeff KingMay 11, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.