Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change refs/* to refs/heads/* to speed up repo cloning w/ many branches #2330

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

quinnj
Copy link
Member

@quinnj quinnj commented Jan 11, 2021

Fixes #2329. Fix suggested by @staticfloat and discussed with @KristofferC. I've tested this only on the command in the #2329 issue and it makes the Pkg.add much much faster (like 5-10 seconds vs. several minutes).

@quinnj
Copy link
Member Author

quinnj commented Jan 11, 2021

Hmmmm, unfortunately I dont' know anything about this code, so not sure what this test failure means:

update: package state changes: Test Failed at /home/runner/work/Pkg.jl/Pkg.jl/test/new.jl:1461
  Expression: pkg.version == v"0.3.0"
   Evaluated: v"0.2.0" == v"0.3.0"
Stacktrace:
  [1] (::Main.PkgTests.NewTests.var"#430#451")(pkg::Pkg.API.PackageInfo)
    @ Main.PkgTests.NewTests ~/work/Pkg.jl/Pkg.jl/test/new.jl:1461
  [2] dependencies
    @ ~/work/Pkg.jl/Pkg.jl/src/API.jl:90 [inlined]
  [3] (::Main.PkgTests.NewTests.var"#427#448")(tempdir::String)
    @ Main.PkgTests.NewTests ~/work/Pkg.jl/Pkg.jl/test/new.jl:1459
  [4] mktempdir(fn::Main.PkgTests.NewTests.var"#427#448", parent::String; prefix::String)
    @ Base.Filesystem ./file.jl:732
  [5] mktempdir
    @ ./file.jl:730 [inlined]
  [6] #426
    @ ~/work/Pkg.jl/Pkg.jl/test/new.jl:1425 [inlined]
  [7] (::Main.PkgTests.Utils.var"#4#7"{Bool, Main.PkgTests.NewTests.var"#426#447"})()
    @ Main.PkgTests.Utils ~/work/Pkg.jl/Pkg.jl/test/utils.jl:53
  [8] withenv(::Main.PkgTests.Utils.var"#4#7"{Bool, Main.PkgTests.NewTests.var"#426#447"}, ::Pair{String, Nothing}, ::Vararg{Pair{String, Nothing}})
    @ Base ./env.jl:161
  [9] isolate(fn::Main.PkgTests.NewTests.var"#426#447"; loaded_depot::Bool)
    @ Main.PkgTests.Utils ~/work/Pkg.jl/Pkg.jl/test/utils.jl:44
 [10] macro expansion
    @ ~/work/Pkg.jl/Pkg.jl/test/new.jl:1425 [inlined]
 [11] macro expansion
    @ /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.7/Test/src/Test.jl:1152 [inlined]
 [12] top-level scope
    @ ~/work/Pkg.jl/Pkg.jl/test/new.jl:1384

@staticfloat
Copy link
Sponsor Member

In that test, we first create a git repo with a package in it:

https://github.com/JuliaLang/Pkg.jl/blob/master/test/new.jl#L1426

We ensure it is of the expected version, then we bump it and commit that new version:

https://github.com/JuliaLang/Pkg.jl/blob/master/test/new.jl#L1438-L1443

Then we Pkg.update() and see if the changes have taken effect:

https://github.com/JuliaLang/Pkg.jl/blob/master/test/new.jl#L1459-L1465

This makes me think that the refs/* somehow catches an update that refs/heads/* doesn't. Perhaps the way that tracking is setup within a git repository on file remotes is different than on HTTPS remotes?

@DilumAluthge
Copy link
Member

I think that in addition to refs/heads/*, you'll also need refs/remotes/* or something like that?

@quinnj
Copy link
Member Author

quinnj commented Jan 12, 2021

I'm not sure I'll have the time/skills to do much more on this soon, so if anyone would be willing to pick it up in the meantime, I'd appreciate it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pkg.add on repo w/ many branches can be extremely slow
3 participants