git/list[1] front-page[2] threads[3] people[4] search[5] about
 

setlocalversion wasn't producing git labels for bisect

From
David Greaves <david@dgreaves.com>
Date
Aug 30, 2008, 19:43 UTC
Message-ID
<48B9A2C7.3080001@dgreaves.com>
Trying to do a bisect with git version 1.5.6.3 didn't work with the setlocalversion script
Running
  git name-rev --tags HEAD
gives the output
  HEAD tags/v2.6.27-rc4~44^2
This isn't matched by setlocalversion regexp so it makes it harder to make deb-pkg/install/grub/reboot/remove
Of course if this patch is accepted it is going to make life complicated when bisecting around it.
Maybe git should behave as the man page suggests and have the ^X before the ~nnn? (maybe it has been fixed already)
  http://www.kernel.org/pub/software/scm/git/docs/v1.5.6.5/git-name-rev.html
shows an example:
  33db5f4d9027a10e477ccf054b2c1ab94f74c85a tags/v0.99^0~940
David
commit 511c5f04eb2df03dbbae97ede82913da1f141f86
Author: David Greaves <david@dgreaves.com>
Date:   Sat Aug 30 14:53:35 2008 +0100
    setlocalversion wasn't producing git labels for bisect
diff --git a/scripts/setlocalversion b/scripts/setlocalversion
index 83b7512..89f126d 100755
--- a/scripts/setlocalversion
+++ b/scripts/setlocalversion
@@ -11,7 +11,7 @@ cd "${1:-.}" || usage
 # Check for git and a git repo.
 if head=`git rev-parse --verify HEAD 2>/dev/null`; then
 	# Do we have an untagged version?
-	if git name-rev --tags HEAD | grep -E '^HEAD[[:space:]]+(.*~[0-9]*|undefined)$' > /dev/null; then
+	if git name-rev --tags HEAD | grep -E '^HEAD[[:space:]]+(.*~[0-9^]*|undefined)$' > /dev/null; then
 		if tag=`git describe 2>/dev/null`; then
 			echo $tag | awk -F- '{printf("-%05d-%s", $(NF-1),$(NF))}'
 		fi
Next: Junio C Hamano
Message 1 of 5 in “setlocalversion wasn't producing git labels for bisect”
  1. David GreavesAug 30, 2008
  2. Junio C HamanoAug 30, 2008
  3. Fix example in git-name-rev documentationJunio C Hamano, Aug 30, 2008
  4. Johannes SchindelinSep 1, 2008
  5. [Regression] Re: setlocalversion wasn't producing git labels for bisectDavid Greaves, Aug 31, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.