Navigation Menu

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

.gitignore: Remove cruft and editor/OS-specific ignore files #21458

Open
kevinburke opened this issue Aug 15, 2017 · 5 comments
Open

.gitignore: Remove cruft and editor/OS-specific ignore files #21458

kevinburke opened this issue Aug 15, 2017 · 5 comments
Labels
NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@kevinburke
Copy link
Contributor

kevinburke commented Aug 15, 2017

Here's the current contents of the .gitignore file for the Go project.

.DS_Store
*.[56789ao]
*.a[56789o]
*.so
*.pyc
._*
.nfs.*
[56789a].out
*~
*.orig
*.rej
*.exe
.*.swp
core
*.cgo*.go
*.cgo*.c
_cgo_*
_obj
_test
_testmain.go

/VERSION.cache
/bin/
/build.out
/doc/articles/wiki/*.bin
/goinstall.log
/last-change
/misc/cgo/life/run.out
/misc/cgo/stdio/run.out
/misc/cgo/testso/main
/pkg/
/src/*.*/
/src/cmd/cgo/zdefaultcc.go
/src/cmd/go/internal/cfg/zdefaultcc.go
/src/cmd/go/internal/cfg/zosarch.go
/src/cmd/internal/objabi/zbootstrap.go
/src/go/build/zcgo.go
/src/go/doc/headscan
/src/runtime/internal/sys/zversion.go
/src/unicode/maketables
/test.out
/test/garbage/*.out
/test/pass.out
/test/run.out
/test/times.out

# IntelliJ-based editors
/.idea/

Many of those, like .idea and .DS_Store, are not specific to the Go project - they're specific to a user's environment or to an OS. There are large number of user-specific files that get placed in directories that we might need to exclude; we can't enumerate the list, and it also seems useful to teach users how to solve this problem for themselves.

Git has a tool for dealing with files you'd like to (privately) ignore. You can edit the .git/info/exclude file to privately ignore any files you don't want to commit to the project. You can also create a global .gitignore file for your computer to ignore those files in every Git repository on your machine, described here: https://help.github.com/articles/ignoring-files/#create-a-global-gitignore.

Finally, you can create a Git template to automatically populate the contents of .gitignore whenever a new Git repository is created, as described here: https://stackoverflow.com/a/16658321/329700

I'd like to propose that we put the above instructions in the .gitignore file and then remove all of the user and OS-specific ignore directives; the ignore file should only include artifacts that are generated by the Go project that we'd rather not check in.

@jessfraz
Copy link
Contributor

seems sane to me to keep only the repo specific ones

@martisch
Copy link
Contributor

martisch commented Aug 15, 2017

If .DS_Store will be removed i think .nfs.* , *.swp would fall into the removal category of os/env specific files too.

@gopherbot
Copy link

Change https://golang.org/cl/55871 mentions this issue: .gitignore: include only Go project artifiacts

gopherbot pushed a commit that referenced this issue Aug 15, 2017
This effectively reverts

https://golang.org/cl/53770

and adds a guide on what not to add in this file.

Update #21458

Change-Id: I7c740d492b70628b5d9f9e1622014995a3f6f8ec
Reviewed-on: https://go-review.googlesource.com/55871
Reviewed-by: Ian Lance Taylor <iant@golang.org>
@ianlancetaylor
Copy link
Contributor

Is there anything else to do here?

@ianlancetaylor ianlancetaylor added the NeedsFix The path to resolution is known, but the work has not been done. label Mar 30, 2018
@ianlancetaylor ianlancetaylor added this to the Unplanned milestone Mar 30, 2018
@agnivade
Copy link
Contributor

We still have .DS_Store which @kevinburke wanted to remove.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

6 participants