mirror of
https://github.com/weaveworks/scope.git
synced 2026-03-04 10:41:14 +00:00
13 lines
497 B
Bash
Executable File
13 lines
497 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
set -o errexit
|
|
set -o nounset
|
|
set -o pipefail
|
|
|
|
WORKING_SUFFIX=$(if git status --porcelain | grep -qE '^(?:[^?][^ ]|[^ ][^?])\s'; then echo "-WIP"; else echo ""; fi)
|
|
BRANCH_PREFIX=$(git rev-parse --abbrev-ref HEAD)
|
|
|
|
# Fix the object name prefix length to 8 characters to have it consistent across the system.
|
|
# See https://git-scm.com/docs/git-rev-parse#Documentation/git-rev-parse.txt---shortlength
|
|
echo "${BRANCH_PREFIX//\//-}-$(git rev-parse --short=8 HEAD)$WORKING_SUFFIX"
|