From b9402bd52dc47ef3b6bf439276ec536fe9ddb18a Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 7 Feb 2011 16:29:13 +0200 Subject: Start with git helper scripts and extra documentation --- git/commit.sh | 20 ++++++++++++++++++++ git/diff.sh | 16 ++++++++++++++++ git/modules | 1 + git/push.sh | 15 +++++++++++++++ git/stash-pop.sh | 15 +++++++++++++++ git/stash.sh | 15 +++++++++++++++ git/stat.sh | 15 +++++++++++++++ git/tag.sh | 20 ++++++++++++++++++++ 8 files changed, 117 insertions(+) create mode 100755 git/commit.sh create mode 100755 git/diff.sh create mode 100644 git/modules create mode 100755 git/push.sh create mode 100755 git/stash-pop.sh create mode 100755 git/stash.sh create mode 100755 git/stat.sh create mode 100755 git/tag.sh (limited to 'git') diff --git a/git/commit.sh b/git/commit.sh new file mode 100755 index 0000000..5c143d4 --- /dev/null +++ b/git/commit.sh @@ -0,0 +1,20 @@ +#! /bin/sh + +# Assume this script never run via PATH. +# +self=`realpath $0` +. `dirname $self`/modules + +if [ "$1" = "" ]; then +echo "missing commit message" 1>&2 +exit 1 +fi + +wd=`pwd` + +for i in $modules; do + cd $i 1>&2 + git add . + git ci -m "$1" + cd $wd +done diff --git a/git/diff.sh b/git/diff.sh new file mode 100755 index 0000000..19737e9 --- /dev/null +++ b/git/diff.sh @@ -0,0 +1,16 @@ +#! /bin/sh + +# Assume this script never run via PATH. +# +self=`realpath $0` +. `dirname $self`/modules + +wd=`pwd` + +for i in $modules; do + echo "diff $i" 1>&2 + cd $i + git --no-pager diff + git --no-pager diff --check + cd $wd +done diff --git a/git/modules b/git/modules new file mode 100644 index 0000000..6f0a4ac --- /dev/null +++ b/git/modules @@ -0,0 +1 @@ +modules="libodb libodb-mysql libodb-tracer libodb-boost odb examples tests etc" diff --git a/git/push.sh b/git/push.sh new file mode 100755 index 0000000..e37d351 --- /dev/null +++ b/git/push.sh @@ -0,0 +1,15 @@ +#! /bin/sh + +# Assume this script never run via PATH. +# +self=`realpath $0` +. `dirname $self`/modules + +wd=`pwd` + +for i in $modules; do + echo "push $i" 1>&2 + cd $i + git push --tags origin master + cd $wd +done diff --git a/git/stash-pop.sh b/git/stash-pop.sh new file mode 100755 index 0000000..be43664 --- /dev/null +++ b/git/stash-pop.sh @@ -0,0 +1,15 @@ +#! /bin/sh + +# Assume this script never run via PATH. +# +self=`realpath $0` +. `dirname $self`/modules + +wd=`pwd` + +for i in $modules; do + echo "stash pop $i" 1>&2 + cd $i + git stash pop + cd $wd +done diff --git a/git/stash.sh b/git/stash.sh new file mode 100755 index 0000000..afc2124 --- /dev/null +++ b/git/stash.sh @@ -0,0 +1,15 @@ +#! /bin/sh + +# Assume this script never run via PATH. +# +self=`realpath $0` +. `dirname $self`/modules + +wd=`pwd` + +for i in $modules; do + echo "stash $i" 1>&2 + cd $i + git stash + cd $wd +done diff --git a/git/stat.sh b/git/stat.sh new file mode 100755 index 0000000..8e90a27 --- /dev/null +++ b/git/stat.sh @@ -0,0 +1,15 @@ +#! /bin/sh + +# Assume this script never run via PATH. +# +self=`realpath $0` +. `dirname $self`/modules + +wd=`pwd` + +for i in $modules; do + echo "stat $i" 1>&2 + cd $i + git stat + cd $wd +done diff --git a/git/tag.sh b/git/tag.sh new file mode 100755 index 0000000..99ba938 --- /dev/null +++ b/git/tag.sh @@ -0,0 +1,20 @@ +#! /bin/sh + +# Assume this script never run via PATH. +# +self=`realpath $0` +. `dirname $self`/modules + +wd=`pwd` + +if [ "$1" = "" ]; then + echo "missing version" 1>&2 + exit 1 +fi + +for i in $modules; do + echo "tag $i" 1>&2 + cd $i + git tag -a $1 -m "Tag version $1" + cd $wd +done -- cgit v1.1