chiark / gitweb /
dot/gitconfig.in: Add a rune for fast-forwarding branches.
authorMark Wooding <mdw@distorted.org.uk>
Tue, 5 May 2020 22:34:38 +0000 (23:34 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Tue, 5 May 2020 22:34:38 +0000 (23:34 +0100)
I type this longhand quite often, and it's gotten old.

dot/gitconfig.in

index 9d23f41ee57cdb0bc74fcb0264590cc52ffd0783..9a55627f1ca244c0b7432668d3b7d83c8f4eab96 100644 (file)
                  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"