{"thread":{"id":"59597","subject":"[PATCH 00/18] version-gen: complete revamp/rewrite","startedAt":"2023-04-14T12:18:48Z","lastAt":"2023-04-14T19:42:09Z","messageCount":24,"participants":["Felipe Contreras","Todd Zullinger"],"isPatch":true,"patchVersion":1,"patchTotal":18},"messages":[{"id":"475356","messageId":"20230414121841.373980-1-felipe.contreras@gmail.com","threadId":"59597","inReplyTo":null,"subject":"[PATCH 00/18] version-gen: complete revamp/rewrite","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2023-04-14T12:18:23Z","receivedAt":"2023-04-14T12:18:48Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"The version generation script needs some love, as the last true change was done in 2008.\n\nThis series step by step revamps the whole script ending in only a few lines of code:\n\n    get_version () {\n        test -f version && cat version && return\n        git describe --match \"v[0-9]*\" --dirty 2>/dev/null | sed -e 's/-/+/' -e 's/^v//'\n    }\n\n    NEW=\"GIT_VERSION = $(get_version)\"\n\n    test -r GIT-VERSION-FILE && test \"$NEW\" = \"$(cat GIT-VERSION-FILE)\" && exit\n    echo \"$NEW\" | tee GIT-VERSION-FILE >&2\n\nThere should be no functional changes except for the last patch that changes\ninterim version from `2.40.0.$n.g${oid}` to `2.40.0+$n-g${oid}` as that causes\nthe proper sorting.\n\nIt's hard to see the actual changes to this script as 99% of the commits are\njust to bump the default version (which I don't know why it even exists).\n\nFor reference, cleaning the history I came up with these actual changes in case\nanyone is interested:\n\nc48799e560 (Teach GIT-VERSION-GEN about the .git file, 2008-02-20)\n1100ac81a9 (Change GIT-VERSION-GEN to call git commands with \"git\" not \"git-\"., 2006-05-22)\n374dfaa2e3 (Make GIT-VERSION-GEN tolerate missing git describe command again, 2006-01-26)\n5c7d3c9507 (Allow building of RPM from interim snapshot., 2006-01-16)\n181129d24c (For release tarballs, include the proper version, 2006-01-09)\n026351a035 (Make GIT-VERSION-GEN tolerate missing git describe command, 2005-12-30)\n9b88fcef7d (Makefile: use git-describe to mark the git version., 2005-12-27)\n\nCheers.\n\ndiff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN\nindex 9a1111af9b..99584bf86d 100755\n--- a/GIT-VERSION-GEN\n+++ b/GIT-VERSION-GEN\n@@ -1,40 +1,11 @@\n #!/bin/sh\n \n-GVF=GIT-VERSION-FILE\n-DEF_VER=v2.40.GIT\n-\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]*\" HEAD 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-\tesac\n-then\n-\tVN=$(echo \"$VN\" | sed -e 's/-/./g');\n-else\n-\tVN=\"$DEF_VER\"\n-fi\n-\n-VN=$(expr \"$VN\" : v*'\\(.*\\)')\n-\n-if test -r $GVF\n-then\n-\tVC=$(sed -e 's/^GIT_VERSION = //' <$GVF)\n-else\n-\tVC=unset\n-fi\n-test \"$VN\" = \"$VC\" || {\n-\techo >&2 \"GIT_VERSION = $VN\"\n-\techo \"GIT_VERSION = $VN\" >$GVF\n+get_version () {\n+\ttest -f version && cat version && return\n+\tgit describe --match \"v[0-9]*\" --dirty 2>/dev/null | sed -e 's/-/+/' -e 's/^v//'\n }\n+\n+NEW=\"GIT_VERSION = $(get_version)\"\n+\n+test -r GIT-VERSION-FILE && test \"$NEW\" = \"$(cat GIT-VERSION-FILE)\" && exit\n+echo \"$NEW\" | tee GIT-VERSION-FILE >&2\n\nFelipe Contreras (18):\n  version-gen: reorganize\n  version-gen: trivial cleanup\n  version-gen: refactor default version\n  version-gen: simplify v prefix removal\n  version-gen: simplify update check\n  version-gen: remove redundant check\n  version-gen: simplify `git describe` checks\n  version-gen: simplify dirty check\n  version-gen: move describe fix into function\n  version-gen: describe and sed in one go\n  version-gen: refactor describe function\n  version-gen: do v fix only when necessary\n  version-gen: move v fix into sed\n  version-gen: refactor main functionality\n  version-gen: remove default version\n  version-gen: refactor GIT_VERSION string\n  version-gen: get rid of GVF variable\n  version-gen: generate proper interim versions\n\n GIT-VERSION-GEN | 45 ++++++++-------------------------------------\n 1 file changed, 8 insertions(+), 37 deletions(-)\n\n-- \n2.40.0+fc1\n\n"},{"id":"475357","messageId":"20230414121841.373980-2-felipe.contreras@gmail.com","threadId":"59597","inReplyTo":"20230414121841.373980-1-felipe.contreras@gmail.com","subject":"[PATCH 01/18] version-gen: reorganize","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2023-04-14T12:18:24Z","receivedAt":"2023-04-14T12:18:52Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Simply move some code into a `describe` function so it's clear what code\nis related to dealing with `git describe`, and what code is the main\nfunctionality.\n\nNo functional changes.\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n GIT-VERSION-GEN | 25 ++++++++++++++++---------\n 1 file changed, 16 insertions(+), 9 deletions(-)\n\ndiff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN\nindex 9a1111af9b..29d634a30b 100755\n--- a/GIT-VERSION-GEN\n+++ b/GIT-VERSION-GEN\n@@ -6,20 +6,27 @@ DEF_VER=v2.40.GIT\n LF='\n '\n \n+describe () {\n+\tVN=$(git describe --match \"v[0-9]*\" HEAD 2>/dev/null) || return 1\n+\tcase \"$VN\" in\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\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 &&\n-\tVN=$(git describe --match \"v[0-9]*\" HEAD 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-\tesac\n+elif test -d ${GIT_DIR:-.git} -o -f .git && describe\n then\n \tVN=$(echo \"$VN\" | sed -e 's/-/./g');\n else\n-- \n2.40.0+fc1\n\n"},{"id":"475358","messageId":"20230414121841.373980-3-felipe.contreras@gmail.com","threadId":"59597","inReplyTo":"20230414121841.373980-1-felipe.contreras@gmail.com","subject":"[PATCH 02/18] version-gen: trivial cleanup","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2023-04-14T12:18:25Z","receivedAt":"2023-04-14T12:18:55Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"We don't use `git-foo` since git 1.6.\n\nHEAD is the default of `git describe`.\n\nAlso, deal with a bunch of shellcheck warnings.\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n GIT-VERSION-GEN | 18 ++++++++----------\n 1 file changed, 8 insertions(+), 10 deletions(-)\n\ndiff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN\nindex 29d634a30b..6dd7683ee7 100755\n--- a/GIT-VERSION-GEN\n+++ b/GIT-VERSION-GEN\n@@ -7,7 +7,7 @@ LF='\n '\n \n describe () {\n-\tVN=$(git describe --match \"v[0-9]*\" HEAD 2>/dev/null) || return 1\n+\tVN=$(git describe --match \"v[0-9]*\" 2>/dev/null) || return 1\n \tcase \"$VN\" in\n \t*$LF*)\n \t\treturn 1\n@@ -22,26 +22,24 @@ describe () {\n }\n \n # First see if there is a version file (included in release tarballs),\n-# then try git-describe, then default.\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+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 \n-VN=$(expr \"$VN\" : v*'\\(.*\\)')\n+VN=$(expr \"$VN\" : 'v*\\(.*\\)')\n \n if test -r $GVF\n then\n \tVC=$(sed -e 's/^GIT_VERSION = //' <$GVF)\n else\n-\tVC=unset\n+\tVC='unset'\n fi\n-test \"$VN\" = \"$VC\" || {\n-\techo >&2 \"GIT_VERSION = $VN\"\n-\techo \"GIT_VERSION = $VN\" >$GVF\n-}\n+test \"$VN\" = \"$VC\" && exit\n+echo \"GIT_VERSION = $VN\" | tee $GVF >&2\n-- \n2.40.0+fc1\n\n"},{"id":"475359","messageId":"20230414121841.373980-4-felipe.contreras@gmail.com","threadId":"59597","inReplyTo":"20230414121841.373980-1-felipe.contreras@gmail.com","subject":"[PATCH 03/18] version-gen: refactor default version","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2023-04-14T12:18:26Z","receivedAt":"2023-04-14T12:18:57Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"It's not clear how `cat version` might fail, but either way if VN is\nempty (or unset), assign the default value.\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n GIT-VERSION-GEN | 6 +++---\n 1 file changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN\nindex 6dd7683ee7..0d00fa3d9a 100755\n--- a/GIT-VERSION-GEN\n+++ b/GIT-VERSION-GEN\n@@ -25,14 +25,14 @@ describe () {\n # then try `git describe`, then default.\n if test -f version\n then\n-\tVN=$(cat version) || VN=\"$DEF_VER\"\n+\tVN=$(cat version)\n elif test -d \"${GIT_DIR:-.git}\" -o -f .git && describe\n then\n \tVN=$(echo \"$VN\" | sed -e 's/-/./g')\n-else\n-\tVN=\"$DEF_VER\"\n fi\n \n+: \"${VN:=$DEF_VER}\"\n+\n VN=$(expr \"$VN\" : 'v*\\(.*\\)')\n \n if test -r $GVF\n-- \n2.40.0+fc1\n\n"},{"id":"475360","messageId":"20230414121841.373980-5-felipe.contreras@gmail.com","threadId":"59597","inReplyTo":"20230414121841.373980-1-felipe.contreras@gmail.com","subject":"[PATCH 04/18] version-gen: simplify v prefix removal","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2023-04-14T12:18:27Z","receivedAt":"2023-04-14T12:19:03Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"There is a much simpler way.\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n GIT-VERSION-GEN | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN\nindex 0d00fa3d9a..c0f6bb242f 100755\n--- a/GIT-VERSION-GEN\n+++ b/GIT-VERSION-GEN\n@@ -33,7 +33,7 @@ fi\n \n : \"${VN:=$DEF_VER}\"\n \n-VN=$(expr \"$VN\" : 'v*\\(.*\\)')\n+VN=${VN#v}\n \n if test -r $GVF\n then\n-- \n2.40.0+fc1\n\n"},{"id":"475361","messageId":"20230414121841.373980-6-felipe.contreras@gmail.com","threadId":"59597","inReplyTo":"20230414121841.373980-1-felipe.contreras@gmail.com","subject":"[PATCH 05/18] version-gen: simplify update check","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2023-04-14T12:18:28Z","receivedAt":"2023-04-14T12:19:07Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"We don't need to extract the version when we can compare the whole\ncontents.\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n GIT-VERSION-GEN | 8 +-------\n 1 file changed, 1 insertion(+), 7 deletions(-)\n\ndiff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN\nindex c0f6bb242f..34f561752b 100755\n--- a/GIT-VERSION-GEN\n+++ b/GIT-VERSION-GEN\n@@ -35,11 +35,5 @@ fi\n \n VN=${VN#v}\n \n-if test -r $GVF\n-then\n-\tVC=$(sed -e 's/^GIT_VERSION = //' <$GVF)\n-else\n-\tVC='unset'\n-fi\n-test \"$VN\" = \"$VC\" && exit\n+test -r $GVF && test \"GIT_VERSION = $VN\" = \"$(cat $GVF)\" && exit\n echo \"GIT_VERSION = $VN\" | tee $GVF >&2\n-- \n2.40.0+fc1\n\n"},{"id":"475362","messageId":"20230414121841.373980-8-felipe.contreras@gmail.com","threadId":"59597","inReplyTo":"20230414121841.373980-1-felipe.contreras@gmail.com","subject":"[PATCH 07/18] version-gen: simplify `git describe` checks","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2023-04-14T12:18:30Z","receivedAt":"2023-04-14T12:19:10Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"How can `git describe --match 'foo*'` return something that doesn't\ncontain 'foo' and without error?\n\nIt can't, so no need for check for the impossible.\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n GIT-VERSION-GEN | 17 +++--------------\n 1 file changed, 3 insertions(+), 14 deletions(-)\n\ndiff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN\nindex cd94a7902e..0021e88cdc 100755\n--- a/GIT-VERSION-GEN\n+++ b/GIT-VERSION-GEN\n@@ -3,22 +3,11 @@\n GVF=GIT-VERSION-FILE\n DEF_VER=v2.40.GIT\n \n-LF='\n-'\n-\n describe () {\n \tVN=$(git describe --match \"v[0-9]*\" 2>/dev/null) || return 1\n-\tcase \"$VN\" in\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\treturn 0\n-\t\t;;\n-\tesac\n+\tgit update-index -q --refresh\n+\ttest -z \"$(git diff-index --name-only HEAD --)\" ||\n+\tVN=\"$VN-dirty\"\n }\n \n # First see if there is a version file (included in release tarballs),\n-- \n2.40.0+fc1\n\n"},{"id":"475363","messageId":"20230414121841.373980-7-felipe.contreras@gmail.com","threadId":"59597","inReplyTo":"20230414121841.373980-1-felipe.contreras@gmail.com","subject":"[PATCH 06/18] version-gen: remove redundant check","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2023-04-14T12:18:29Z","receivedAt":"2023-04-14T12:19:11Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"If we are not in a git repository `git describe` will fail anyway.\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n GIT-VERSION-GEN | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN\nindex 34f561752b..cd94a7902e 100755\n--- a/GIT-VERSION-GEN\n+++ b/GIT-VERSION-GEN\n@@ -26,7 +26,7 @@ describe () {\n if test -f version\n then\n \tVN=$(cat version)\n-elif test -d \"${GIT_DIR:-.git}\" -o -f .git && describe\n+elif describe\n then\n \tVN=$(echo \"$VN\" | sed -e 's/-/./g')\n fi\n-- \n2.40.0+fc1\n\n"},{"id":"475364","messageId":"20230414121841.373980-9-felipe.contreras@gmail.com","threadId":"59597","inReplyTo":"20230414121841.373980-1-felipe.contreras@gmail.com","subject":"[PATCH 08/18] version-gen: simplify dirty check","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2023-04-14T12:18:31Z","receivedAt":"2023-04-14T12:19:39Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n GIT-VERSION-GEN | 5 +----\n 1 file changed, 1 insertion(+), 4 deletions(-)\n\ndiff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN\nindex 0021e88cdc..9be9e14204 100755\n--- a/GIT-VERSION-GEN\n+++ b/GIT-VERSION-GEN\n@@ -4,10 +4,7 @@ GVF=GIT-VERSION-FILE\n DEF_VER=v2.40.GIT\n \n describe () {\n-\tVN=$(git describe --match \"v[0-9]*\" 2>/dev/null) || return 1\n-\tgit update-index -q --refresh\n-\ttest -z \"$(git diff-index --name-only HEAD --)\" ||\n-\tVN=\"$VN-dirty\"\n+\tVN=$(git describe --match \"v[0-9]*\" --dirty 2>/dev/null) || return 1\n }\n \n # First see if there is a version file (included in release tarballs),\n-- \n2.40.0+fc1\n\n"},{"id":"475365","messageId":"20230414121841.373980-10-felipe.contreras@gmail.com","threadId":"59597","inReplyTo":"20230414121841.373980-1-felipe.contreras@gmail.com","subject":"[PATCH 09/18] version-gen: move describe fix into function","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2023-04-14T12:18:32Z","receivedAt":"2023-04-14T12:19:42Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n GIT-VERSION-GEN | 6 +++---\n 1 file changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN\nindex 9be9e14204..b7d2b8758e 100755\n--- a/GIT-VERSION-GEN\n+++ b/GIT-VERSION-GEN\n@@ -5,6 +5,7 @@ DEF_VER=v2.40.GIT\n \n describe () {\n \tVN=$(git describe --match \"v[0-9]*\" --dirty 2>/dev/null) || return 1\n+\tVN=$(echo \"$VN\" | sed -e 's/-/./g')\n }\n \n # First see if there is a version file (included in release tarballs),\n@@ -12,9 +13,8 @@ describe () {\n if test -f version\n then\n \tVN=$(cat version)\n-elif describe\n-then\n-\tVN=$(echo \"$VN\" | sed -e 's/-/./g')\n+else\n+\tdescribe\n fi\n \n : \"${VN:=$DEF_VER}\"\n-- \n2.40.0+fc1\n\n"},{"id":"475366","messageId":"20230414121841.373980-12-felipe.contreras@gmail.com","threadId":"59597","inReplyTo":"20230414121841.373980-1-felipe.contreras@gmail.com","subject":"[PATCH 11/18] version-gen: refactor describe function","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2023-04-14T12:18:34Z","receivedAt":"2023-04-14T12:19:50Z","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 | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN\nindex 962b9441e4..d4de540249 100755\n--- a/GIT-VERSION-GEN\n+++ b/GIT-VERSION-GEN\n@@ -4,7 +4,7 @@ GVF=GIT-VERSION-FILE\n DEF_VER=v2.40.GIT\n \n describe () {\n-\tVN=$(git describe --match \"v[0-9]*\" --dirty 2>/dev/null | sed -e 's/-/./g') || return 1\n+\tgit describe --match \"v[0-9]*\" --dirty 2>/dev/null | sed -e 's/-/./g'\n }\n \n # First see if there is a version file (included in release tarballs),\n@@ -13,7 +13,7 @@ if test -f version\n then\n \tVN=$(cat version)\n else\n-\tdescribe\n+\tVN=$(describe)\n fi\n \n : \"${VN:=$DEF_VER}\"\n-- \n2.40.0+fc1\n\n"},{"id":"475367","messageId":"20230414121841.373980-11-felipe.contreras@gmail.com","threadId":"59597","inReplyTo":"20230414121841.373980-1-felipe.contreras@gmail.com","subject":"[PATCH 10/18] version-gen: describe and sed in one go","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2023-04-14T12:18:33Z","receivedAt":"2023-04-14T12:19:51Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n GIT-VERSION-GEN | 3 +--\n 1 file changed, 1 insertion(+), 2 deletions(-)\n\ndiff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN\nindex b7d2b8758e..962b9441e4 100755\n--- a/GIT-VERSION-GEN\n+++ b/GIT-VERSION-GEN\n@@ -4,8 +4,7 @@ GVF=GIT-VERSION-FILE\n DEF_VER=v2.40.GIT\n \n describe () {\n-\tVN=$(git describe --match \"v[0-9]*\" --dirty 2>/dev/null) || return 1\n-\tVN=$(echo \"$VN\" | sed -e 's/-/./g')\n+\tVN=$(git describe --match \"v[0-9]*\" --dirty 2>/dev/null | sed -e 's/-/./g') || return 1\n }\n \n # First see if there is a version file (included in release tarballs),\n-- \n2.40.0+fc1\n\n"},{"id":"475368","messageId":"20230414121841.373980-14-felipe.contreras@gmail.com","threadId":"59597","inReplyTo":"20230414121841.373980-1-felipe.contreras@gmail.com","subject":"[PATCH 13/18] version-gen: move v fix into sed","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2023-04-14T12:18:36Z","receivedAt":"2023-04-14T12:19:51Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"We are already using sed, might as well take advantage of it.\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n GIT-VERSION-GEN | 3 +--\n 1 file changed, 1 insertion(+), 2 deletions(-)\n\ndiff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN\nindex 0691f481e4..fa0e72a32c 100755\n--- a/GIT-VERSION-GEN\n+++ b/GIT-VERSION-GEN\n@@ -4,7 +4,7 @@ GVF=GIT-VERSION-FILE\n DEF_VER=2.40.GIT\n \n describe () {\n-\tgit describe --match \"v[0-9]*\" --dirty 2>/dev/null | sed -e 's/-/./g'\n+\tgit describe --match \"v[0-9]*\" --dirty 2>/dev/null | sed -e 's/-/./g' -e 's/^v//'\n }\n \n # First see if there is a version file (included in release tarballs),\n@@ -14,7 +14,6 @@ then\n \tVN=$(cat version)\n else\n \tVN=$(describe)\n-\tVN=${VN#v}\n fi\n \n : \"${VN:=$DEF_VER}\"\n-- \n2.40.0+fc1\n\n"},{"id":"475369","messageId":"20230414121841.373980-16-felipe.contreras@gmail.com","threadId":"59597","inReplyTo":"20230414121841.373980-1-felipe.contreras@gmail.com","subject":"[PATCH 15/18] version-gen: remove default version","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2023-04-14T12:18:38Z","receivedAt":"2023-04-14T12:20:11Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"There's two use-cases:\n\n 1) We are in a git repository\n\n 2) We are in a dir extracted from a tarball\n\nIs there any other case?\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n GIT-VERSION-GEN | 3 ---\n 1 file changed, 3 deletions(-)\n\ndiff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN\nindex 53b3d64131..2b0973f4b5 100755\n--- a/GIT-VERSION-GEN\n+++ b/GIT-VERSION-GEN\n@@ -1,7 +1,6 @@\n #!/bin/sh\n \n GVF=GIT-VERSION-FILE\n-DEF_VER=2.40.GIT\n \n get_version () {\n \ttest -f version && cat version && return\n@@ -10,7 +9,5 @@ get_version () {\n \n VN=$(get_version)\n \n-: \"${VN:=$DEF_VER}\"\n-\n test -r $GVF && test \"GIT_VERSION = $VN\" = \"$(cat $GVF)\" && exit\n echo \"GIT_VERSION = $VN\" | tee $GVF >&2\n-- \n2.40.0+fc1\n\n"},{"id":"475370","messageId":"20230414121841.373980-13-felipe.contreras@gmail.com","threadId":"59597","inReplyTo":"20230414121841.373980-1-felipe.contreras@gmail.com","subject":"[PATCH 12/18] version-gen: do v fix only when necessary","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2023-04-14T12:18:35Z","receivedAt":"2023-04-14T12:20:11Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"There's no point in having a v in the default version only to be\nremoved.\n\nThe only time we need to remove the v is from `git describe`.\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n GIT-VERSION-GEN | 5 ++---\n 1 file changed, 2 insertions(+), 3 deletions(-)\n\ndiff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN\nindex d4de540249..0691f481e4 100755\n--- a/GIT-VERSION-GEN\n+++ b/GIT-VERSION-GEN\n@@ -1,7 +1,7 @@\n #!/bin/sh\n \n GVF=GIT-VERSION-FILE\n-DEF_VER=v2.40.GIT\n+DEF_VER=2.40.GIT\n \n describe () {\n \tgit describe --match \"v[0-9]*\" --dirty 2>/dev/null | sed -e 's/-/./g'\n@@ -14,11 +14,10 @@ then\n \tVN=$(cat version)\n else\n \tVN=$(describe)\n+\tVN=${VN#v}\n fi\n \n : \"${VN:=$DEF_VER}\"\n \n-VN=${VN#v}\n-\n test -r $GVF && test \"GIT_VERSION = $VN\" = \"$(cat $GVF)\" && exit\n echo \"GIT_VERSION = $VN\" | tee $GVF >&2\n-- \n2.40.0+fc1\n\n"},{"id":"475372","messageId":"20230414121841.373980-15-felipe.contreras@gmail.com","threadId":"59597","inReplyTo":"20230414121841.373980-1-felipe.contreras@gmail.com","subject":"[PATCH 14/18] version-gen: refactor main functionality","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2023-04-14T12:18:37Z","receivedAt":"2023-04-14T12:20:11Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"It's pretty clear that the `version` file overrides `describe`, so do it\nin one function.\n\nThere's no need for the comment as the code is self-describing.\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n GIT-VERSION-GEN | 12 +++---------\n 1 file changed, 3 insertions(+), 9 deletions(-)\n\ndiff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN\nindex fa0e72a32c..53b3d64131 100755\n--- a/GIT-VERSION-GEN\n+++ b/GIT-VERSION-GEN\n@@ -3,18 +3,12 @@\n GVF=GIT-VERSION-FILE\n DEF_VER=2.40.GIT\n \n-describe () {\n+get_version () {\n+\ttest -f version && cat version && return\n \tgit describe --match \"v[0-9]*\" --dirty 2>/dev/null | sed -e 's/-/./g' -e 's/^v//'\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)\n-else\n-\tVN=$(describe)\n-fi\n+VN=$(get_version)\n \n : \"${VN:=$DEF_VER}\"\n \n-- \n2.40.0+fc1\n\n"},{"id":"475373","messageId":"20230414121841.373980-18-felipe.contreras@gmail.com","threadId":"59597","inReplyTo":"20230414121841.373980-1-felipe.contreras@gmail.com","subject":"[PATCH 17/18] version-gen: get rid of GVF variable","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2023-04-14T12:18:40Z","receivedAt":"2023-04-14T12:20:11Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"There's not much point in a variable which is never going to change and\ndoesn't really add any readability.\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n GIT-VERSION-GEN | 6 ++----\n 1 file changed, 2 insertions(+), 4 deletions(-)\n\ndiff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN\nindex 8f2250bb1b..161fcdf1ab 100755\n--- a/GIT-VERSION-GEN\n+++ b/GIT-VERSION-GEN\n@@ -1,7 +1,5 @@\n #!/bin/sh\n \n-GVF=GIT-VERSION-FILE\n-\n get_version () {\n \ttest -f version && cat version && return\n \tgit describe --match \"v[0-9]*\" --dirty 2>/dev/null | sed -e 's/-/./g' -e 's/^v//'\n@@ -9,5 +7,5 @@ get_version () {\n \n NEW=\"GIT_VERSION = $(get_version)\"\n \n-test -r $GVF && test \"$NEW\" = \"$(cat $GVF)\" && exit\n-echo \"$NEW\" | tee $GVF >&2\n+test -r GIT-VERSION-FILE && test \"$NEW\" = \"$(cat GIT-VERSION-FILE)\" && exit\n+echo \"$NEW\" | tee GIT-VERSION-FILE >&2\n-- \n2.40.0+fc1\n\n"},{"id":"475371","messageId":"20230414121841.373980-17-felipe.contreras@gmail.com","threadId":"59597","inReplyTo":"20230414121841.373980-1-felipe.contreras@gmail.com","subject":"[PATCH 16/18] version-gen: refactor GIT_VERSION string","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2023-04-14T12:18:39Z","receivedAt":"2023-04-14T12:20:12Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n GIT-VERSION-GEN | 6 +++---\n 1 file changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN\nindex 2b0973f4b5..8f2250bb1b 100755\n--- a/GIT-VERSION-GEN\n+++ b/GIT-VERSION-GEN\n@@ -7,7 +7,7 @@ get_version () {\n \tgit describe --match \"v[0-9]*\" --dirty 2>/dev/null | sed -e 's/-/./g' -e 's/^v//'\n }\n \n-VN=$(get_version)\n+NEW=\"GIT_VERSION = $(get_version)\"\n \n-test -r $GVF && test \"GIT_VERSION = $VN\" = \"$(cat $GVF)\" && exit\n-echo \"GIT_VERSION = $VN\" | tee $GVF >&2\n+test -r $GVF && test \"$NEW\" = \"$(cat $GVF)\" && exit\n+echo \"$NEW\" | tee $GVF >&2\n-- \n2.40.0+fc1\n\n"},{"id":"475374","messageId":"20230414121841.373980-19-felipe.contreras@gmail.com","threadId":"59597","inReplyTo":"20230414121841.373980-1-felipe.contreras@gmail.com","subject":"[PATCH 18/18] version-gen: generate proper interim versions","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2023-04-14T12:18:41Z","receivedAt":"2023-04-14T12:20:12Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"The change from dashes to dots was done in 2006 to satisfy some RPM\n requirements: 5c7d3c9507 (Allow building of RPM from interim snapshot.,\n2006-01-16).\n\nThis probably was done because `2.40.0-100-g000` would be interpreted as\nversion `2.40.0` release `100`.\n\nIt isn't clear because the commit message doesn't explain.\n\nBut using a dot makes it worse because `2.40.0.n` will always be newer\nthan `2.40.0-n`.\n\nWhat we want is an ordering such as:\n\n * 2.40.0         # git release\n * 2.40.0+100-g00 # interim version\n * 2.40.0-1       # Fedora release\n * 2.40.0.1       # hypothetical git release\n\nSo we should use a single `+` sign for interim versions, and for the\nrecord that's what Mercurial does `6.3.3+hg591.dd42156b6441`.\n\n[1] https://rpm-software-management.github.io/rpm/manual/dependencies.html\n\nCc: Junio C Hamano <gitster@pobox.com>\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n GIT-VERSION-GEN | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN\nindex 161fcdf1ab..99584bf86d 100755\n--- a/GIT-VERSION-GEN\n+++ b/GIT-VERSION-GEN\n@@ -2,7 +2,7 @@\n \n get_version () {\n \ttest -f version && cat version && return\n-\tgit describe --match \"v[0-9]*\" --dirty 2>/dev/null | sed -e 's/-/./g' -e 's/^v//'\n+\tgit describe --match \"v[0-9]*\" --dirty 2>/dev/null | sed -e 's/-/+/' -e 's/^v//'\n }\n \n NEW=\"GIT_VERSION = $(get_version)\"\n-- \n2.40.0+fc1\n\n"},{"id":"475382","messageId":"ZDltLSTxBCWRoMjK@pobox.com","threadId":"59597","inReplyTo":"20230414121841.373980-7-felipe.contreras@gmail.com","subject":"Re: [PATCH 06/18] version-gen: remove redundant check","fromName":"Todd Zullinger","fromEmail":"tmz@pobox.com","sentAt":"2023-04-14T15:11:41Z","receivedAt":"2023-04-14T15:11:53Z","isPatch":true,"sender":{"key":"tmz@pobox.com","avatar":"https://avatars.githubusercontent.com/u/806319?v=4"},"body":"Felipe Contreras wrote:\n> If we are not in a git repository `git describe` will fail anyway.\n\nThe parent directory may be a git repository though.  The\ncurrent code ensures that we're running `git describe` in\nthe proper repository.\n\nIf we drop this, aren't we breaking things for someone\nbuilding a git tarball which is in a subdirectory of a git\nrepository?\n\n> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n> ---\n>  GIT-VERSION-GEN | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n> \n> diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN\n> index 34f561752b..cd94a7902e 100755\n> --- a/GIT-VERSION-GEN\n> +++ b/GIT-VERSION-GEN\n> @@ -26,7 +26,7 @@ describe () {\n>  if test -f version\n>  then\n>  \tVN=$(cat version)\n> -elif test -d \"${GIT_DIR:-.git}\" -o -f .git && describe\n> +elif describe\n>  then\n>  \tVN=$(echo \"$VN\" | sed -e 's/-/./g')\n>  fi\n\n-- \nTodd\n"},{"id":"475396","messageId":"643991c58aef_5ecfe29433@chronos.notmuch","threadId":"59597","inReplyTo":"ZDltLSTxBCWRoMjK@pobox.com","subject":"Re: [PATCH 06/18] version-gen: remove redundant check","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2023-04-14T17:47:49Z","receivedAt":"2023-04-14T17:47:55Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Todd Zullinger wrote:\n> Felipe Contreras wrote:\n> > If we are not in a git repository `git describe` will fail anyway.\n> \n> The parent directory may be a git repository though.  The\n> current code ensures that we're running `git describe` in\n> the proper repository.\n\nHow exactly does it do that?\n\nThe current code expects the cwd to be the git repo, run it in any other\ndirectory and it will generate GIT-VERSION-FILE in that directory, which is\nclearly not intended.\n\n> If we drop this, aren't we breaking things for someone\n> building a git tarball which is in a subdirectory of a git\n> repository?\n\nHow exactly would this hypothetical person build such a tarball?\n\n  git init /tmp/foo\n  mkdir -p /tmp/foo/bar\n  cd /tmp/foo/bar\n  make -C ~/dev/git dist\n\nWorks fine.\n\n-- \nFelipe Contreras\n"},{"id":"475408","messageId":"ZDmjIqNwVMESgHnn@pobox.com","threadId":"59597","inReplyTo":"643991c58aef_5ecfe29433@chronos.notmuch","subject":"Re: [PATCH 06/18] version-gen: remove redundant check","fromName":"Todd Zullinger","fromEmail":"tmz@pobox.com","sentAt":"2023-04-14T19:01:54Z","receivedAt":"2023-04-14T19:02:08Z","isPatch":true,"sender":{"key":"tmz@pobox.com","avatar":"https://avatars.githubusercontent.com/u/806319?v=4"},"body":"Felipe Contreras wrote:\n> Todd Zullinger wrote:\n>> Felipe Contreras wrote:\n>>> If we are not in a git repository `git describe` will fail anyway.\n>> \n>> The parent directory may be a git repository though.  The\n>> current code ensures that we're running `git describe` in\n>> the proper repository.\n> \n> How exactly does it do that?\n> \n> The current code expects the cwd to be the git repo, run it in any other\n> directory and it will generate GIT-VERSION-FILE in that directory, which is\n> clearly not intended.\n\nWhether it's fool proof isn't really my point.  It did\nattempt to check that .git was a file or directory.  Not\nchecking at all isn't necessarily an improvement, was my\nconcern.\n\n>> If we drop this, aren't we breaking things for someone\n>> building a git tarball which is in a subdirectory of a git\n>> repository?\n> \n> How exactly would this hypothetical person build such a tarball?\n> \n>   git init /tmp/foo\n>   mkdir -p /tmp/foo/bar\n>   cd /tmp/foo/bar\n>   make -C ~/dev/git dist\n\nIf I have a git repo, say ~/fedora/git which contains the\nfedora packaging (spec file, etc.) and extract a git archive\nin this directory, the describe will now pick up the data\nfrom the parent git directory, won't it?\n\n    $ git -C ~/fedora clone https://src.fedoraproject.org/rpms/git.git\n    $ cd ~/fedora/git\n    $ git -C ~/upstream/git archive --format=tar --prefix=git/ HEAD | tar xf -\n    $ cd git\n    $ make GIT-VERSION-GEN\n    $ cat GIT-VERSION-FILE \n    GIT_VERSION = \n\nThe version file in the tarballs prevents this from\nhappening in the most common case, but it still feels like\nthis is loosening things a little more than it should.\n\n-- \nTodd\n"},{"id":"475409","messageId":"6439aa5b2c776_6058729489@chronos.notmuch","threadId":"59597","inReplyTo":"ZDmjIqNwVMESgHnn@pobox.com","subject":"Re: [PATCH 06/18] version-gen: remove redundant check","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2023-04-14T19:32:43Z","receivedAt":"2023-04-14T19:32:55Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Todd Zullinger wrote:\n> Felipe Contreras wrote:\n> > Todd Zullinger wrote:\n> >> Felipe Contreras wrote:\n> >>> If we are not in a git repository `git describe` will fail anyway.\n> >> \n> >> The parent directory may be a git repository though.  The\n> >> current code ensures that we're running `git describe` in\n> >> the proper repository.\n> > \n> > How exactly does it do that?\n> > \n> > The current code expects the cwd to be the git repo, run it in any other\n> > directory and it will generate GIT-VERSION-FILE in that directory, which is\n> > clearly not intended.\n> \n> Whether it's fool proof isn't really my point.  It did\n> attempt to check that .git was a file or directory.  Not\n> checking at all isn't necessarily an improvement, was my\n> concern.\n> \n> >> If we drop this, aren't we breaking things for someone\n> >> building a git tarball which is in a subdirectory of a git\n> >> repository?\n> > \n> > How exactly would this hypothetical person build such a tarball?\n> > \n> >   git init /tmp/foo\n> >   mkdir -p /tmp/foo/bar\n> >   cd /tmp/foo/bar\n> >   make -C ~/dev/git dist\n> \n> If I have a git repo, say ~/fedora/git which contains the\n> fedora packaging (spec file, etc.) and extract a git archive\n> in this directory, the describe will now pick up the data\n> from the parent git directory, won't it?\n> \n>     $ git -C ~/fedora clone https://src.fedoraproject.org/rpms/git.git\n>     $ cd ~/fedora/git\n>     $ git -C ~/upstream/git archive --format=tar --prefix=git/ HEAD | tar xf -\n>     $ cd git\n>     $ make GIT-VERSION-GEN\n>     $ cat GIT-VERSION-FILE \n>     GIT_VERSION = \n\nI don't think this is a realistic use-case, but supposing it is, what would be\nthe desired outcome in this case?\n\n GIT_VERSION = 2.40.GIT\n\n?\n\n> The version file in the tarballs prevents this from\n> happening in the most common case, but it still feels like\n> this is loosening things a little more than it should.\n\nIf we care about this, the same behavior can be achieved with GIT_CEILING_DIRECTORIES:\n\n GIT_CEILING_DIRECTORIES=$(cd .. && pwd) git describe ...\n\n-- \nFelipe Contreras\n"},{"id":"475410","messageId":"ZDmsg0njhtv_qM9a@pobox.com","threadId":"59597","inReplyTo":"6439aa5b2c776_6058729489@chronos.notmuch","subject":"Re: [PATCH 06/18] version-gen: remove redundant check","fromName":"Todd Zullinger","fromEmail":"tmz@pobox.com","sentAt":"2023-04-14T19:41:55Z","receivedAt":"2023-04-14T19:42:09Z","isPatch":true,"sender":{"key":"tmz@pobox.com","avatar":"https://avatars.githubusercontent.com/u/806319?v=4"},"body":"Felipe Contreras wrote:\n> Todd Zullinger wrote:\n>> If I have a git repo, say ~/fedora/git which contains the\n>> fedora packaging (spec file, etc.) and extract a git archive\n>> in this directory, the describe will now pick up the data\n>> from the parent git directory, won't it?\n>> \n>>     $ git -C ~/fedora clone https://src.fedoraproject.org/rpms/git.git\n>>     $ cd ~/fedora/git\n>>     $ git -C ~/upstream/git archive --format=tar --prefix=git/ HEAD | tar xf -\n>>     $ cd git\n>>     $ make GIT-VERSION-GEN\n>>     $ cat GIT-VERSION-FILE \n>>     GIT_VERSION = \n> \n> I don't think this is a realistic use-case, but supposing it is, what would be\n> the desired outcome in this case?\n> \n>  GIT_VERSION = 2.40.GIT\n> \n> ?\n\nThat's what we get before this change.  I don't have an\nopinion on whether that could/should change, but if it does,\nit should be deliberate I think.\n\n>> The version file in the tarballs prevents this from\n>> happening in the most common case, but it still feels like\n>> this is loosening things a little more than it should.\n> \n> If we care about this, the same behavior can be achieved with GIT_CEILING_DIRECTORIES:\n> \n>  GIT_CEILING_DIRECTORIES=$(cd .. && pwd) git describe ...\n\nI only mention it because it seemed like a change in\nbehavior when the series aimed to not change any behavior.\nI'm sure there are plenty of things which could be changed\nwhile making imrpveoments here.  I think we'll be better off\nif those changes are all noted and deliberate.\n\nThanks for working on this stuff, it is good to see\nimprovements to this sort of plumbing.\n\n-- \nTodd\n"}]}