From 9f041f96def068c9b2fab7dee670dd2ef6ed1108 Mon Sep 17 00:00:00 2001
From: Philipp Zabel
Date: Thu, 4 Jul 2024 14:44:49 +0200
Subject: [PATCH] umpf: add -l|--local option as a shortcut to use local
branches
Add the -l|--local option as an alias for --remote refs/heads, which
causes umpf to use local branches.
Signed-off-by: Philipp Zabel
---
umpf | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/umpf b/umpf
index c7b5001..656b6d0 100755
--- a/umpf
+++ b/umpf
@@ -187,6 +187,7 @@ usage() {
-p, --patchdir with format-patch: write patches to /
--relative create patches relative to
-r, --remote use to resolve branch names
+ -l, --local use local branches, alias for --remote refs/heads
--override [=]
use commit-ish instead for the topic. May be
specified more than once. If only is
@@ -238,8 +239,8 @@ setup() {
GIT_FALLBACK_REMOTE="${tmp}"
fi
- o="fhisub:n:p:r:v:"
- l="auto-rerere,bb,nix,flags:,force,help,identical,stable,update,base:,name:,patchdir:,relative:,override:,remote:,version:"
+ o="fhilsub:n:p:r:v:"
+ l="auto-rerere,bb,nix,flags:,force,help,identical,stable,update,base:,name:,patchdir:,relative:,override:,remote:,local,version:"
if ! args="$(getopt -n umpf -o "${o}" -l "${l}" -- "${@}")"; then
usage
exit 1
@@ -303,6 +304,9 @@ setup() {
GIT_REMOTE="${1}"
shift
;;
+ -l|--local)
+ GIT_REMOTE="refs/heads"
+ ;;
--override)
IFS="=" read -r topic commitish <<< "${1}"
if [ -n "${commitish}" ]; then