-
Notifications
You must be signed in to change notification settings - Fork 15
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
git operation not respecting gitignore #20
Comments
That's unfortunate! Let's leave this open so we can bump our go-git version when that issue is resolved.
The primary reason it bails out on a dirty tree is that it actually has to checkout the old commit, read its packages, and then re-checkout the original commit, thus leaving no trace. Perhaps there's a safe/clean way to stash the dirty tree, and then unstash it, but I was intentionally trying to be conservative to avoid messing up folks' repos.
The workarounds there, I think, are:
|
Thanks for acknowledging Joe.
I see, that makes sense! I'll have to think about how to clean the tree beforehand, perhaps Yeah we are running it before vendoring :) |
Running into an issue where I'm not sure how I can get the program to run locally. The problem is that I'm not going to commit |
You could try using work trees, that would allow you to check out locally a specific commit to a temporary directory without having to clean anything. |
Respect patterns from ~/.gitignore or core.excludesFile if present. This avoids the "current git tree is dirty" in some circumstances. Fixes joelanford#20 Signed-off-by: Lorenz Bauer <lmb@isovalent.com>
Respect patterns from ~/.gitignore, /etc/gitconfig or core.excludesFile if present. This avoids the "current git tree is dirty" in some circumstances. Fixes joelanford#20 Signed-off-by: Lorenz Bauer <lmb@isovalent.com>
Respect patterns from ~/.gitignore, /etc/gitconfig or core.excludesFile if present. This avoids the "current git tree is dirty" in some circumstances. Fixes #20 Signed-off-by: Lorenz Bauer <lmb@isovalent.com>
Trying to run this locally, it gets stuck because the local repository is considered dirty as it's not parsing the gitignore.
It should also only consider diffing
*.go
files, even if other files are dirty.Another use case is in our CI, we vendor dependencies, so it detects
vendor/
as dirty.go-git/go-git#500
go-git/go-git#387
The text was updated successfully, but these errors were encountered: