Skip to content
This repository has been archived by the owner on Jun 19, 2023. It is now read-only.

Commit

Permalink
Ensure all flags have a short variant
Browse files Browse the repository at this point in the history
macOS/BSD getopt does not allow for long flag variants without
installing gnu-getopt. This makes it hard to bundle git-flow with
applications, since you usually can't bundle gnu-getopt with them.
To address this, a short variant has been added for each command.
  • Loading branch information
eaigner committed Jul 1, 2021
1 parent 40fc2df commit 11d1361
Show file tree
Hide file tree
Showing 9 changed files with 130 additions and 126 deletions.
53 changes: 27 additions & 26 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -6,37 +6,30 @@ and logs, available at
http://github.com/petervanderdoes/gitflow.


Peter van der Does
Vincent Driessen
Daniel Dehennin
Benedikt Böhm
Leonid Komarovsky
Felipe Talavera
Randy Merrill
Kevin Woo
Daniel Truemper
Eric J. Holmes
Fred Condo
Alexandre Dutra
Andreas Heiduk
Ben Loveridge
Florian Gamböck
Gergely Nagy
JP Toto
Kiall Mac Innes
Lorin Hochstein
Olivier Mengué
Oppodelldog
Stefan Näwe
Adam Gibbins
Alexander Groß
Alexander Norström
Alexander Zeitler
Alexandre Dutra
Andreas Heiduk
Ben Loveridge
Benedikt Böhm
Brian St. Pierre
Cararus Eugeniu
Chad Walker
Craig Fowler
Daniel Dehennin
Daniel Truemper
eddie cianci
Emre Berge Ergenekon
Eric J. Holmes
Erik Aigner
Felipe Talavera
Florian Gamböck
Fred Condo
Gergely Nagy
gmallard
gpongelli
Gregor A. Cieslak
Gruen Christian-Rolf (Kiki)
Guillaume-Jean Herbiet
Expand All @@ -50,32 +43,40 @@ John Sivak
Jon Bernard
Joseph A. Levin
Joshua P. Tilles
JP Toto
Juan Rial
Justin Penney
Kevin Woo
Kiall Mac Innes
Konstantin Tjuterev
Kridsada Thanabulpong
Leonardo Giordani
Leonid Komarovsky
Lorin Hochstein
Luis Fernando Gomes @luiscoms
Mark Borcherding
Mark Derricutt
Mateusz Kaczmarek
Matias Hernan Lauriti
Mayerber Carvalho Neto
Nowell Strite
Olivier Mengué
Opher Vishnia
Oppodelldog
Peter Schröder
Peter van der Does
Pokey Rule
Randy Merrill
raybec
Stefan Näwe
Stefan Schüßler
Steffen Jaeckel
Steve Mao
Steve Streeting
Tacit Sawk
Vedang Manerikar
Vincent Driessen
Zheeeng
eddie cianci
gmallard
gpongelli
raybec


Portions of the project are derived from other open source works are clearly
Expand Down
2 changes: 1 addition & 1 deletion git-flow
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ main() {
. "$GITFLOW_DIR/gitflow-common"

# allow user to request git action logging
DEFINE_boolean 'showcommands' false 'Show actions taken (git commands)'
DEFINE_boolean 'showcommands' false 'Show actions taken (git commands)' q
# but if the user prefers that the logging is always on,
# use the environmental variables.
gitflow_override_flag_boolean 'showcommands' 'showcommands'
Expand Down
20 changes: 10 additions & 10 deletions git-flow-bugfix
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ git flow bugfix start [-h] [-F] <name> [<base>]
Start new bugfix <name>, optionally basing it on <base> instead of <develop>
--
h,help! Show this help
showcommands! Show git commands while executing them
q,showcommands! Show git commands while executing them
F,[no]fetch Fetch from origin before performing local operation
"
local base
Expand Down Expand Up @@ -241,7 +241,7 @@ git flow bugfix finish [-h] [-F] [-r] [-p] [-k] [-D] [-S] [--no-ff] <name|namepr
Finish bugfix <name>
--
h,help! Show this help
showcommands! Show git commands while executing them
q,showcommands! Show git commands while executing them
F,[no]fetch Fetch from origin before performing finish
r,[no]rebase Rebase before merging
p,[no]preserve-merges Preserve merges while rebasing
Expand Down Expand Up @@ -507,7 +507,7 @@ Publish bugfix branch <name> on $ORIGIN.
When <name> is omitted the current branch is used, but only if it's a bugfix branch.
--
h,help! Show this help
showcommands! Show git commands while executing them
q,showcommands! Show git commands while executing them
"
# Parse arguments
parse_args "$@"
Expand Down Expand Up @@ -548,7 +548,7 @@ git flow bugfix track [-h] <name>
Start tracking bugfix <name> that is shared on $ORIGIN
--
h,help! Show this help
showcommands! Show git commands while executing them
q,showcommands! Show git commands while executing them
"
# Parse arguments
parse_args "$@"
Expand Down Expand Up @@ -583,7 +583,7 @@ git flow bugfix diff [-h] [<name|nameprefix>]
Show all changes in <name> that are not in the base
--
h,help! Show this help
showcommands! Show git commands while executing them
q,showcommands! Show git commands while executing them
"
local base

Expand All @@ -608,7 +608,7 @@ git flow bugfix checkout [-h] [<name|nameprefix>]
Switch to bugfix branch <name>
--
h,help! Show this help
showcommands! Show git commands while executing them
q,showcommands! Show git commands while executing them
"
# Parse arguments
parse_args "$@"
Expand All @@ -632,7 +632,7 @@ git flow bugfix rebase [-h] [-i] [-p] [<name|nameprefix>]
Rebase <name> on <base_branch>
--
h,help! Show this help
showcommands! Show git commands while executing them
q,showcommands! Show git commands while executing them
i,[no]interactive Do an interactive rebase
p,[no]preserve-merges Preserve merges
"
Expand Down Expand Up @@ -695,7 +695,7 @@ git flow bugfix pull [-h] <remote> [<name>]
Pull bugfix <name> from <remote>
--
h,help! Show this help
showcommands! Show git commands while executing them
q,showcommands! Show git commands while executing them
"
local current_branch

Expand Down Expand Up @@ -764,7 +764,7 @@ git flow bugfix delete [-h] [-f] [-r] <name>
Delete a given bugfix branch
--
h,help! Show this help
showcommands! Show git commands while executing them
q,showcommands! Show git commands while executing them
f,[no]force Force deletion
r,[no]remote Delete remote branch
"
Expand Down Expand Up @@ -836,7 +836,7 @@ git flow bugfix rename <new_name> [<new_name>]
Rename a given bugfix branch
--
h,help! Show this help
showcommands! Show git commands while executing them
q,showcommands! Show git commands while executing them
"
gitflow_rename_branch "$@"
}
39 changes: 20 additions & 19 deletions git-flow-feature
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ git flow feature start [-h] [-F] <name> [<base>]
Start new feature <name>, optionally basing it on <base> instead of <develop>
--
h,help! Show this help
showcommands! Show git commands while executing them
q,showcommands! Show git commands while executing them
F,[no]fetch Fetch from origin before performing local operation
"
local base
Expand Down Expand Up @@ -241,32 +241,33 @@ git flow feature finish [-h] [-F] [-r] [-p] [-k] [-D] [-S] [--no-ff] <name|namep
Finish feature <name>
--
h,help! Show this help
showcommands! Show git commands while executing them
q,showcommands! Show git commands while executing them
F,[no]fetch Fetch from origin before performing finish
r,[no]rebase Rebase before merging
p,[no]preserve-merges Preserve merges while rebasing
[no]push Push to origin after performing finish
P,[no]push Push to origin after performing finish
k,[no]keep Keep branch after performing finish
keepremote! Keep the remote branch
keeplocal! Keep the local branch
R,keepremote! Keep the remote branch
L,keeplocal! Keep the local branch
D,[no]force_delete Force delete feature branch after finish
S,[no]squash Squash feature during merge
no-ff! Never fast-forward during the merge
s,[no]squash_info Add branch info during squash
m,no-ff! Never fast-forward during the merge
"
local finish_base

# Define flags
DEFINE_boolean 'fetch' false "fetch from $ORIGIN before performing finish" F
DEFINE_boolean 'rebase' false "rebase before merging" r
DEFINE_boolean 'preserve-merges' false 'try to recreate merges while rebasing' p
DEFINE_boolean 'push' false "push to $ORIGIN after performing finish"
DEFINE_boolean 'push' false "push to $ORIGIN after performing finish" P
DEFINE_boolean 'keep' false "keep branch after performing finish" k
DEFINE_boolean 'keepremote' false "keep the remote branch"
DEFINE_boolean 'keeplocal' false "keep the local branch"
DEFINE_boolean 'keepremote' false "keep the remote branch" R
DEFINE_boolean 'keeplocal' false "keep the local branch" L
DEFINE_boolean 'force_delete' false "force delete feature branch after finish" D
DEFINE_boolean 'squash' false "squash feature during merge" S
DEFINE_boolean 'squash-info' false "add branch info during squash"
DEFINE_boolean 'no-ff!' false "Don't fast-forward ever during merge "
DEFINE_boolean 'squash-info' false "add branch info during squash" s
DEFINE_boolean 'no-ff!' false "Don't fast-forward ever during merge " m

# Override defaults with values from config
gitflow_override_flag_boolean "feature.finish.fetch" "fetch"
Expand Down Expand Up @@ -507,7 +508,7 @@ Publish feature branch <name> on $ORIGIN.
When <name> is omitted the current branch is used, but only if it's a feature branch.
--
h,help! Show this help
showcommands! Show git commands while executing them
q,showcommands! Show git commands while executing them
"
# Parse arguments
parse_args "$@"
Expand Down Expand Up @@ -548,7 +549,7 @@ git flow feature track [-h] <name>
Start tracking feature <name> that is shared on $ORIGIN
--
h,help! Show this help
showcommands! Show git commands while executing them
q,showcommands! Show git commands while executing them
"
# Parse arguments
parse_args "$@"
Expand Down Expand Up @@ -583,7 +584,7 @@ git flow feature diff [-h] [<name|nameprefix>]
Show all changes in <name> that are not in the base
--
h,help! Show this help
showcommands! Show git commands while executing them
q,showcommands! Show git commands while executing them
"
local base

Expand All @@ -608,7 +609,7 @@ git flow feature checkout [-h] [<name|nameprefix>]
Switch to feature branch <name>
--
h,help! Show this help
showcommands! Show git commands while executing them
q,showcommands! Show git commands while executing them
"
# Parse arguments
parse_args "$@"
Expand All @@ -632,7 +633,7 @@ git flow feature rebase [-h] [-i] [-p] [<name|nameprefix>]
Rebase <name> on <base_branch>
--
h,help! Show this help
showcommands! Show git commands while executing them
q,showcommands! Show git commands while executing them
i,[no]interactive Do an interactive rebase
p,[no]preserve-merges Preserve merges
"
Expand Down Expand Up @@ -696,7 +697,7 @@ git flow feature pull [-h] <remote> [<name>]
Pull feature <name> from <remote>
--
h,help! Show this help
showcommands! Show git commands while executing them
q,showcommands! Show git commands while executing them
"
local current_branch

Expand Down Expand Up @@ -765,7 +766,7 @@ git flow feature delete [-h] [-f] [-r] <name>
Delete a given feature branch
--
h,help! Show this help
showcommands! Show git commands while executing them
q,showcommands! Show git commands while executing them
f,[no]force Force deletion
r,[no]remote Delete remote branch
"
Expand Down Expand Up @@ -837,7 +838,7 @@ git flow feature rename <new_name> [<new_name>]
Rename a given feature branch
--
h,help! Show this help
showcommands! Show git commands while executing them
q,showcommands! Show git commands while executing them
"
gitflow_rename_branch "$@"
}
Loading

0 comments on commit 11d1361

Please sign in to comment.