From 7132b43cfd5f742bf6aafe04d10846a6b40cb6ad Mon Sep 17 00:00:00 2001 From: Chatewgne Date: Tue, 24 May 2022 11:51:17 +0200 Subject: [PATCH] Review git hook --- .githooks/pre-push | 2 +- docs/changelog.rst | 2 +- docs/contribute/development.rst | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.githooks/pre-push b/.githooks/pre-push index 23d1ec1bea..bd69fff542 100755 --- a/.githooks/pre-push +++ b/.githooks/pre-push @@ -5,7 +5,7 @@ current_branch=$(git symbolic-ref HEAD | sed -e 's,.*/\(.*\),\1,') if [ $protected_branch = $current_branch ] then - read -p "You're about to push to 'master', is that what you intended? [y|n] " -n 1 -r < /dev/tty + read -p "You're about to push to '$protected_branch', is that what you intended? [y|n] " -n 1 -r < /dev/tty echo if echo $REPLY | grep -E '^[Yy]$' > /dev/null then diff --git a/docs/changelog.rst b/docs/changelog.rst index ccf393aba5..516e8eeb77 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -27,7 +27,7 @@ CHANGELOG **Maintenance** -- Add a git hook to prevent pushing to master. To enable it, developpers should run the following command from root directory : `ln -s -f ../../.githooks/pre-push .git/hooks/pre-push` +- Add a git hook to prevent pushing to master. - Update to paperclip 2.5.0 diff --git a/docs/contribute/development.rst b/docs/contribute/development.rst index e7de37470b..9c6ecf2d7d 100644 --- a/docs/contribute/development.rst +++ b/docs/contribute/development.rst @@ -31,7 +31,7 @@ Conventions * KISS & DRY as much as possible * Elegant and generic is good, simple is better * Commits messages are explicit and mention issue number (``(ref #12)`` or ``(fixes #23)``) -* Features are developed in a branch and merged from Github pull-requests. +* Features are developed in a branch and merged from Github pull-requests. A git hook to is available to prevent pushing to master, to enable it, developpers should run the following command from root directory (`Geotrek-admin/`) : `ln -s -f ../../.githooks/pre-push .git/hooks/pre-push` Definition of done