chiark / gitweb /
Merge branch 'master' of metalzone:etc/profile
[profile] / gitconfig
index 9a891fcf5500a1220eb17f96eb5b54e036425507..1f002ca673f4f84be943ffcb40cf87958719059c 100644 (file)
--- a/gitconfig
+++ b/gitconfig
@@ -1,3 +1,6 @@
+### -*-conf-*-
+### Git configuration
+
 [core]
        filemode = true
        excludesfile = @gitignore@
        patch = "format-patch -o p -s"
        release = !"sh -e -c ' \
                [ $# -gt 0 ] || { \
-                 echo >&2 \"usage: git release [OPTS] TAG\"; \
+                 echo >&2 \"usage: git release TAG [OPTS]\"; \
                  exit 1; \
                }; \
-               ver=$(eval echo \"\\$$#\"); \
-               git tag -as -m \"Release $ver.\" \"$@\"' release"
+               git tag -as -m \"Release $1.\" \"$@\"' release"
        amend = !"env EDITOR=true VISUAL=true git commit --amend -a"
+       spaces = !"sh -e -c 'git ls-files -z \"$@\"| \
+               xargs -0r space -cv' spaces"
        mailto = "send-email \
                        --quiet \
                        --no-chain-reply-to \
                        --no-signed-off-by-cc \
                        --to"
        files = "ls-files --exclude-standard"
+       unstg = !"sh -e -c ' \
+               : ${GIT_DIR=$(git rev-parse --git-dir)}; \
+               if [ $# -eq 0 ]; then set -- \"$(stg branch)\"; fi; \
+               for branch; do \
+                 rmdir \"$GIT_DIR/patches/$branch/patches\"; \
+                 rm -rf \"$GIT_DIR/patches/$branch\"; \
+                 git for-each-ref -s \
+                   --format \"git update-ref -d %(refname) %(objectname)\" \
+                   \"refs/patches/$branch\" \"refs/bases/$branch\" | \
+                   sh -e; \
+               done' unstg"
 
 [stgit]
        autoresolved = yes