Comments (10)
We really need this feature, is there a roadmap or something we can do for helping you ?
We could pay in ETHW 😄
from go-git.
To help us keep things tidy and focus on the active tasks, we've introduced a stale bot to spot issues/PRs that haven't had any activity in a while.
This particular issue hasn't had any updates or activity in the past 90 days, so it's been labeled as 'stale'. If it remains inactive for the next 30 days, it'll be automatically closed.
We understand everyone's busy, but if this issue is still important to you, please feel free to add a comment or make an update to keep it active.
Thanks for your understanding and cooperation!
from go-git.
@yordis AFAICT, sparse checkout is supported. You can see it in this test:
Lines 291 to 320 in 809f9df
That being said, I'm trying to use this and it doesn't appear to working. After the checkout, I seem to have all dirs in the worktree, not just the sparse dirs. If you get it working, let me know! Thanks!
from go-git.
this will be a great addition 🙌
from go-git.
Hey folks, I am trying to contribute to ArgoCD (and potentially FluxCD) by adding sparse checkout: argoproj/argo-cd#14272
But it seems it is not supported. Any opportunity to make the issue a priority?
from go-git.
I removed the usage of the package btw!
from go-git.
What did not work?
It looks to be working in my simple test: https://github.com/emirot/test-go-git/tree/main
from go-git.
We would appreciate this feature as well!
from go-git.
I also am having trouble using SparseCheckoutDirectories
(with go-git v5.11.0). My case may be slightly strange, though. I want to get a sparse checkout from a particular commit. My code, in brief:
# sha -> 40 character SHA
# path -> subfolder in my repo, ala "src/app/config"
# repo -> git form of my repo, ala "[email protected]:myorg/myrepo.git"
tempDir, _ := os.MkdirTemp("", "source-*")
fs := osfs.New(tempDir)
dot, _ := fs.Chroot(".git")
s := filesystem.NewStorage(dot, cache.NewObjectLRUDefault())
refspec := config.RefSpec(fmt.Sprintf("+%s:refs/remotes/origin/%s", sha, sha))
r, _ := gogit.Init(s, fs)
r.CreateRemote(&config.RemoteConfig{
Fetch: []config.RefSpec{refspec},
Name: "origin",
URLs: []string{repo},
})
w, _ := r.Worktree()
r.Fetch(&gogit.FetchOptions{
Depth: 1,
InsecureSkipTLS: false,
Tags: gogit.NoTags,
})
w.Checkout(&gogit.CheckoutOptions{
Hash: plumbing.NewHash(sha),
SparseCheckoutDirectories: []string{path},
})
While the sample code above does not show error checking, it is present in my actual code, and no errors are coming back.
I have also tried setting path
as just "src" (instead of "src/app/cfg") to match the test mentioned above, but same behavior. Also same if I add a Force: true
to the CheckoutOptions
.
from go-git.
What did not work?
It looks to be working in my simple test: https://github.com/emirot/test-go-git/tree/main
@emirot for you this works, because your example doesn't have NoCheckout: true
, in git.CloneOptions of git.PlainClone
from go-git.
Related Issues (20)
- `gitattributes.ReadAttributesFile` does not close file
- $HOME is not defined HOT 2
- Amend Commit doesn't work HOT 1
- Add Keep to ResetOptions HOT 2
- Git restore - existing pull request HOT 1
- Decoding push-options and push-cert in update-request
- Community management with Gov4Git built on go-git
- (*Worktree).Commit will panic if `CommitOptions` parameter is nil. HOT 1
- CommitOptions.AllowEmptyCommits does nothing HOT 2
- Error inconsistencies
- Stack overflow in UploadPack HOT 2
- Error when deleting a branch or a tag HOT 1
- BUG: Spare checkout would checkout all files.
- go-git compatibility with git-credential-manager (GCM) HOT 1
- Checkout to the previous branch
- Personal access token : invalid auth method HOT 5
- When executing worktree.Add("."), an error of "invalid checksum" is reported.
- BUG: go-git clone is incomplete and Why do I need to pull twice to pull the latest code?
- Cloning to current directory? HOT 8
- Some progress output is hidden when cloning with go-git (as compared to git)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from go-git.