Skip to content

Commit b02d9f4

Browse files
committed
Show new commits in origin
1 parent 9ff2370 commit b02d9f4

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

bin/cppsm

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,20 @@
66
COMMAND="$CPPSM/commands/$1"
77

88
if [ $# = 0 ] || [ ! -x "$COMMAND" ]; then
9+
BRANCH="$(git -C "$CPPSM" symbolic-ref --short HEAD)"
10+
11+
ORIGIN="$(git -C "$CPPSM" log --pretty=oneline --abbrev-commit "..origin/$BRANCH" | sed 's#^# #g')"
12+
if [ -n "$ORIGIN" ]; then
13+
ORIGIN="$(cat << EOF
14+
15+
Origin:
16+
$ORIGIN
17+
EOF
18+
)"
19+
fi
20+
21+
git -C "$CPPSM" fetch --quiet
22+
923
# shellcheck disable=SC2035
1024
COMMANDS="$(cd "$CPPSM/commands" && echo *)"
1125
COMMANDS="${COMMANDS// /|}"
@@ -16,9 +30,9 @@ Run any command with --help to see a brief description of the command.
1630
1731
Visit https://cppsm.github.io/ for full documentation.
1832
19-
Branch: $(git -C "$CPPSM" symbolic-ref --short HEAD)
33+
Branch: $BRANCH
2034
$(git -C "$CPPSM" log -n 5 --pretty=oneline --abbrev-commit | sed 's#^# #g')
21-
35+
$ORIGIN
2236
EOF
2337
exit 1
2438
fi

0 commit comments

Comments
 (0)