[libvirt] [RFC] maint: forbid most files without extension

* .gitignore: Add rule that requires . in name, then add exemptions. --- Given Chris' recent accident in committing a binary file, then blasting the list with it, here's a (hack) approach to prevent a relapse in the future. It assumes that non-binary files either have an extension, or are easy enough to enumerate. Personally, I do NOT want to apply this patch. It has the nasty side-effect of rendering .git/info/exclude useless (git unfortunately stops processing ignore rules once it finds an explicit accept rule, so any reject rules in .git/info/exclude for files containing '.' are overruled as accepts by this patch). Hence, this is only an RFC, documenting my thought process. .gitignore | 38 ++++++++++++++++++++++++++++++++++++++ 1 files changed, 38 insertions(+), 0 deletions(-) diff --git a/.gitignore b/.gitignore index a7466fd..7d2bce3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,41 @@ +# To reduce likelihood of committing binaries, require that a '.' be +# in all non-directories, then add exceptions as needed. +* +!*.* +!/AUTHORS +!/ChangeLog-old +!/HACKING +!README +!TODO +!/bootstrap +!/examples/apparmor/TEMPLATE +!/examples/apparmor/libvirt-qemu +!/tests/capabilityschematest +!/tests/cpuset +!/tests/daemon-conf +!/tests/define-dev-segfault +!/tests/domainschematest +!/tests/int-overflow +!/tests/interfaceschematest +!/tests/libvirtd-fail +!/tests/libvirtd-pool +!/tests/networkschematest +!/tests/nodedevschematest +!/tests/nwfilterschematest +!/tests/qemuhelpdata/kvm-74 +!/tests/qemuhelpdata/kvm-86 +!/tests/read-bufsiz +!/tests/read-non-seekable +!/tests/start +!/tests/storagepoolschematest +!/tests/storagevolschematest +!/tests/undefine +!/tests/vcpupin +!/tests/virsh-all +!/tests/virsh-synopsis +!/tests/virt-aa-helper-test + +# Other files to exclude *#*# *.#*# *.a -- 1.6.6.1

On Tue, Apr 13, 2010 at 02:11:55PM -0600, Eric Blake wrote:
* .gitignore: Add rule that requires . in name, then add exemptions. ---
Given Chris' recent accident in committing a binary file, then blasting the list with it, here's a (hack) approach to prevent a relapse in the future. It assumes that non-binary files either have an extension, or are easy enough to enumerate.
Personally, I do NOT want to apply this patch. It has the nasty side-effect of rendering .git/info/exclude useless (git unfortunately stops processing ignore rules once it finds an explicit accept rule, so any reject rules in .git/info/exclude for files containing '.' are overruled as accepts by this patch). Hence, this is only an RFC, documenting my thought process.
I don't think its really worth it myself. I prefer to have too little in the .gitignore file, than too much, since it ensures you'll spot files you haven't added to the commit. Chris' patch was actually blocked by mailman, but someone else approved it before I could reject it ! Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://deltacloud.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

On Wed, Apr 14, 2010 at 11:18:47AM +0100, Daniel P. Berrange wrote:
On Tue, Apr 13, 2010 at 02:11:55PM -0600, Eric Blake wrote:
* .gitignore: Add rule that requires . in name, then add exemptions. ---
Given Chris' recent accident in committing a binary file, then blasting the list with it, here's a (hack) approach to prevent a relapse in the future. It assumes that non-binary files either have an extension, or are easy enough to enumerate.
Personally, I do NOT want to apply this patch. It has the nasty side-effect of rendering .git/info/exclude useless (git unfortunately stops processing ignore rules once it finds an explicit accept rule, so any reject rules in .git/info/exclude for files containing '.' are overruled as accepts by this patch). Hence, this is only an RFC, documenting my thought process.
I don't think its really worth it myself. I prefer to have too little in the .gitignore file, than too much, since it ensures you'll spot files you haven't added to the commit.
Chris' patch was actually blocked by mailman, but someone else approved it before I could reject it !
I made the mistake, I went directly to the web front-end and didn't see the binary chunk :-\ Daniel -- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ daniel@veillard.com | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/
participants (4)
-
Chris Lalancette
-
Daniel P. Berrange
-
Daniel Veillard
-
Eric Blake