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

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:

Introduce `vcsh commit`
authorRichard Hartmann <richih.mailinglist@gmail.com>
Wed, 31 Jul 2013 22:16:17 +0000 (00:16 +0200)
committerRichard Hartmann <richih.mailinglist@gmail.com>
Wed, 31 Jul 2013 22:16:17 +0000 (00:16 +0200)
doc/vcsh.1.ronn
vcsh

index ee13b7f4005d5b34360fd14980a6606511eb0db1..b7f9725a9b454cf8cc6c023d595cd3ad9e5cb079 100644 (file)
@@ -81,6 +81,9 @@ an interactive user.
 * clone:
   Clone an existing repository.
 
+* commit:
+  Commit in all repositories
+
 * delete:
   Delete an existing repository.
 
diff --git a/vcsh b/vcsh
index 159feda47f9355a0e7cda30a2797b772d8d54288..1918af44d8cb8f2dafc5c33aae26cb5b007699e6 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
@@ -155,6 +156,18 @@ clone() {
        hook post-clone
 }
 
+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
@@ -351,7 +364,8 @@ elif [ "$1" = 'delete' ]           ||
        [ "$VCSH_COMMAND" = 'rename' ]         && export GIT_DIR_NEW="$VCSH_REPO_D/$3.git"
        [ "$VCSH_COMMAND" = 'run' ] && shift 2
        [ "$VCSH_COMMAND" = 'write-gitignore' ]
-elif [ "$1" = 'list' ] ||
+elif [ "$1" = 'commit' ] ||
+     [ "$1" = 'list' ] ||
      [ "$1" = 'list-tracked' ] ||
      [ "$1" = 'pull' ] ||
      [ "$1" = 'push' ]; then