From b7e2019eeed38d3b22f07c51aac8578fd53c9bee Mon Sep 17 00:00:00 2001 From: Owen Jacobson Date: Wed, 13 Dec 2023 21:39:47 -0500 Subject: Move aliases to scripts. The git aliases mechanism is pretty limited; there's some stuff you can't really do without dropping to a shell. If you're going to do that, then custom subcommand scripts are more flexable than aliases that start with ! are. --- bin/git-squash | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 bin/git-squash (limited to 'bin/git-squash') diff --git a/bin/git-squash b/bin/git-squash new file mode 100755 index 0000000..26c363c --- /dev/null +++ b/bin/git-squash @@ -0,0 +1,14 @@ +#!/bin/bash -e + +# Retrofit changes onto an old commit during the next rebase/rewrite, +# adding an additional comment `git squash COMMITISH` (for example, +# `git squash HEAD`). + +COMMIT=HEAD +if [ $# -gt 0 ]; then + COMMIT="$1" + shift +fi + + +exec git commit --squash "${COMMIT}" "$@" -- cgit v1.2.3