Skip to content

Commit f460ab4

Browse files
committed
tools/helpers.bash: Add git-shorlog-add/fix/update
These helper functions will optionally take a git ref argument, and display the --format=oneline log from the git ref specifed to HEAD XOR all of git history as appropriate. The intent is for these helpers to make it easier to write stream update notes. Signed-off-by: Rune Morling <ermo@aerynos.com>
1 parent 772a6eb commit f460ab4

1 file changed

Lines changed: 36 additions & 0 deletions

File tree

tools/helpers.bash

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,42 @@ function fixup-recipe-commit() {
127127
git log -1 -- .
128128
}
129129

130+
git-shortlog-updates () {
131+
local _arg="${1}"
132+
local _oneline="--format=oneline"
133+
if [[ -n ${_arg} ]]; then
134+
_oneline="--format=oneline ${_arg}..HEAD"
135+
fi
136+
git log ${_oneline} \
137+
|grep -E ': [Uu]pdate' \
138+
|cut -f1 -d' ' --complement \
139+
|sed -E -e 's|: [Uu]pdate to v?| |g'
140+
}
141+
142+
git-shortlog-add () {
143+
local _arg="${1}"
144+
local _oneline="--format=oneline"
145+
if [[ -n ${_arg} ]]; then
146+
_oneline="--format=oneline ${_arg}..HEAD"
147+
fi
148+
git log ${_oneline} \
149+
|grep -E ': [Aa]dd' \
150+
|cut -f1 -d' ' --complement \
151+
|sed -E -e 's|: [Aa]dd at v?| |g'
152+
}
153+
154+
git-shortlog-fix () {
155+
local _arg="${1}"
156+
local _oneline="--format=oneline"
157+
if [[ -n ${_arg} ]]; then
158+
_oneline="--format=oneline ${_arg}..HEAD"
159+
fi
160+
git log ${_oneline} \
161+
|grep -E ': [Ff]ix' \
162+
|cut -f1 -d' ' --complement
163+
}
164+
165+
130166
# Bash completions
131167
_chpkg()
132168
{

0 commit comments

Comments
 (0)