dot/gitconfig.in: Push the current branch only by default.
[profile] / dot / gitconfig.in
index 9d95d2a..17cf5ae 100644 (file)
@@ -41,7 +41,7 @@
        autosquash = true
 
 [push]
-       default = matching
+       default = upstream
        followTags = true
 
 [format]
@@ -80,9 +80,6 @@
        local = normal
        remote = cyan
 
-[color "grep"]
-       external = --color=always
-
 [column]
        ui = auto column dense
 
        diff = perl /usr/share/doc/git/contrib/diff-highlight/diff-highlight | mdw-pager
 
 [alias]
+       do = "!sh -e -c ' \
+               quiet=; \
+               case $#,$1 in 0, | *,*,*) ;; *,-q) quiet=--quiet; shift ;; esac; \
+               case $quiet in ?*) ;; *) echo \"Entering toplevel\" ;; esac; \
+               (name=\"<toplevel>\"; path=.; toplevel=$(pwd); \
+                sha1=$(git rev-parse HEAD); \
+                set +e; case $# in 1) eval \"$1\" ;; *) \"$@\" ;; esac); \
+               exec git submodule $quiet foreach --recursive \"$@\"' do"
        egrep = "grep -E"
        graph = "log --pretty=oneline --abbrev-commit --graph"
        release = !"sh -e -c ' \
                  exit 1; \
                }; \
                git tag -as -m \"Release $1.\" \"$@\"' release"
+       catchup = !"perl -e ' \
+               use autodie qw(:all); \
+               if (@ARGV < 2) { \
+                 print STDERR \"git catchup REMOTE REF ...\n\"; \
+                 exit 2; \
+               } \
+               @c = (); $m = shift @ARGV; \
+               for my $r (@ARGV) { \
+                 my ($p, $r) = $r =~ /^([+]*)(.*)$/; \
+                 push @c, \"$p$m/$r:$r\"; \
+               } \
+               exec \"git\", \"push\", \".\", @c'"
        amend = !"env EDITOR=true VISUAL=true git commit --amend -a"
        spaces = !"sh -e -c 'git ls-files -z \"$@\"| \
                xargs -0r space -cv' spaces"