GNOME Bugzilla – Bug 759089
Add a fallback that copies the commit hook in autogen.sh
Last modified: 2015-12-07 14:07:34 UTC
The code below in autogen.sh of gstreamer modules fails when for some reason symbolic links cannot be created. For example, when setting up an uninstalled-setup in a mounted Ubuntu partition in a VM of VirtualBox. # install pre-commit hook for doing clean commits if test ! \( -x .git/hooks/pre-commit -a -L .git/hooks/pre-commit \); then rm -f .git/hooks/pre-commit ln -s ../../common/hooks/pre-commit.hook .git/hooks/pre-commit fi Edited comments from IRC: - The symbolic link is relevant for making patches. It will run the code through gst-indent to check the style/indentation when you run git commit. - Proposed solution: add a fallback that copies the commit hook (explains why Windows dev always get the indent wrong)
Created attachment 316849 [details] [review] Pre-commit: Fallback to copy when symlink does not work On certain filesystems like FAT, NTFS and some network file systems, symlinks are not supported. In those case, installing the pre-commit hook fails and leave developpers with having to run the style checker manually. Instead, fallback to copy. This should enable the commit hook for Windows developpers and users of filesystems that don't support symlinks.
Comment on attachment 316849 [details] [review] Pre-commit: Fallback to copy when symlink does not work Typo in the commit message, it's developers with one p. Otherwise good to go IMHO. Note that symlinks in msys on Windows are implemented somehow.
Attachment 316849 [details] pushed as 86e4663 - Pre-commit: Fallback to copy when symlink does not work