From: Mark Wooding Date: Tue, 5 May 2020 22:34:38 +0000 (+0100) Subject: dot/gitconfig.in: Add a rune for fast-forwarding branches. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/profile/commitdiff_plain/9cacd2663b603a65d07cb8e60935cb3bb13c63ae dot/gitconfig.in: Add a rune for fast-forwarding branches. I type this longhand quite often, and it's gotten old. --- diff --git a/dot/gitconfig.in b/dot/gitconfig.in index 9d23f41..9a55627 100644 --- a/dot/gitconfig.in +++ b/dot/gitconfig.in @@ -105,6 +105,18 @@ 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"