From: Mathias Lafledt <misfire@debugon.org>
To: git@vger.kernel.org
Cc: Junio C Hamano <gitster@pobox.com>
Subject: [PATCH] GIT-VERSION-GEN: make use of git describe --dirty
Date: Thu, 14 Oct 2010 18:17:46 +0200 [thread overview]
Message-ID: <4CB72D2A.7050601@debugon.org> (raw)
Currently, GIT-VERSION-GEN invokes the plumbing commands "git update-index" and
"git diff-index" to determine if the working tree is dirty. It then appends
"-dirty" to the version string returned by "git describe".
However, as of Git v1.6.6, "git describe" can be told to do all that with the
"--dirty" option, saving us the plumbing.
Signed-off-by: Mathias Lafeldt <misfire@debugon.org>
---
GIT-VERSION-GEN | 7 ++-----
1 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN
index d441d88..73d5cf9 100755
--- a/GIT-VERSION-GEN
+++ b/GIT-VERSION-GEN
@@ -12,13 +12,10 @@ if test -f version
then
VN=$(cat version) || VN="$DEF_VER"
elif test -d .git -o -f .git &&
- VN=$(git describe --match "v[0-9]*" --abbrev=4 HEAD 2>/dev/null) &&
+ VN=$(git describe --match "v[0-9]*" --abbrev=4 --dirty 2>/dev/null) &&
case "$VN" in
*$LF*) (exit 1) ;;
- v[0-9]*)
- git update-index -q --refresh
- test -z "$(git diff-index --name-only HEAD --)" ||
- VN="$VN-dirty" ;;
+ v[0-9]*) : ;;
esac
then
VN=$(echo "$VN" | sed -e 's/-/./g');
--
1.7.3.GIT
next reply other threads:[~2010-10-14 16:17 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-14 16:17 Mathias Lafledt [this message]
2010-10-14 19:45 ` [PATCH v2] GIT-VERSION-GEN: make use of git describe --dirty Mathias Lafeldt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4CB72D2A.7050601@debugon.org \
--to=misfire@debugon.org \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).