Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Ohmyzsh
Commits
529a12fa
Commit
529a12fa
authored
Nov 01, 2017
by
Jarryd Tilbrook
Committed by
Robby Russell
Nov 01, 2017
Browse files
Add shortcut for opening current branch in Jira (#6366)
parent
e8e7bf3b
Changes
2
Hide whitespace changes
Inline
Side-by-side
plugins/jira/_jira
View file @
529a12fa
...
...
@@ -7,6 +7,7 @@ _1st_arguments=(
'dashboard:open the dashboard'
'reported:search for issues reported by a user'
'assigned:search for issues assigned to a user'
'br:open the issue named after the git branch of the current directory'
'dumpconfig:display effective jira configuration'
)
...
...
plugins/jira/jira.plugin.zsh
View file @
529a12fa
...
...
@@ -51,8 +51,14 @@ function jira() {
echo
"JIRA_DEFAULT_ACTION=
$JIRA_DEFAULT_ACTION
"
else
# Anything that doesn't match a special action is considered an issue name
local
issue_arg
=
$action
local
issue
=
"
${
jira_prefix
}${
issue_arg
}
"
# but `branch` is a special case that will parse the current git branch
if
[[
"
$action
"
==
"br"
]]
;
then
local
issue_arg
=
$(
git rev-parse
--abbrev-ref
HEAD
)
local
issue
=
"
${
jira_prefix
}${
issue_arg
}
"
else
local
issue_arg
=
$action
local
issue
=
"
${
jira_prefix
}${
issue_arg
}
"
fi
local
url_fragment
=
''
if
[[
"
$2
"
==
"m"
]]
;
then
url_fragment
=
"#add-comment"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment