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

git clean is destructive and undocumented #62

Open
nojnhuh opened this issue May 1, 2024 · 0 comments
Open

git clean is destructive and undocumented #62

nojnhuh opened this issue May 1, 2024 · 0 comments

Comments

@nojnhuh
Copy link

nojnhuh commented May 1, 2024

I have some gitignored local configuration I maintain locally in the same directory as a git repo. Running go-apidiff irrecoverably deletes all of those files because of the git clean it does here:

go-apidiff/pkg/diff/run.go

Lines 199 to 201 in 00f8d2e

if err := wt.Clean(&git.CleanOptions{Dir: true}); err != nil {
return nil, nil, err
}

This behavior is destructive and essentially impossible to know about until it's too late. This behavior should be documented and put behind a descriptive flag like --force-clean.

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

No branches or pull requests

1 participant