-
Notifications
You must be signed in to change notification settings - Fork 101
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
cleaning .gitignore #740
cleaning .gitignore #740
Conversation
39079d7
to
bac0ad7
Compare
Good points @jkremser, gitignore in this case is generated by https://www.toptal.com/developers/gitignore (which was partly last time too). Only the end of the file (custom section) contains custom rules. |
just for curioucity, is it just IDE runs git add . when handling git? Never had a usecase for git ignore except goreleaser when it requires clean state to perform a release (but IIRC this only relates to tracked files) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kuritka I think it makes sense to follow the YAGNI (You Ain't Gonna Need It) principle here and leave only those filters that are relevant to the k8gb project nature and the tooling it uses.
So I would not add auto-generated filters at all, but instead, even further remove unnecessary ones, if we talk about .gitignore
cleaning.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will second @somaritane here. Let's put only project-related entries into .gitignore
bac0ad7
to
5338ccf
Compare
.gitignore optimized |
chart/k8gb/charts/*.tgz | ||
|
||
# Ignore testing kubeconfigs | ||
kubeconfig* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we please leave it around? I'm using it for testing over multiple clusters from time to time avoiding tampering the main kubeconfig
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ytsarev This looks like a user-specific, not project-specific thing :) i.e. you can export KUBECONFIG=
to point to any kubeconfig
path of your like, shouldn't be necessary lying in the k8gb working copy. Or am I missing something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@somaritane looks like project creator specific thing yes ;) it is just two lines to speed up my productivity, I am not asking for too much, I think :)
Re kubeconfigs - I prefer to temporary keep them to the project under test, the matter of convenience
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@somaritane following the same logic, you could also use vim and we could drop .vscode
and .idea
;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also kubeconfigs are somehow related to k8s operator project :D Sorry, now I will not give it up so easily :D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@somaritane works for me, i will sacrifice my kubeconfigs for that :D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am also in favor of removing IDE specific settings, I left it there more because for most contributors this is too confusing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pls keep .idea
& .vscode
also there, I have both in my global .gitignore
, but still if it's not there it makes contributing (for external ppl w/ random editors) harder. The chances of using either vs code or idea are pretty high these days
I don't see anything wrong w/ putting ide specific one-liners for IGNORING the configs (like .idea
) what seemed weird to me were those !.vscode/tasks.json
"keep-ide-specific-stuff-in-repo" rules
btw. I had to add those two specific rules to my .gitignore
to be able to work comfortly w/ k8gb:
...
/.custom-env/* ... custom env files that can be consumed by debug/run configurations in goland
/k8gb ... binary file we produce when doing `go build`
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just in case, if we leave the DenyListing .gitignore and switch to AllowListing .gitignore instead, we will only allow what is actually part of the project.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The chances of using either vs code or idea are pretty high these days
@jkremser This statement is subjective without stats :).
I just hope that If we leave .gitignore
for vim, idea, vscode, then we're ready to accept PRs to add emacs, sublime, atom, eclipse, komodo etc (sits pretty well in random editor category with Golang support available) on request in the future, denying such requests would be unfair.
But as I said, if I have my IDE of choice, asking every single project to include it in its .gitignore
won't scale.
5338ccf
to
19b63bb
Compare
b0c2753
to
5bb9d47
Compare
please try the local branch to see if everything works as expected. Because things in .gitignore were repetitive and didn't make much sense, I refactored .gitignore. - We stayed in denyList mode. - ~~It has two sections~~ - ~~the first section is generated by [toptal.com](https://www.toptal.com/developers/gitignore) for vim,go,goland,visualstudiocode,emacs,jekyll~~ - ~~the second section follows the first one and is for custom rules of our project.~~ Signed-off-by: kuritka <[email protected]>
5bb9d47
to
aded99c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.*.sw[a-p] | ||
# session | ||
*.sw[ap] | ||
k8gb |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
btw. I had to add those two specific rules to my .gitignore to be able to work comfortly w/ k8gb:
@kuritka I think we should add k8gb
to .gitignore
because this is project-specific thing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kuritka sorry, didn't see k8gb
binary is already included.
Thanks a lot for the tremendous effort, LGTM! 👍
please try the local branch to see if everything works as expected. Because things in .gitignore were repetitive and didn't make much sense, I refactored .gitignore. - We stayed in denyList mode. - ~~It has two sections~~ - ~~the first section is generated by [toptal.com](https://www.toptal.com/developers/gitignore) for vim,go,goland,visualstudiocode,emacs,jekyll~~ - ~~the second section follows the first one and is for custom rules of our project.~~ Signed-off-by: kuritka <[email protected]> Signed-off-by: Jirka Kremser <[email protected]>
please try the local branch to see if everything works as expected.
Because things in .gitignore were repetitive and didn't make much sense, I refactored .gitignore.
It has two sectionsthe first section is generated by toptal.com for vim,go,goland,visualstudiocode,emacs,jekyllthe second section follows the first one and is for custom rules of our project.Signed-off-by: kuritka [email protected]