Git Product home page Git Product logo

Comments (8)

nathanchance avatar nathanchance commented on July 17, 2024 1

I will push it once I have a version I am happy with.

from tc-build.

nathanchance avatar nathanchance commented on July 17, 2024

So --depth=1 in git implies --single-branch (reference), which means that we only get the master branch since it is the default. We do not use the --branch parameter to git clone due to 925a800.

I can make your request work properly with the below diff but the caveat is that we are now fetching a shallow clone of all branches, which ultimately results in about 379.21 MiB being fetched, versus 125.31 MiB or so. It is up to you whether or not I push this, I do not use --shallow-clone and @kdrag0n only builds the master branch so this does not affect him. Otherwise, you can just continue to manage the repo manually if you care about the bandwidth savings.

diff --git a/build-llvm.py b/build-llvm.py
index a2e17e2..a3311fb 100755
--- a/build-llvm.py
+++ b/build-llvm.py
@@ -440,7 +440,11 @@ def fetch_llvm_binutils(root_folder, update, shallow, ref):
                                check=True,
                                cwd=cwd)
     else:
-        extra_args = ("--depth", "1") if shallow else ()
+        extra_args = ()
+        if shallow:
+            extra_args = ("--depth", "1")
+            if ref != "master":
+                extra_args += ("--no-single-branch",)
         utils.print_header("Downloading LLVM")
         subprocess.run([
             "git", "clone", *extra_args, **"git://github.com/llvm/llvm-project",**

from tc-build.

dileks avatar dileks commented on July 17, 2024

What is the output of git branch and git branch -r in llvm-project Git after your diff was applied?

I have archived today 2 tarballs with master and release/10.x Git branches of llvm-project shallow-cloned.
Means I have downloaded 2x 125MiB = 250MiB.
So 380MiB is OK for me vs. self-managed switching between these 2 tarballs.

from tc-build.

msfjarvis avatar msfjarvis commented on July 17, 2024
llvm-project (release/10.x) $ git branch
  master
* release/10.x
llvm-project (release/10.x) $ git branch -r
  origin/HEAD -> origin/master
  origin/master
  origin/release/1.0.x
  origin/release/1.1.x
  origin/release/1.2.x
  origin/release/1.3.x
  origin/release/1.4.x
  origin/release/1.5.x
  origin/release/1.6.x
  origin/release/1.7.x
  origin/release/1.8.x
  origin/release/1.9.x
  origin/release/10.x
  origin/release/2.0.x
  origin/release/2.1.x
  origin/release/2.2.x
  origin/release/2.3.x
  origin/release/2.4.x
  origin/release/2.5.x
  origin/release/2.6.x
  origin/release/2.7.x
  origin/release/2.8.x
  origin/release/2.9.x
  origin/release/3.0.x
  origin/release/3.1.x
  origin/release/3.2.x
  origin/release/3.3.x
  origin/release/3.4.x
  origin/release/3.5.x
  origin/release/3.6.x
  origin/release/3.7.x
  origin/release/3.8.x
  origin/release/3.9.x
  origin/release/4.x
  origin/release/5.x
  origin/release/6.x
  origin/release/7.x
  origin/release/8.x
  origin/release/9.x

This is the state of the repository after Nathan's diff was applied to a fresh clone of tc-build, and build-llvm.py invoked with ./build-llvm.py -s -b release/10.x.

from tc-build.

dileks avatar dileks commented on July 17, 2024

Cool :-).

Can you confirm the number of 380MiB data-usage from @nathanchance?

Many many thanks to both of you!

from tc-build.

msfjarvis avatar msfjarvis commented on July 17, 2024

Cool :-).

Can you confirm the number of 380MiB data-usage from @nathanchance?

Many many thanks to both of you!

My .git folder is 400.1MB so I guess his estimate is mostly accurate.

from tc-build.

dileks avatar dileks commented on July 17, 2024

/o\

from tc-build.

dileks avatar dileks commented on July 17, 2024

@nathanchance

Can you push this, please?
Thanks.

from tc-build.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.