Scoop icon indicating copy to clipboard operation
Scoop copied to clipboard

[Feature] Make a small Git fork exclusively for cloning

Open couleurm opened this issue 3 years ago • 6 comments

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)

couleurm avatar Feb 22 '22 12:02 couleurm

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.

niheaven avatar Feb 22 '22 12:02 niheaven

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 avatar Feb 23 '22 13:02 rashil2000

Another idea is to use docker: https://github.com/ScoopInstaller/Scoop/issues/2783

rashil2000 avatar Feb 23 '22 13:02 rashil2000

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

couleurm avatar Feb 23 '22 14:02 couleurm

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

beyondmeat avatar Mar 01 '22 20:03 beyondmeat

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.

zStruCat avatar Mar 03 '22 11:03 zStruCat

Filing this under #4881

rashil2000 avatar Jan 07 '23 10:01 rashil2000