From 27c88c870ba76dab61804a741a490e0abe623dc5 Mon Sep 17 00:00:00 2001 From: Kurtis Rader Date: Mon, 8 Aug 2016 21:01:59 -0700 Subject: [PATCH] tighten the .gitignore patterns I recently made a change to remove some no longer needed .gitignore rules and generally improve the readability of that config file. Contributor @floam noted that this config file was still too permissive and ambiguous. This change adds additional refinements that should a) make it easier for someone to understand why a file/directory is being excluded, and b) make it less likely that a mistake results in a file being inadvertently excluded. --- .gitignore | 98 ++++++++++++++++++++++++++++++------------------------ 1 file changed, 54 insertions(+), 44 deletions(-) diff --git a/.gitignore b/.gitignore index 798beec6e..1e852c51f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,8 @@ +# Note that some of the patterns below should be in an individual's +# ~/.config/git/ignore file. For example, ".DS_Store" for people working on +# macOS (aka OS X). They're included here to minimize the likelihood of such +# artifacts inadvertently getting added to the project. + # File extensions that should never be checked in regardless of which project # directory they reside in. *.exe @@ -5,49 +10,54 @@ *.xccheckout *~ -# Directories that only contain transitory files from building and testing. -DerivedData/ -autom4te.cache/ -build/ -doc/ -obj/ -share/man/ -test/ -user_doc/ - -# File names that can appear in the project root that represent project -# artifacts from building and testing. +# These file names can appear anywhere in the hierarchy. They tend to be OS +# or build system artifacts. .DS_Store -FISH-BUILD-VERSION-FILE -Makefile -command_list.txt -command_list_toc.txt -compile_commands.json -confdefs.h -config.h -config.h.in -config.log -config.status -configure -doc.h -fish -fish.pc -fish_indent -fish_key_reader -fish_tests -lexicon.log -lexicon.txt -lexicon_filter -messages.pot -toc.txt -version -xcodebuild.log -xcuserdata +autom4te.cache -# File names that can appear below the project root that represent project -# artifacts from building and testing. -doc_src/commands.hdr -doc_src/index.hdr -po/*.gmo -share/__fish_build_paths.fish -tests/*.tmp.* +# Directories that only contain transitory files from building and testing. +# They are all at the top level of the project; hence the leading slash. +/DerivedData/ +/build/ +/doc/ +/fish.xcodeproj/ +/obj/ +/share/man/ +/test/ +/user_doc/ + +# File names that can appear in the project root that represent artifacts from +# building and testing. +/FISH-BUILD-VERSION-FILE +/Makefile +/command_list.txt +/command_list_toc.txt +/compile_commands.json +/confdefs.h +/config.h +/config.h.in +/config.log +/config.status +/configure +/doc.h +/fish +/fish.pc +/fish_indent +/fish_key_reader +/fish_tests +/lexicon.log +/lexicon.txt +/lexicon_filter +/messages.pot +/toc.txt +/version +/xcodebuild.log +/xcuserdata + +# File names that can appear below the project root that represent artifacts +# from building and testing. +/doc_src/commands.hdr +/doc_src/index.hdr +/po/*.gmo +/share/__fish_build_paths.fish +/tests/*.tmp.*