{"thread":{"id":"34931","subject":"[PATCH v3 1/3] version-gen: cleanup","startedAt":"2013-09-14T06:28:45Z","lastAt":"2013-09-14T06:28:48Z","messageCount":4,"participants":["Felipe Contreras"],"isPatch":true,"patchVersion":3,"patchTotal":3},"messages":[{"id":"227673","messageId":"1379140128-12397-1-git-send-email-felipe.contreras@gmail.com","threadId":"34931","inReplyTo":null,"subject":"[PATCH v3 0/3] Version fixes and cleanups","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-09-14T06:28:45Z","receivedAt":"2013-09-14T06:28:45Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Felipe Contreras (3):\n  version-gen: cleanup\n  version-gen: avoid messing the version\n  build: fix rpm versioning\n\n GIT-VERSION-GEN | 36 +++++++++++++++++++-----------------\n Makefile        |  2 +-\n 2 files changed, 20 insertions(+), 18 deletions(-)\n\n-- \n1.8.4-fc\n"},{"id":"227672","messageId":"1379140128-12397-2-git-send-email-felipe.contreras@gmail.com","threadId":"34931","inReplyTo":"1379140128-12397-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v3 1/3] version-gen: cleanup","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-09-14T06:28:46Z","receivedAt":"2013-09-14T06:28:46Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"No functional changes.\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n GIT-VERSION-GEN | 36 ++++++++++++++++++++----------------\n 1 file changed, 20 insertions(+), 16 deletions(-)\n\ndiff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN\nindex 06026ea..e96538d 100755\n--- a/GIT-VERSION-GEN\n+++ b/GIT-VERSION-GEN\n@@ -6,22 +6,29 @@ DEF_VER=v1.8.4\n LF='\n '\n \n-# First see if there is a version file (included in release tarballs),\n-# then try git-describe, then default.\n-if test -f version\n-then\n-\tVN=$(cat version) || VN=\"$DEF_VER\"\n-elif test -d ${GIT_DIR:-.git} -o -f .git &&\n-\tVN=$(git describe --match \"v[0-9]*\" --abbrev=7 HEAD 2>/dev/null) &&\n+describe () {\n+\tVN=$(git describe --match \"v[0-9]*\" --abbrev=7 HEAD 2>/dev/null) || return 1\n \tcase \"$VN\" in\n-\t*$LF*) (exit 1) ;;\n+\t*$LF*)\n+\t\treturn 1\n+\t\t;;\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+\t\tVN=\"$VN-dirty\"\n+\t\treturn 0\n+\t\t;;\n \tesac\n+}\n+\n+# First see if there is a version file (included in release tarballs),\n+# then try 'git describe', then default.\n+if test -f version\n+then\n+\tVN=$(cat version) || VN=\"$DEF_VER\"\n+elif test -d ${GIT_DIR:-.git} -o -f .git && describe\n then\n-\tVN=$(echo \"$VN\" | sed -e 's/-/./g');\n+\tVN=$(echo \"$VN\" | sed -e 's/-/./g')\n else\n \tVN=\"$DEF_VER\"\n fi\n@@ -34,9 +41,6 @@ then\n else\n \tVC=unset\n fi\n-test \"$VN\" = \"$VC\" || {\n-\techo >&2 \"GIT_VERSION = $VN\"\n-\techo \"GIT_VERSION = $VN\" >$GVF\n-}\n-\n-\n+test \"$VN\" = \"$VC\" && exit\n+echo >&2 \"GIT_VERSION = $VN\"\n+echo \"GIT_VERSION = $VN\" >$GVF\n-- \n1.8.4-fc\n"},{"id":"227675","messageId":"1379140128-12397-3-git-send-email-felipe.contreras@gmail.com","threadId":"34931","inReplyTo":"1379140128-12397-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v3 2/3] version-gen: avoid messing the version","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-09-14T06:28:47Z","receivedAt":"2013-09-14T06:28:47Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"If the version is 'v1.8.4-rc1' that is the version, and there's no need\nto change it to anything else, like 'v1.8.4.rc1'.\n\nIf RedHat, or somebody else, needs a specific version, they can use the\n'version' file, like everybody else.\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n GIT-VERSION-GEN | 4 +---\n 1 file changed, 1 insertion(+), 3 deletions(-)\n\ndiff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN\nindex e96538d..19902e9 100755\n--- a/GIT-VERSION-GEN\n+++ b/GIT-VERSION-GEN\n@@ -26,10 +26,8 @@ describe () {\n if test -f version\n then\n \tVN=$(cat version) || VN=\"$DEF_VER\"\n-elif test -d ${GIT_DIR:-.git} -o -f .git && describe\n+elif test ! -d ${GIT_DIR:-.git} -a ! -f .git || ! describe\n then\n-\tVN=$(echo \"$VN\" | sed -e 's/-/./g')\n-else\n \tVN=\"$DEF_VER\"\n fi\n \n-- \n1.8.4-fc\n"},{"id":"227674","messageId":"1379140128-12397-4-git-send-email-felipe.contreras@gmail.com","threadId":"34931","inReplyTo":"1379140128-12397-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v3 3/3] build: fix rpm versioning","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-09-14T06:28:48Z","receivedAt":"2013-09-14T06:28:48Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"The current versioning scheme doesn't work properly:\n\n  git-1.8.4 < git-1.8.4.rc1\n  git-1.8.4 < git-1.8.4-rc1\n  git-1.8.4 > git-1.8.4~rc1\n\nSince v1.8.4 final is obviously greater than v1.8.4-rc1, we need to use\na tilde so RPM detects it properly as a greater version number.\n\nThis works in rpm-4.10, in older versions, a tilde would work as bad as\nanything else.\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n Makefile | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/Makefile b/Makefile\nindex 3588ca1..7a8bee7 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -2426,7 +2426,7 @@ quick-install-html:\n ### Maintainer's dist rules\n \n git.spec: git.spec.in GIT-VERSION-FILE\n-\tsed -e 's/@@VERSION@@/$(GIT_VERSION)/g' < $< > $@+\n+\tsed -e 's/@@VERSION@@/$(subst -,~,$(GIT_VERSION))/g' < $< > $@+\n \tmv $@+ $@\n \n GIT_TARNAME = git-$(GIT_VERSION)\n-- \n1.8.4-fc\n"}]}