Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Cleaning up code and output.

  • Loading branch information...
commit 3c8936559b363512be7055502ce55fb29354e60f 1 parent 37756d9
Manuel Koller authored
View
2  git-attach-head
@@ -27,7 +27,7 @@ fi
## TODO: do some error checking?
## stop if HEAD is a ref already
-if git symbolic-ref HEAD 2> /dev/null ; then
+if git symbolic-ref -q HEAD > /dev/null ; then
exit 0
fi
View
2  git-ccommit
@@ -53,7 +53,7 @@ fi
if [[ "$@" == *--allow-empty* ]] || ([ $a -eq 1 ] && ! git check-clean --unstaged --unmerged --exit-code --ignore-submodules=dirty) || ! git check-clean --uncommitted --exit-code --ignore-submodules=dirty;
then
## check for detached head
- if ! git symbolic-ref HEAD 2> /dev/null ; then
+ if ! git symbolic-ref -q HEAD > /dev/null ; then
echo "Error in $PWD:"
echo " Refused to commit in detached head state. Use \"git rcheckout <branchname>\" to attach HEAD. List branches with \"git branch -v\"."
exit 1
View
4 git-check-branch
@@ -17,12 +17,12 @@ EOF
exit 0;
fi
-if ! git symbolic-ref HEAD 2> /dev/null ; then
+if ! git symbolic-ref -q HEAD > /dev/null ; then
## detached head cannot be remote tracking branch...
## ...but: if there are no new commits, we can safely ignore this
## FIXME: this test only succeed if the new commit is actually
## checked out
- if [[ $(git diff origin... --quiet || echo "FAIL") == "FAIL" ]]; then
+ if ! git diff origin... --quiet; then
echo "Error in $PWD:"
echo " Detached head and new commits. Attach the HEAD by creating"
echo " a new branch or risk losing the commits."
View
1  git-rcheckout
@@ -25,7 +25,6 @@ fi
git check-clean || exit 1
## do the checkout
-## git pull --recurse-submodules (does not work)
git checkout "$@" || exit 1
## fix submodule
git fix-submodules --skip-checks
View
3  git-rpull
@@ -25,7 +25,7 @@ fi
## check for modified content and uncommitted changes
git check-clean --ignore-submodules=untracked --unstaged --uncommitted --unmerged || exit 1
## check for untracked files
-if [[ $(git check-clean --untracked --unstaged --exit-code || echo "FAIL") == "FAIL" ]]; then
+if ! git check-clean --untracked --unstaged --exit-code; then
cat<<EOF
Error: Untracked files in submodules. Add them to .gitignore
in the respective submodules or remove them.
@@ -50,7 +50,6 @@ fi
## git check-unpushed # no need to check in master
## do the pull
-## git pull --recurse-submodules (does not work)
git pull || exit 1
if [ -f .gitmodules ]; then
View
2  git-rpush
@@ -23,7 +23,7 @@ fi
## check for modified content and uncommitted changes
git check-clean --ignore-submodules=untracked --unstaged --uncommitted --unmerged || exit 1
## check for untracked files
-if [[ $(git check-clean --untracked --unstaged --exit-code || echo "FAIL") == "FAIL" ]]; then
+if ! git check-clean --untracked --unstaged --exit-code; then
cat<<EOF
Warning: Untracked files in submodules. Add them to .gitignore
in the respective submodules or remove them.
Please sign in to comment.
Something went wrong with that request. Please try again.