After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 759089 - Add a fallback that copies the commit hook in autogen.sh
Add a fallback that copies the commit hook in autogen.sh
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other Linux
: Normal normal
: 1.7.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-12-06 15:14 UTC by Francisco Velazquez
Modified: 2015-12-07 14:07 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Pre-commit: Fallback to copy when symlink does not work (1.33 KB, patch)
2015-12-06 17:30 UTC, Nicolas Dufresne (ndufresne)
committed Details | Review

Description Francisco Velazquez 2015-12-06 15:14:42 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)
Comment 1 Nicolas Dufresne (ndufresne) 2015-12-06 17:30:49 UTC
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 2 Sebastian Dröge (slomo) 2015-12-07 11:45:37 UTC
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.
Comment 3 Nicolas Dufresne (ndufresne) 2015-12-07 14:07:21 UTC
Attachment 316849 [details] pushed as 86e4663 - Pre-commit: Fallback to copy when symlink does not work