[pitivi/1.0] bin: Install the pre-commit hook when entering the dev env



commit 6183f0889e6517091f27959d2c154489dc04fd18
Author: Alexandru Băluț <alexandru balut gmail com>
Date:   Thu Dec 7 01:30:55 2017 +0100

    bin: Install the pre-commit hook when entering the dev env
    
    Until 05b3aee5ffded84d2c7d4a7f9e2dca4eda8942ef it was installed at
    configure time. Now it's installed when entering the dev env.
    
    Reviewed-by: Thibault Saunier <tsaunier gnome org>
    Differential Revision: https://phabricator.freedesktop.org/D1905

 bin/pitivi-env |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)
---
diff --git a/bin/pitivi-env b/bin/pitivi-env
index 8ae05df..604d5bd 100755
--- a/bin/pitivi-env
+++ b/bin/pitivi-env
@@ -15,6 +15,7 @@ SCRIPT_DIR=$(dirname $(realpath $SCRIPT))
 PITIVI_REPO_DIR=$(realpath $SCRIPT_DIR/..)
 export FLATPAK_ENVPATH=$(realpath $PITIVI_REPO_DIR/..)
 export CURRENT_GST=$FLATPAK_ENVPATH
+export PATH="$FLATPAK_ENVPATH/bin/:$PATH"
 
 # Use ptvenv for entering or running commands in the sandbox.
 alias ptvenv="$PITIVI_REPO_DIR/build/flatpak/pitivi-flatpak -d"
@@ -55,9 +56,16 @@ then
 
     alias pitivi="ptvenv $PITIVI_REPO_DIR/bin/pitivi"
 
+    # Enter the Python virtual env to have specific dev tools,
+    # such as git-phab, pre-commit, etc.
     source $PITIVI_REPO_DIR/build/flatpak/pyvenv/bin/activate
+
+    # Install the pre-commit framework as a git hook, for doing clean commits.
+    rm -f .git/hooks/pre-commit
+    ln -s ../../pre-commit.hook .git/hooks/pre-commit
+
+    # Update the prompt to indicate this is the Pitivi dev env.
     export PS1="(ptv-flatpak) $PS1"
-    export PATH="$FLATPAK_ENVPATH/bin/:$PATH"
 
     echo "===================================================================="
     echo "                   BATTLECRUISER OPERATIONAL                        "


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]