{"thread":{"id":"25448","subject":"[PATCH] GIT-VERSION-GEN: make use of git describe --dirty","startedAt":"2010-10-14T16:17:46Z","lastAt":"2010-10-14T19:45:54Z","messageCount":2,"participants":["Mathias Lafledt","Mathias Lafeldt"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"153517","messageId":"4CB72D2A.7050601@debugon.org","threadId":"25448","inReplyTo":null,"subject":"[PATCH] GIT-VERSION-GEN: make use of git describe --dirty","fromName":"Mathias Lafledt","fromEmail":"misfire@debugon.org","sentAt":"2010-10-14T16:17:46Z","receivedAt":"2010-10-14T16:17:46Z","isPatch":true,"sender":{"key":"misfire@debugon.org","avatar":"https://avatars.githubusercontent.com/u/158074?v=4"},"body":"Currently, GIT-VERSION-GEN invokes the plumbing commands \"git update-index\" and\n\"git diff-index\" to determine if the working tree is dirty. It then appends\n\"-dirty\" to the version string returned by \"git describe\".\n\nHowever, as of Git v1.6.6, \"git describe\" can be told to do all that with the\n\"--dirty\" option, saving us the plumbing.\n\nSigned-off-by: Mathias Lafeldt <misfire@debugon.org>\n---\n GIT-VERSION-GEN |    7 ++-----\n 1 files changed, 2 insertions(+), 5 deletions(-)\n\ndiff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN\nindex d441d88..73d5cf9 100755\n--- a/GIT-VERSION-GEN\n+++ b/GIT-VERSION-GEN\n@@ -12,13 +12,10 @@ if test -f version\n then\n \tVN=$(cat version) || VN=\"$DEF_VER\"\n elif test -d .git -o -f .git &&\n-\tVN=$(git describe --match \"v[0-9]*\" --abbrev=4 HEAD 2>/dev/null) &&\n+\tVN=$(git describe --match \"v[0-9]*\" --abbrev=4 --dirty 2>/dev/null) &&\n \tcase \"$VN\" in\n \t*$LF*) (exit 1) ;;\n-\tv[0-9]*)\n-\t\tgit update-index -q --refresh\n-\t\ttest -z \"$(git diff-index --name-only HEAD --)\" ||\n-\t\tVN=\"$VN-dirty\" ;;\n+\tv[0-9]*) : ;;\n \tesac\n then\n \tVN=$(echo \"$VN\" | sed -e 's/-/./g');\n-- \n1.7.3.GIT\n"},{"id":"153532","messageId":"4CB75DF2.3050609@debugon.org","threadId":"25448","inReplyTo":"4CB72D2A.7050601@debugon.org","subject":"[PATCH v2] GIT-VERSION-GEN: make use of git describe --dirty","fromName":"Mathias Lafeldt","fromEmail":"misfire@debugon.org","sentAt":"2010-10-14T19:45:54Z","receivedAt":"2010-10-14T19:45:54Z","isPatch":true,"sender":{"key":"misfire@debugon.org","avatar":"https://avatars.githubusercontent.com/u/158074?v=4"},"body":"Currently, GIT-VERSION-GEN invokes the plumbing commands \"git update-index\" and\n\"git diff-index\" to determine if the working tree is dirty. It then appends\n\"-dirty\" to the version string returned by \"git describe\".\n\nHowever, as of Git v1.6.6, \"git describe\" can be told to do all that with the\n\"--dirty\" option, saving us the plumbing.\n\nSigned-off-by: Mathias Lafeldt <misfire@debugon.org>\n---\nCorrected a typo in the \"From:\" field. Apart from that, the patch hasn't changed.\n\n GIT-VERSION-GEN |    7 ++-----\n 1 files changed, 2 insertions(+), 5 deletions(-)\n\ndiff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN\nindex d441d88..73d5cf9 100755\n--- a/GIT-VERSION-GEN\n+++ b/GIT-VERSION-GEN\n@@ -12,13 +12,10 @@ if test -f version\n then\n \tVN=$(cat version) || VN=\"$DEF_VER\"\n elif test -d .git -o -f .git &&\n-\tVN=$(git describe --match \"v[0-9]*\" --abbrev=4 HEAD 2>/dev/null) &&\n+\tVN=$(git describe --match \"v[0-9]*\" --abbrev=4 --dirty 2>/dev/null) &&\n \tcase \"$VN\" in\n \t*$LF*) (exit 1) ;;\n-\tv[0-9]*)\n-\t\tgit update-index -q --refresh\n-\t\ttest -z \"$(git diff-index --name-only HEAD --)\" ||\n-\t\tVN=\"$VN-dirty\" ;;\n+\tv[0-9]*) : ;;\n \tesac\n then\n \tVN=$(echo \"$VN\" | sed -e 's/-/./g');\n-- \n1.7.3.GIT\n"}]}