Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
bbguimaraes
dotfiles
Commits
12f3eca8
Commit
12f3eca8
authored
Jun 17, 2022
by
bbguimaraes
Browse files
scripts/pr: add option to open URLs
parent
d4f48475
Changes
1
Hide whitespace changes
Inline
Side-by-side
scripts/pr.sh
View file @
12f3eca8
...
...
@@ -49,16 +49,24 @@ comment() {
}
for_ref
()
{
[[
"$#"
-eq
0
]]
&&
set
--
HEAD
local
x j
for
x
;
do
x
=
$(
git rev-parse
"
$x
"
)
j
=
$(
hub api
"search/issues?q=org:{owner}+repo:{repo}+sha:
$x
"
)
local
open
=
rev url j
case
"$#"
in
0
)
set
--
HEAD
;;
*
)
[[
"
$1
"
==
-o
]]
&&
{
open
=
1
;
shift
;
}
;;
esac
for
rev
;
do
rev
=
$(
git rev-parse
"
$rev
"
)
j
=
$(
hub api
"search/issues?q=org:{owner}+repo:{repo}+sha:
$rev
"
)
if
[[
"
$(
jq
<<<
"
$j
"
.total_count
)
"
-eq
0
]]
;
then
echo
"
$
x
"
echo
"
$
rev
"
else
printf
'%s '
"
$x
"
jq
--raw-output
<<<
"
$j
"
'[.items[].html_url]|join(" ")'
printf
%s
"
$rev
"
for
url
in
$(
\
jq
--raw-output
<<<
"
$j
"
'[.items[].html_url]|join(" ")'
\
)
;
do
[[
"
$open
"
]]
&&
xdg-open
"
$url
"
echo
"
$url
"
done
fi
done
}
...
...
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