Skip to content
This repository has been archived by the owner on Nov 25, 2022. It is now read-only.

Commit

Permalink
Add "git jira" command
Browse files Browse the repository at this point in the history
The "git jira" command parses the branch name to determine the Jira
issue based on the naming schedule
{branchType}/{issue}-{description}
e.g. feature/sf-123-add-new-button (the issue number is "sf-123")

The git jira command uses this issue number in combination with the
custom git config value stored at 'salcode.jiraSubdomain' (in my example
this value is "ferrarello") to construct a
URL like

https://ferrarello.atlassian.net/browse/sf-123

and open this URL in the browser.

See #118
  • Loading branch information
salcode committed Jul 5, 2020
1 parent 66382aa commit 3518873
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions gitconfig
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,9 @@
git cherry-pick @{-1}~${1:-1}...@{-1}~0; \
}; f"

open = "!f() { \
echo https://webdevstudios.atlassian.net/browse/$(git rev-parse --abbrev-ref HEAD | sed 's/^.*\\/\\([a-zA-z]\\{1,\\}\\).*/\\1/'); \
jira = "!f() { \
jiraBaseUrl=\"https://$(git config --get salcode.jiraSubdomain).atlassian.net/browse/\"; \
open $jiraBaseUrl$(git rev-parse --abbrev-ref HEAD | sed 's/^.*\\/\\([a-zA-z]\\{1,\\}-[0-9]\\{1,\\}\\).*/\\1/'); \
}; f"

# Move to the given branch the last n commits.
Expand Down

0 comments on commit 3518873

Please sign in to comment.