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

[Feature] Make a small Git fork exclusively for cloning #4750

Closed
couleurm opened this issue Feb 22, 2022 · 7 comments
Closed

[Feature] Make a small Git fork exclusively for cloning #4750

couleurm opened this issue Feb 22, 2022 · 7 comments

Comments

@couleurm
Copy link

Feature Request

Is your feature request related to a problem? Please describe.

I often rev up a VM to test my apps and if they install correctly, one annoyance is that Git takes a bit to install each time (40+MB), and takes almost 300MB in apps

Describe the solution you'd like

Why not make a trimmed down version which can only clone repos. It could also be integrated it into Scoop, if it has advanced integration it could be automatically installed when the user specifies a non-added known bucket, example:

PS C:\> iex(irm get.scoop.sh)
Initializing...
Downloading scoop...
Extracting...
Creating shim...
Downloading main bucket...
Extracting...
Adding ~\scoop\shims to your path
Scoop was installed successfully!
Type 'scoop help' for instructions
PS C:\> scoop install extras/librewolf
Adding the 'extras' bucket..  # Detects non installed bucket is in known
Installing '7zip' (21.07) [64bit]
7z2107-x64.msi (1.8 MB) [======================================================] 100%
Checking hash of 7z2107-x64.msi ... ok.
Extracting 7z2107-x64.msi ... done.
Running pre-install script...
Linking ~\scoop\apps\7zip\current => ~\scoop\apps\7zip\21.07
Creating shim for '7z'.
Creating shortcut for 7-Zip (7zFM.exe)
Persisting Codecs
Persisting Formats
'7zip' (21.07) was installed successfully!
Git not found, installing Cloner... # Failed to find git
Installing 'Cloner'  (1.0) [64bit]
cloner-x64.7z (2.3 MB) [=======================================================] 100%
Creating shim for 'cloner'
Checking repo... ok # Runs scoop bucket add extras
The extras bucket was added successfully.
Installing 'librewolf' (97.0.1) [64bit]
librewolf-97.0.1.en-US.win64.zip (73.9 MB) [====================================] 100%
Checking hash of librewolf-97.0.1.en-US.win64.zip ... ok.
Extracting librewolf-97.0.1.en-US.win64.zip ... done.
Running pre-install script...
Linking ~\scoop\apps\librewolf\current => ~\scoop\apps\librewolf\97.0.1
Creating shim for 'librewolf'.
Creating shortcut for Librewolf (librewolf-portable.exe)
Persisting Profiles
'librewolf' (97.0.1) was installed successfully!

How I could imagine it to work in the background:

if ($app -like "*/*"){
    $bucket = $app.split('/')[0]
    if (($bucket -notin $installedbuckets) -and ($bucket -in (scoop bucket known))){
        if (-Not(Get-Command git -ErrorAction Ignore)){
            scoop install main/cloner
        }
        # Add the bucket
    }
    # Install an app
}

Or while scoop is installing also install it if git is not found in path

Describe alternatives you've considered

  • Script that moves everything to Scoop's cache folder so I don't have to download anything
  • Doing scoop install <raw manifest url/manifestpath> (only in temporary environments, iirc this breaks updates)
@niheaven
Copy link
Member

This feature tends to be accomplished in recent Scoop Core release (using semiver and a tarball program), thank you for your advice and potential sketch.

@rashil2000
Copy link
Member

rashil2000 commented Feb 23, 2022

Actually, such a tool already exists - https://github.com/ScoopInstaller/GitCloner

But yes it is not integrated into the scoop bucket add functionality.

But my question is, why not use this scoop install <raw manifest url/manifestpath>? If you are testing a manifest in a VM, you won't need to update buckets (which requires git), right?

@rashil2000
Copy link
Member

Another idea is to use docker: #2783

@couleurm
Copy link
Author

Actually, such a tool already exists - https://github.com/ScoopInstaller/GitCloner

But yes it is not integrated into the scoop bucket add functionality.

But my question is, why not use this scoop install <raw manifest url/manifestpath>? If you are testing a manifest in a VM, you won't need to update buckets (which requires git), right?

Yup, I just got the idea this way to make installing Scoop and other buckets much faster in general

Also for GitCloner that's exactly what I mean, I'd love seeing this being integrated into Scoop

@beyondmeat
Copy link

You can also change your git command to be more minimal.

https://stackoverflow.com/questions/25954622/a-way-to-keep-a-shallow-git-clone-just-minimally-up-to-date

@zStruCat
Copy link
Contributor

zStruCat commented Mar 3, 2022

I think that similar issue (and solution) had been raised in #4044. Maybe the functions shallow-clone, shallow-fetch and make-shallow can be added to the code and take some of the place of git_cmd, or perhaps one can just add "--depth=1" in each case.

@rashil2000
Copy link
Member

Filing this under #4881

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

No branches or pull requests

5 participants