aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2017-09-16 19:41:33 -0300
committerSilvio Rhatto <rhatto@riseup.net>2017-09-16 19:41:33 -0300
commit926005cf2b2f59f2831c4c292da90d0e136b7c4c (patch)
tree495f033f87f2ce2fa53538cf9dfe930d323e0b9b
parentf353440268647fc4d600ac71f0706cc9e54c2168 (diff)
downloadutils-git-926005cf2b2f59f2831c4c292da90d0e136b7c4c.tar.gz
utils-git-926005cf2b2f59f2831c4c292da90d0e136b7c4c.tar.bz2
Misc fixes
-rwxr-xr-xcommit2
-rwxr-xr-xcommit-updates4
-rwxr-xr-xhit17
3 files changed, 13 insertions, 10 deletions
diff --git a/commit b/commit
index 0b998b0..f139650 100755
--- a/commit
+++ b/commit
@@ -139,7 +139,7 @@ function git_commit {
flag="-a"
fi
- $GIT commit $flag -m "$params"
+ $GIT commit $flag -m "$params" || exit 1
}
# Main
diff --git a/commit-updates b/commit-updates
index 2a71c1d..9fe77d7 100755
--- a/commit-updates
+++ b/commit-updates
@@ -11,10 +11,10 @@ GIT="hit"
# Check if param is a project
if [ ! -z "$PROJECT" ] && [ -z "$2" ] && ( cd $PROJECT &> /dev/null ); then
- if ! git status &> /dev/null; then
+ if ! $GIT status &> /dev/null; then
cd $PROJECT &> /dev/null
shift
- elif ! git status $PROJECT | grep -q "$PROJECT (new commits)"; then
+ elif ! $GIT status $PROJECT | grep -q "$PROJECT (new commits)"; then
cd $PROJECT &> /dev/null
shift
fi
diff --git a/hit b/hit
index 7f24226..c49e69c 100755
--- a/hit
+++ b/hit
@@ -5,15 +5,17 @@
# Main features:
#
# * Disables/mitigates hooks by changing permission and ownership on `~/.git/hooks`.
+# * Runs git through firejail if it's available.
#
# Other features to consider:
#
-# * Checks proper user/email config.
-# * Automatically sets git-flow when initializing a repository.
-# * Automatically sets git-hooks integration.
-# * Implements global hooks.
-# * Checks remote configuration.
-# * Checks hook tampering before doing anything in the repository, like removing hook permissions
+# * Check proper user/email config.
+# * Automatically set git-flow when initializing a repository.
+# * Automatically set git-hooks integration.
+# * Allow hook whitelisting.
+# * Implement global hooks like using a global init.templateDir config.
+# * Check remote configuration.
+# * Check hook tampering before doing anything in the repository, like removing hook permissions.
# Parameters
BASENAME="`basename $0`"
@@ -53,4 +55,5 @@ fi
#
# Call git
#
-$GIT $*
+# https://stackoverflow.com/questions/1668649/how-to-keep-quotes-in-args/1669548#1669548
+$GIT "$@"