{"thread":{"id":"57883","subject":"sudo: git describe during GIT_VERSION_GEN not as expected..","startedAt":"2022-05-15T10:14:36Z","lastAt":"2022-05-15T16:52:02Z","messageCount":5,"participants":["Philip Oakley","Carlo Arenas","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"455295","messageId":"7bb71920-b840-5133-ceac-664c09942772@iee.email","threadId":"57883","inReplyTo":null,"subject":"sudo: git describe during GIT_VERSION_GEN not as expected..","fromName":"Philip Oakley","fromEmail":"philipoakley@iee.email","sentAt":"2022-05-15T10:12:29Z","receivedAt":"2022-05-15T10:14:36Z","isPatch":false,"sender":{"key":"philipoakley@iee.email","avatar":"https://avatars.githubusercontent.com/u/914343?v=4"},"body":"Hi,\n\nI have run into a problem with make/install of git on my old travel \nlaptop. While trying to make / install git with some patches on top of \nyesterdays next (coincidental timing) I'm finding that the generated git \nversion is the default value rather than that of a regular 'get \ndescribe' as used in GIT_VERSION_GEN.\n\nCommit tree state:\n~/repos/git (die_preserve_2)$ git log -4 --oneline --decorate\ndd96dd88c3 (HEAD -> die_preserve_2) rebase: note `preserve` merges may \nbe a pull config option\n53d93c1c94 rebase: help users when dying with `preserve-merges`\n65721c069b rebase.c: state preserve-merges has been removed\n7e84679e2a (junio/next, gitster/next, gitgitgadget/next, git/next) Merge \nbranch 'cb/ci-make-p4-optional' into next\n\nAfter a make/install of the above I'm getting a version string is the \ndefault, rather than referencing the current hash as below. I've already \ntried setting the safe.directory as advised. The second describe \ninvocation is from GIT_VERSION_GEN. Note how it fails to provide the \nexpected output.\n\n~/repos/git (die_preserve_2)$ git version\ngit version 2.36.GIT\n~/repos/git (die_preserve_2)$ git describe --match \"v[0-9]*\" HEAD\nv2.36.1-165-gdd96dd88c3\n~/repos/git (die_preserve_2)$ sudo git describe --match \"v[0-9]*\" HEAD\nfatal: unsafe repository ('/home/philip/repos/git' is owned by someone else)\nTo add an exception for this directory, call:\n\n     git config --global --add safe.directory /home/philip/repos/git\n~/repos/git (die_preserve_2)$ git config --global --get safe.directory\n\n\nIs this a temporary position, as the sudo safe.directory problem is \nstill to be added to next? Or is it a secondary side effect of the \ninstall method as per [1,2]?\n\nPhilip\n\n[1] \nhttps://www.digitalocean.com/community/tutorials/how-to-install-git-from-source-on-ubuntu-20-04-quickstart \n\n     see `sudo make prefix=/usr/local install`\n[2] \nhttps://www.digitalocean.com/community/tutorials/how-to-install-git-on-ubuntu-20-04\n\n"},{"id":"455296","messageId":"e5a7937c-eae0-c30a-9894-c217e4ba904d@iee.email","threadId":"57883","inReplyTo":"7bb71920-b840-5133-ceac-664c09942772@iee.email","subject":"Re: sudo: git describe during GIT_VERSION_GEN not as expected..","fromName":"Philip Oakley","fromEmail":"philipoakley@iee.email","sentAt":"2022-05-15T10:38:14Z","receivedAt":"2022-05-15T10:38:19Z","isPatch":false,"sender":{"key":"philipoakley@iee.email","avatar":"https://avatars.githubusercontent.com/u/914343?v=4"},"body":"couple corrections.\n\nOn 15/05/2022 11:12, Philip Oakley wrote:\n> Hi,\n>\n> I have run into a problem with make/install of git on my old travel \n> laptop. While trying to make / install git with some patches on top of \n> yesterdays next (coincidental timing) I'm finding that the generated \n> git version is the default value rather than that of a regular 'get \n> describe' as used in GIT_VERSION_GEN.\n>\n> Commit tree state:\n> ~/repos/git (die_preserve_2)$ git log -4 --oneline --decorate\n> dd96dd88c3 (HEAD -> die_preserve_2) rebase: note `preserve` merges may \n> be a pull config option\n> 53d93c1c94 rebase: help users when dying with `preserve-merges`\n> 65721c069b rebase.c: state preserve-merges has been removed\n> 7e84679e2a (junio/next, gitster/next, gitgitgadget/next, git/next) \n> Merge branch 'cb/ci-make-p4-optional' into next\n>\n> After a make/install of the above I'm getting a version string is the \n> default, rather than referencing the current hash as below. I've \n> already tried setting the safe.directory as advised. The second \n> describe invocation is from GIT_VERSION_GEN\nwhich, in this case, is invoked by the sudo in the `make install`\n> . Note how it fails to provide the expected output.\n>\n> ~/repos/git (die_preserve_2)$ git version\n> git version 2.36.GIT\n> ~/repos/git (die_preserve_2)$ git describe --match \"v[0-9]*\" HEAD\n> v2.36.1-165-gdd96dd88c3\n> ~/repos/git (die_preserve_2)$ sudo git describe --match \"v[0-9]*\" HEAD\n> fatal: unsafe repository ('/home/philip/repos/git' is owned by someone \n> else)\n> To add an exception for this directory, call:\n>\n>     git config --global --add safe.directory /home/philip/repos/git\n> ~/repos/git (die_preserve_2)$ git config --global --get safe.directory\n\nBad cut & paste. The response was:\n/home/philip/repos/git\n\n>\n>\n> Is this a temporary position, as the sudo safe.directory problem is \n> still to be added to next? Or is it a secondary side effect of the \n> install method as per [1,2]?\n>\n> Philip\n>\n> [1] \n> https://www.digitalocean.com/community/tutorials/how-to-install-git-from-source-on-ubuntu-20-04-quickstart \n>\n>     see `sudo make prefix=/usr/local install`\n> [2] \n> https://www.digitalocean.com/community/tutorials/how-to-install-git-on-ubuntu-20-04\n>\n\n"},{"id":"455297","messageId":"CAPUEspjGiyUOhEZpe1bZ3EQqAruyT-WoC8xorxNfp=ktOw__uw@mail.gmail.com","threadId":"57883","inReplyTo":"7bb71920-b840-5133-ceac-664c09942772@iee.email","subject":"Re: sudo: git describe during GIT_VERSION_GEN not as expected..","fromName":"Carlo Arenas","fromEmail":"carenas@gmail.com","sentAt":"2022-05-15T11:05:41Z","receivedAt":"2022-05-15T11:06:08Z","isPatch":false,"sender":{"key":"carenas@gmail.com","avatar":"https://avatars.githubusercontent.com/u/76036?v=4"},"body":"On Sun, May 15, 2022 at 3:12 AM Philip Oakley <philipoakley@iee.email> wrote:\n> Is this a temporary position, as the sudo safe.directory problem is\n> still to be added to next?\n\nyes, it should be fixed once/if that branch graduates to next, and it\nis currently broken in master and all maint branches as well as the\nlast 2 releases from those.\n\nCarlo\n"},{"id":"455298","messageId":"7515c5df-a547-c4dc-5221-0f5089f2a2c3@iee.email","threadId":"57883","inReplyTo":"CAPUEspjGiyUOhEZpe1bZ3EQqAruyT-WoC8xorxNfp=ktOw__uw@mail.gmail.com","subject":"Re: sudo: git describe during GIT_VERSION_GEN not as expected..","fromName":"Philip Oakley","fromEmail":"philipoakley@iee.email","sentAt":"2022-05-15T11:38:01Z","receivedAt":"2022-05-15T11:38:09Z","isPatch":false,"sender":{"key":"philipoakley@iee.email","avatar":"https://avatars.githubusercontent.com/u/914343?v=4"},"body":"Hi Carlo\n\nOn 15/05/2022 12:05, Carlo Arenas wrote:\n> On Sun, May 15, 2022 at 3:12 AM Philip Oakley <philipoakley@iee.email> wrote:\n>> Is this a temporary position, as the sudo safe.directory problem is\n>> still to be added to next?\n> yes, it should be fixed once/if that branch graduates to next, and it\n> is currently broken in master and all maint branches as well as the\n> last 2 releases from those.\n>\n> Carlo\nThanks for clarifying. Wasn't sure if it was finger trouble on my side.\nP.\n"},{"id":"455300","messageId":"xmqqwnem7n87.fsf@gitster.g","threadId":"57883","inReplyTo":"7bb71920-b840-5133-ceac-664c09942772@iee.email","subject":"Re: sudo: git describe during GIT_VERSION_GEN not as expected..","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2022-05-15T16:51:52Z","receivedAt":"2022-05-15T16:52:02Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Philip Oakley <philipoakley@iee.email> writes:\n\n> I have run into a problem with make/install of git on my old travel\n> laptop. While trying to make / install git with some patches on top of \n> yesterdays next (coincidental timing) I'm finding that the generated\n> git version is the default value rather than that of a regular 'get \n> describe' as used in GIT_VERSION_GEN.\n\nYup, we've been discussing on this issue since the Git 2.35.3 (and\nfriends) and Git 2.36 release.\n\n  https://lore.kernel.org/git/20220426183105.99779-1-carenas@gmail.com/\n\nI think the last round:\n\n  https://lore.kernel.org/git/20220513010020.55361-1-carenas@gmail.com/\n\nis more or less done, so perhaps we should start merging it down to\n'next' and all the way down to the older maintenance tracks like\nmaint-2.30 that are affected.\n\nThanks.\n"}]}