]> git.madduck.net Git - code/vcsh.git/blobdiff - vcsh

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Merge branch 'feature--vcsh-commit'
[code/vcsh.git] / vcsh
diff --git a/vcsh b/vcsh
index f2bbd7a229c8211b9d79cb3bb0ee262f54a28eec..85e20d8e6bc3ce41a0f451192a85f8c6e1fba28a 100755 (executable)
--- a/vcsh
+++ b/vcsh
@@ -92,6 +92,7 @@ help() {
    commands:
    clone <remote> \\
          [<repo>]       Clone from an existing repository
+   commit               Commit in all repositories
    delete <repo>        Delete an existing repository
    enter <repo>         Enter repository; spawn new instance of \$SHELL
    help                 Display this help text
@@ -158,6 +159,18 @@ clone() {
        hook post-clone-retired
 }
 
+commit() {
+       hook pre-commit
+       for VCSH_REPO_NAME in $(list); do
+               echo "$VCSH_REPO_NAME: "
+               export GIT_DIR="$VCSH_REPO_D/$VCSH_REPO_NAME.git"
+               use
+               git commit --untracked-files=no --quiet
+               echo
+       done
+       hook post-commit
+}
+
 delete() {
        cd "$VCSH_BASE" || fatal "could not enter '$VCSH_BASE'" 11
        use
@@ -383,7 +396,8 @@ elif [ "$1" = 'delete' ]           ||
        [ "$VCSH_COMMAND" = 'rename' ] && { export VCSH_REPO_NAME_NEW="$3";
                                            export GIT_DIR_NEW="$VCSH_REPO_D/$VCSH_REPO_NAME_NEW.git"; }
        [ "$VCSH_COMMAND" = 'run' ]    && shift 2
-elif [ "$1" = 'list' ] ||
+elif [ "$1" = 'commit' ] ||
+     [ "$1" = 'list' ] ||
      [ "$1" = 'list-tracked' ] ||
      [ "$1" = 'pull' ] ||
      [ "$1" = 'push' ] ||