eli-schwartz / aurpublish

PKGBUILD management framework for the Arch User Repository
GNU General Public License v2.0
246 stars 18 forks source link

Provide default .gitignore #26

Open MithicSpirit opened 1 year ago

MithicSpirit commented 1 year ago

There should be a default .gitignore provided (if there isn't one already in the directory? we probably don't want to clobber an already-existing .gitignore, but maybe append to an existing one). I usually go with

/*

!/.gitignore
!/PKGBUILD
!/.SRCINFO

which ignores everything in the root project project directory other than what is necessary; the user can manually exclude more files if they wish to keep some file from the sources in the AUR itself (maybe say that in a comment?).

alerque commented 1 year ago

If you are using aurpublish you can just add a couple gitignore patterns to your overall AUR publish repository that covers all subprojects without cluttering up the subtree repos that get pushed to AUR with your personal workflow tooling.

eli-schwartz commented 9 months ago

Yup, I believe the correct way to handle this is to have a global .gitignore for this. I'm not positive what the correct way to handle recommending this to people should be, but I could be persuaded that running setup should create a .gitignore in the overall repository if one doesn't exist, or at least suggest one for you to copy/paste.

Aside: my recommendation would tend to be, you should specify the things to ignore, not the things to not ignore, because you'll want to be able to commit arbitrary named files (including .patch/.diff but also .conf, .desktop, and various other things). What you want to ignore: