From 6fadb73f1f7ae2209ad601705fc6b6f839b1827a Mon Sep 17 00:00:00 2001 From: Andrew Bettison Date: Mon, 7 Oct 2013 04:42:30 +1030 Subject: [PATCH] Improve version_string.sh: detect changes in submodules --- version_string.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/version_string.sh b/version_string.sh index be6bd311..066a2816 100755 --- a/version_string.sh +++ b/version_string.sh @@ -58,6 +58,7 @@ set -e allow_modified=true untracked_files=normal +ignore_submodules=none default_tag="START" repo_path=. version_tag_glob='[0-9].[0-9]*' @@ -65,7 +66,7 @@ version_tag_glob='[0-9].[0-9]*' while [ $# -gt 0 ]; do case "$1" in --help) usage; exit 0;; - --ignore-untracked) untracked_files=no; shift;; + --ignore-untracked) untracked_files=no; ignore_submodules=untracked; shift;; --unmodified) allow_modified=false; shift;; --no-default-tag) default_tag=; shift;; --default-tag=*) default_tag="${1#*=}"; shift;; @@ -98,7 +99,7 @@ get_author_label() { # In order to implement the --ignore-untracked and --unmodified options, use the # "git status" command to detect local modifications. dirty= -if [ $(git status --porcelain --untracked-files=$untracked_files 2>/dev/null | wc -l) -ne 0 ]; then +if [ $(git status --porcelain --untracked-files=$untracked_files --ignore-submodules=$ignore_submodules 2>/dev/null | wc -l) -ne 0 ]; then get_author_label dirty="+$author_label-$(date '+%Y%m%d%H%M%S')" fi