Bug 579805 - Clone creates reflogs for all remote tracking branches, overloading the local filesystem
Summary: Clone creates reflogs for all remote tracking branches, overloading the local...
Status: RESOLVED FIXED
Alias: None
Product: JGit
Classification: Technology
Component: JGit (show other bugs)
Version: 5.13   Edit
Hardware: PC Mac OS X
: P3 critical (vote)
Target Milestone: 5.13.2   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-04-29 11:43 EDT by Luca Milanesio CLA
Modified: 2023-02-01 08:01 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Luca Milanesio CLA 2022-04-29 11:43:14 EDT
Steps to reproduce the problem:

1. Clone the main branch of a large repository with 1M branches
2. List the reflogs created locally (find $GIT_DIR/logs -type f | wc -l)

Expected result:
I see 3 reflogs:
./HEAD
./refs/heads/master
./refs/remotes/origin/HEAD

Observed result:
I see over 1M reflogs (all the remote tracking branches)

If I do the same operation using git (C-implementation) I see the expected result.
Comment 1 Eclipse Genie CLA 2022-05-04 04:14:09 EDT
New Gerrit change created: https://git.eclipse.org/r/c/jgit/jgit/+/193101
Comment 2 Luca Milanesio CLA 2022-05-04 05:59:46 EDT
Updating the importance to critical because the issue is making JGit unusable for remote repositories with millions of refs.
Comment 3 Luca Milanesio CLA 2022-05-04 08:44:05 EDT
I moved the version to v5.13 because I need the fix on Java 8 as well.

The change for review on stable-5.13 is:
https://git.eclipse.org/r/c/jgit/jgit/+/193007
Comment 4 Matthias Sohn CLA 2022-05-04 12:13:41 EDT
(In reply to Luca Milanesio from comment #0)
> Steps to reproduce the problem:
> 
> 1. Clone the main branch of a large repository with 1M branches

it's not necessary to clone a large repo with tons of branches to show that the current behaviour is wrong. 1 branch is sufficient.

Which repository has 1M branches ?

> 2. List the reflogs created locally (find $GIT_DIR/logs -type f | wc -l)
> 
> Expected result:
> I see 3 reflogs:
> ./HEAD
> ./refs/heads/master
> ./refs/remotes/origin/HEAD
> 
> Observed result:
> I see over 1M reflogs (all the remote tracking branches)
> 
> If I do the same operation using git (C-implementation) I see the expected
> result.