puppetlabs / pdk-templates

The main template repo for the Puppet Development Kit https://github.com/puppetlabs/pdk
Apache License 2.0
46 stars 142 forks source link

Add emacs and vi temporary files to the default .gitignore #308

Closed llowder closed 4 years ago

llowder commented 4 years ago

Use Case

emacs and vi are still often used for working with modules, so the temp files these editors create should be in the .gitignore

Describe the Solution You Would Like

Add entries to the default .gitignore for emacs and vi. Possible set for for vi:

[._]*.s[a-v][a-z]
[._]*.sw[a-p]
[._]s[a-rt-v][a-z]
[._]ss[a-gi-z]
[._]sw[a-p]
Session.vim
Sessionx.vim
.netrwhist
*~
tags
[._]*.un~

possible set for emacs:

# -*- mode: gitignore; -*-
*~
\#*\#
/.emacs.desktop
/.emacs.desktop.lock
*.elc
auto-save-list
tramp
.\#*
.org-id-locations
*_archive
*_flymake.*
/eshell/history
/eshell/lastdir
/elpa/
*.rel
/auto/
.cask/
dist/
flycheck_*.el
/server/
.projectile
.dir-locals.el
/network-security.data
scotje commented 4 years ago

We feel that since these files are not intrinsic to Puppet development, they would probably be better applied in the user- or system-level .gitignore.

From the Git documentation:

Patterns which a user wants Git to ignore in all situations (e.g., backup or temporary files generated by the user’s editor of choice) generally go into a file specified by core.excludesFile in the user’s ~/.gitconfig. Its default value is $XDG_CONFIG_HOME/git/ignore. If $XDG_CONFIG_HOME is either not set or empty, $HOME/.config/git/ignore is used instead.