{"thread":{"id":"15288","subject":"setlocalversion wasn't producing git labels for bisect","startedAt":"2008-08-30T19:43:03Z","lastAt":"2008-09-01T11:07:12Z","messageCount":5,"participants":["David Greaves","Junio C Hamano","Johannes Schindelin"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"89242","messageId":"48B9A2C7.3080001@dgreaves.com","threadId":"15288","inReplyTo":null,"subject":"setlocalversion wasn't producing git labels for bisect","fromName":"David Greaves","fromEmail":"david@dgreaves.com","sentAt":"2008-08-30T19:43:03Z","receivedAt":"2008-08-30T19:43:03Z","isPatch":false,"sender":{"key":"david@dgreaves.com","avatar":"https://gravatar.com/avatar/ca67bad50999edcdd137c9a65da2381557d175bea99ae956afdabc5785e42b79?d=mp&s=160"},"body":"Trying to do a bisect with git version 1.5.6.3 didn't work with the setlocalversion script\n\nRunning\n  git name-rev --tags HEAD\ngives the output\n  HEAD tags/v2.6.27-rc4~44^2\n\nThis isn't matched by setlocalversion regexp so it makes it harder to make deb-pkg/install/grub/reboot/remove\n\nOf course if this patch is accepted it is going to make life complicated when bisecting around it.\nMaybe git should behave as the man page suggests and have the ^X before the ~nnn? (maybe it has been fixed already)\n  http://www.kernel.org/pub/software/scm/git/docs/v1.5.6.5/git-name-rev.html\nshows an example:\n  33db5f4d9027a10e477ccf054b2c1ab94f74c85a tags/v0.99^0~940\n\nDavid\n\ncommit 511c5f04eb2df03dbbae97ede82913da1f141f86\nAuthor: David Greaves <david@dgreaves.com>\nDate:   Sat Aug 30 14:53:35 2008 +0100\n\n    setlocalversion wasn't producing git labels for bisect\n\ndiff --git a/scripts/setlocalversion b/scripts/setlocalversion\nindex 83b7512..89f126d 100755\n--- a/scripts/setlocalversion\n+++ b/scripts/setlocalversion\n@@ -11,7 +11,7 @@ cd \"${1:-.}\" || usage\n # Check for git and a git repo.\n if head=`git rev-parse --verify HEAD 2>/dev/null`; then\n \t# Do we have an untagged version?\n-\tif git name-rev --tags HEAD | grep -E '^HEAD[[:space:]]+(.*~[0-9]*|undefined)$' > /dev/null; then\n+\tif git name-rev --tags HEAD | grep -E '^HEAD[[:space:]]+(.*~[0-9^]*|undefined)$' > /dev/null; then\n \t\tif tag=`git describe 2>/dev/null`; then\n \t\t\techo $tag | awk -F- '{printf(\"-%05d-%s\", $(NF-1),$(NF))}'\n \t\tfi\n"},{"id":"89246","messageId":"7vbpzagtb7.fsf@gitster.siamese.dyndns.org","threadId":"15288","inReplyTo":"48B9A2C7.3080001@dgreaves.com","subject":"Re: setlocalversion wasn't producing git labels for bisect","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-08-30T20:07:56Z","receivedAt":"2008-08-30T20:07:56Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"David Greaves <david@dgreaves.com> writes:\n\n> Running\n>   git name-rev --tags HEAD\n> gives the output\n>   HEAD tags/v2.6.27-rc4~44^2\n>\n> This isn't matched by setlocalversion regexp so it makes it harder to make deb-pkg/install/grub/reboot/remove\n>\n> Of course if this patch is accepted it is going to make life complicated when bisecting around it.\n> Maybe git should behave as the man page suggests and have the ^X before the ~nnn? (maybe it has been fixed already)\n\nSorry, I don't understand what you are trying to fix here.\n\nYour head can be reached by going 44 generations back (following the first\nparent chain) from v2.6.27-rc4, which is a merge commit, and then taking\nits second parent.  IOW the name-rev output you quoted represents this\nhistory:\n\n                                  v2.6.27-rc4\n       ----o---o---o---....---o---o\n          /^                  ^\n         / v2.6.27-rc4~44     v2.6.27-rc4~1\n        o\n        ^ Your HEAD\n\nSwapping ^X and ~nnn changes the meaning completely.  v2.6.27-rc4^2~44 is\nthe 44 generation ancestor of the second parent of -rc4, but v2.6.27-rc4\nis *NOT* a merge and it does not have the second parent.\n\n>   http://www.kernel.org/pub/software/scm/git/docs/v1.5.6.5/git-name-rev.html\n> shows an example:\n>   33db5f4d9027a10e477ccf054b2c1ab94f74c85a tags/v0.99^0~940\n\nThis says\n\n    v0.99 is a tag, and dereference it (^0) to get to the commit that\n    points at it, and then the commit in question (33db5f) is its 940th\n    generation ancestor.\n\nWe used to explicitly say \"it is a tag and dereference it\" by adding ^0\nbut since Feb 2007 we stopped doing so because taking its 940th parent\ncan only be done to a commit, so v0.99~940 and v0.99^0~940 are equivalent.\n\nWe should fix the documentation, though.\n"},{"id":"89247","messageId":"7v7i9ygt4x.fsf@gitster.siamese.dyndns.org","threadId":"15288","inReplyTo":"48B9A2C7.3080001@dgreaves.com","subject":"[PATCH] Fix example in git-name-rev documentation","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-08-30T20:11:42Z","receivedAt":"2008-08-30T20:11:42Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Since 59d3f54 (name-rev: avoid \"^0\" when unneeded, 2007-02-20), name-rev\nstopped showing an unnecessary \"^0\" to dereference a tag down to a commit.\nThe patch should have made a matching update to the documentation, but we\nforgot.\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n Documentation/git-name-rev.txt |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/Documentation/git-name-rev.txt b/Documentation/git-name-rev.txt\nindex abd2237..7ca8a7b 100644\n--- a/Documentation/git-name-rev.txt\n+++ b/Documentation/git-name-rev.txt\n@@ -59,7 +59,7 @@ Enter 'git-name-rev':\n \n ------------\n % git name-rev 33db5f4d9027a10e477ccf054b2c1ab94f74c85a\n-33db5f4d9027a10e477ccf054b2c1ab94f74c85a tags/v0.99^0~940\n+33db5f4d9027a10e477ccf054b2c1ab94f74c85a tags/v0.99~940\n ------------\n \n Now you are wiser, because you know that it happened 940 revisions before v0.99.\n-- \n1.6.0.1.162.g04bc\n"},{"id":"89304","messageId":"48BA6F25.8040102@dgreaves.com","threadId":"15288","inReplyTo":"48B9A2C7.3080001@dgreaves.com","subject":"[Regression] Re: setlocalversion wasn't producing git labels for bisect","fromName":"David Greaves","fromEmail":"david@dgreaves.com","sentAt":"2008-08-31T10:15:01Z","receivedAt":"2008-08-31T10:15:01Z","isPatch":false,"sender":{"key":"david@dgreaves.com","avatar":"https://gravatar.com/avatar/ca67bad50999edcdd137c9a65da2381557d175bea99ae956afdabc5785e42b79?d=mp&s=160"},"body":"David Greaves wrote:\n\n> Trying to do a bisect with git version 1.5.6.3 didn't work with the setlocalversion script\n>\n> Running\n>   git name-rev --tags HEAD\n> gives the output\n>   HEAD tags/v2.6.27-rc4~44^2\n>\n> This isn't matched by setlocalversion regexp so it makes it harder to make deb-pkg/install/grub/reboot/remove\n>\n> Of course if this patch is accepted it is going to make life complicated when bisecting around it.\n> Maybe git should behave as the man page suggests and have the ^X before the ~nnn? (maybe it has been fixed already)\n>   http://www.kernel.org/pub/software/scm/git/docs/v1.5.6.5/git-name-rev.html\n> shows an example:\n>   33db5f4d9027a10e477ccf054b2c1ab94f74c85a tags/v0.99^0~940\nOK, I apologise if I'm being dim.\nI use git to get source for all my kernels on all my various machines. Rather than have them all pull from kernel.org I have a local mirror setup that also merges in the stable branches so I can get any tag without hitting the WAN.\n\nWhen I do\n\ncd /usr/src/linux-git/\n\ngit reset --hard v2.6.27-rc5\n\ngit bisect start\n\ngit bisect bad v2.6.27-rc4\n\ngit bisect good v2.6.27-rc3\nzcat /proc/config.gz > .config\n\nmake oldconfig\n\nmake include/config/kernel.release\n\n$ cat include/config/kernel.release\n2.6.27-rc3\n\nI think this should be a -git<nnnnn>\n\nOK I have just done a fresh clone and tried it on that - it's nothing to do with my merged setup. I've also asked on irc and someone else had the problem too.\n\nSo now I think setlocalversion should be (at least)\n+    if git name-rev --tags HEAD | grep -E '^HEAD[[:space:]]+(.*[0-9^~]*|undefined)$' > /dev/null; then\n\nI'm cc'ing the git group since I suspect this is to do with branches or rebases or something arcane and it would be good to get the regexp right.\nThe git-rev-parse manpage talks about many other formats but it's not easy to see which are valid input and which are possible output.\nI also wondered about using git rev-parse in the script but I'm not sure.\n [ -z `git tag -l \\`git name-rev --name-only --tags HEAD\\`` ]\nsprang to mind but I'm still getting ^0 on the end of name-rev in 1.5.6.3 and of course older git versions won't work.\n\n\nIn any case I think bisecting using localversion is broken around this point... I'll get on it manually for the actual bug I've got :)\n\nDavid\n"},{"id":"89405","messageId":"alpine.DEB.1.00.0809011306550.24820@pacific.mpi-cbg.de.mpi-cbg.de","threadId":"15288","inReplyTo":"7v7i9ygt4x.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] Fix example in git-name-rev documentation","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-09-01T11:07:12Z","receivedAt":"2008-09-01T11:07:12Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Sat, 30 Aug 2008, Junio C Hamano wrote:\n\n> Since 59d3f54 (name-rev: avoid \"^0\" when unneeded, 2007-02-20), name-rev\n> stopped showing an unnecessary \"^0\" to dereference a tag down to a commit.\n> The patch should have made a matching update to the documentation, but we\n> forgot.\n\nACK & sorry,\nDscho\n"}]}