Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
oh-my-zsh
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
github
oh-my-zsh
Commits
529a12fa
Commit
529a12fa
authored
Nov 01, 2017
by
Jarryd Tilbrook
Committed by
Robby Russell
Nov 01, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add shortcut for opening current branch in Jira (#6366)
parent
e8e7bf3b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
2 deletions
+9
-2
_jira
plugins/jira/_jira
+1
-0
jira.plugin.zsh
plugins/jira/jira.plugin.zsh
+8
-2
No files found.
plugins/jira/_jira
View file @
529a12fa
...
@@ -7,6 +7,7 @@ _1st_arguments=(
...
@@ -7,6 +7,7 @@ _1st_arguments=(
'dashboard:open the dashboard'
'dashboard:open the dashboard'
'reported:search for issues reported by a user'
'reported:search for issues reported by a user'
'assigned:search for issues assigned to 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'
'dumpconfig:display effective jira configuration'
)
)
...
...
plugins/jira/jira.plugin.zsh
View file @
529a12fa
...
@@ -51,8 +51,14 @@ function jira() {
...
@@ -51,8 +51,14 @@ function jira() {
echo
"JIRA_DEFAULT_ACTION=
$JIRA_DEFAULT_ACTION
"
echo
"JIRA_DEFAULT_ACTION=
$JIRA_DEFAULT_ACTION
"
else
else
# Anything that doesn't match a special action is considered an issue name
# Anything that doesn't match a special action is considered an issue name
# 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_arg
=
$action
local
issue
=
"
${
jira_prefix
}${
issue_arg
}
"
local
issue
=
"
${
jira_prefix
}${
issue_arg
}
"
fi
local
url_fragment
=
''
local
url_fragment
=
''
if
[[
"
$2
"
==
"m"
]]
;
then
if
[[
"
$2
"
==
"m"
]]
;
then
url_fragment
=
"#add-comment"
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