Skip to content

Commit 42b95db

Browse files
committed
add: Justfile 'changes' recipe
1 parent 973e780 commit 42b95db

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

justfile

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,14 @@ dist *args="":
3232
{{GIT_DIR}}/scripts/dist.sh {{args}}
3333

3434
# create a new release
35-
release *args="":
35+
release *args="": clean generate
3636
{{GIT_DIR}}/scripts/release.sh {{args}}
3737

38+
changes from="" to="":
39+
#!/bin/sh
40+
source {{GIT_DIR}}/scripts/functions.sh
41+
get_changes {{from}} {{to}}
42+
3843
clean:
3944
@# generated files
4045
@echo "rm -r pkg/server/assets"
@@ -54,8 +59,5 @@ clean:
5459

5560
# ---
5661

57-
_unreleased:
58-
@git log --oneline $(git describe --tags --abbrev=0)...HEAD
59-
6062
_system-info:
6163
@echo "{{os()}}_{{arch()}}"

scripts/functions.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,14 @@ is_dirty() {
4444
is_tagged() {
4545
test -n "$(get_tag)"
4646
}
47+
48+
get_changes() {
49+
from=${1:-$(git describe --tags --abbrev=0)}
50+
to=${2:-HEAD}
51+
52+
if [ "${from}" == "$(git describe --tags --exact-match ${to} 2>/dev/null)" ]; then
53+
from=$(git describe --tags --abbrev=0 --exclude=${from})
54+
fi
55+
56+
git log --oneline --no-decorate ${from}..${to}
57+
}

0 commit comments

Comments
 (0)