Git development
 help / color / mirror / Atom feed
From: Junio C Hamano <junkio@cox.net>
To: git@vger.kernel.org
Subject: [PATCH] GIT-VERSION-GEN: detect dirty tree and mark the version accordingly.
Date: Mon, 09 Jan 2006 18:53:15 -0800	[thread overview]
Message-ID: <7vlkxobxpg.fsf@assigned-by-dhcp.cox.net> (raw)

If we are building from a working tree with local modifications,
mark the version accordingly.

Deliberately uses '-' to prevent RPM from being built from such
a tree.

Signed-off-by: Junio C Hamano <junkio@cox.net>

---

 * This is a useful precaution and should be safe, so planned to
   go into 1.1.1.

 GIT-VERSION-GEN |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

339b684aa42ac80964ef0d9049445dad7f83848c
diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN
index c878819..cb393b5 100755
--- a/GIT-VERSION-GEN
+++ b/GIT-VERSION-GEN
@@ -11,6 +11,14 @@ set)
 	;;
 esac
 
+dirty=$(sh -c 'git-diff-files --name-only HEAD' 2>/dev/null) || dirty=
+case "$dirty" in
+'')
+	;;
+*)
+	VN="$VN-dirty" ;;
+esac
+
 if test -r $GVF
 then
 	VC=$(sed -e 's/^GIT_VERSION = //' <$GVF)
-- 
1.1.0

                 reply	other threads:[~2006-01-10  2:53 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7vlkxobxpg.fsf@assigned-by-dhcp.cox.net \
    --to=junkio@cox.net \
    --cc=git@vger.kernel.org \
    /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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox