2019-01-04 17:29:24 +03:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# Insert selected git-bug issue identifier in the comment.
|
|
|
|
# if no selected issue, print in comments the list of open issues.
|
|
|
|
#
|
|
|
|
cmtChar=`git config --get core.commentchar`
|
|
|
|
hashChar="#"
|
|
|
|
if [ "$cmtChar" = "" ]
|
|
|
|
then
|
|
|
|
cmtChar="#"
|
|
|
|
fi
|
|
|
|
if [ "$cmtChar" = "#" ]
|
|
|
|
then
|
|
|
|
hashChar=":"
|
|
|
|
fi
|
|
|
|
|
2019-01-08 01:08:48 +03:00
|
|
|
ISSUE=`git bug show --field shortId`
|
2019-01-04 17:29:24 +03:00
|
|
|
if [ "$ISSUE" = "" ]
|
|
|
|
then
|
|
|
|
echo "$cmtChar !!!!! insert $hashChar<issue_id> in your comment, pick one in list below." >> "$1"
|
|
|
|
git bug ls status:open |sed 's/ open\t/ /'| sed "s/^/$cmtChar/" >> "$1"
|
|
|
|
else
|
|
|
|
sed -i "1i$hashChar$ISSUE " "$1"
|
|
|
|
fi
|