Compare commits

...

2 Commits

Author SHA1 Message Date
Adolfo Perez Alvarez 2340af8c9d Push branch; update ticket urls 2024-02-13 16:27:01 +01:00
Adolfo Perez Alvarez 517a2bd6ca Rename to kpick
I'm no longer using this, preferring miscutils/pick instead. Keeping
around as `kpick` just in case.
2024-02-13 16:26:36 +01:00
3 changed files with 4 additions and 2 deletions

View File

@ -1,5 +1,5 @@
BINDIR?=${HOME}/.local/bin BINDIR?=${HOME}/.local/bin
cmds=g pick cmds=g kpick
fns=diralias j jmod nsalias fns=diralias j jmod nsalias
install: install:
install ${fns} $${FPATH:?FPATH not defined} install ${fns} $${FPATH:?FPATH not defined}

4
g
View File

@ -1,13 +1,15 @@
#!/usr/bin/env ksh #!/usr/bin/env ksh
if [[ $1 = "pc" || ( $1 = "pr" && $2 = "create" ) ]] if [[ $1 = "pc" || ( $1 = "pr" && $2 = "create" ) ]]
then then
remote=$(git rev-parse --abbrev-ref --symbolic-full-name @{u} 2>/dev/null | cut -d/ -f1)
git push --set-upstream ${remote:-origin} $(git branch --show-current)
tmp=$(mktemp /tmp/g.XXXXXXXXXXX.md) tmp=$(mktemp /tmp/g.XXXXXXXXXXX.md)
if [[ -f ~/.g.template ]] if [[ -f ~/.g.template ]]
then then
lps=$(git show --pretty='format:%s' --no-patch | cut -d' ' -f1) lps=$(git show --pretty='format:%s' --no-patch | cut -d' ' -f1)
if [[ ! -z $lps ]] if [[ ! -z $lps ]]
then then
url="https://issues.liferay.com/browse/"$lps url="https://liferay.atlassian.net/browse/"$lps
sed -e "s/{lps}/$lps/g" -e "s,{url},$url," <~/.g.template >$tmp sed -e "s/{lps}/$lps/g" -e "s,{url},$url," <~/.g.template >$tmp
fi fi
fi fi

View File