Skip to content

Commit

Permalink
umpf: add -l|--local option as a shortcut to use local branches
Browse files Browse the repository at this point in the history
Add the -l|--local option as an alias for --remote refs/heads, which
causes umpf to use local branches.

Signed-off-by: Philipp Zabel <[email protected]>
  • Loading branch information
pH5 committed Jul 4, 2024
1 parent c2580a2 commit 9f041f9
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions umpf
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ usage() {
-p, --patchdir <path> with format-patch: write patches to <path>/
--relative <path> create patches relative to <path>
-r, --remote <remote> use <remote> to resolve branch names
-l, --local use local branches, alias for --remote refs/heads
--override <topic>[=<commit-ish>]
use commit-ish instead for the topic. May be
specified more than once. If only <topic> is
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 9f041f9

Please sign in to comment.