-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Includes an auto_branch_prefix property #2
base: main
Are you sure you want to change the base?
Conversation
Identifies the ticket type to create branches with prefixes like: feature, bugfix, or refactor
stdout=subprocess.PIPE) | ||
process.communicate() | ||
else: | ||
print("No menu entry selected. Exiting.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! :)
@@ -12,6 +12,13 @@ | |||
|
|||
MAX_RESULT = 5 | |||
|
|||
# Mapping of ticket types to branch prefixes | |||
TICKET_TYPE_TO_PREFIX = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd honestly move this to an environment variable, so everyone can define the mapping themselves (more extendable).
JIRA_TYPE_MAPPING="Story=feature,Task=feature"
https://github.com/sloria/environs can read these maps.
def main(prefix: Annotated[str, typer.Option(help="Prefix that is being used for the new branch.")] = "feature", | ||
no_prefix: Annotated[bool, typer.Option("--no-prefix", help="Will not use a prefix")] = False): | ||
no_prefix: Annotated[bool, typer.Option("--no-prefix", help="Will not use a prefix")] = False, | ||
auto_branch_prefix: Annotated[bool, typer.Option("--auto-branch-prefix", help="Automatically determine branch prefix based on ticket type")] = False): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you do https://github.com/freenowtech/git-jira/pull/2/files#r1477907772, I think you can drop this (=> only map if the variable is defined).
Oh, also |
Push |
Identifies the ticket type to create branches with prefixes like
feature
,bugfix
, orrefactor
Fixes #1