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

sudo: git describe during GIT_VERSION_GEN not as expected..

From
Philip Oakley <philipoakley@iee.email>
Date
May 15, 2022, 10:12 UTC
Message-ID
<7bb71920-b840-5133-ceac-664c09942772@iee.email>
Hi,

I have run into a problem with make/install of git on my old travel laptop. While trying to make / install git with some patches on top of yesterdays next (coincidental timing) I'm finding that the generated git version is the default value rather than that of a regular 'get describe' as used in GIT_VERSION_GEN.

Commit tree state: ~/repos/git (die_preserve_2)$ git log -4 --oneline --decorate dd96dd88c3 (HEAD -> die_preserve_2) rebase: note `preserve` merges may be a pull config option 53d93c1c94 rebase: help users when dying with `preserve-merges` 65721c069b rebase.c: state preserve-merges has been removed 7e84679e2a (junio/next, gitster/next, gitgitgadget/next, git/next) Merge branch 'cb/ci-make-p4-optional' into next

After a make/install of the above I'm getting a version string is the default, rather than referencing the current hash as below. I've already tried setting the safe.directory as advised. The second describe invocation is from GIT_VERSION_GEN. Note how it fails to provide the expected output.

~/repos/git (die_preserve_2)$ git version git version 2.36.GIT ~/repos/git (die_preserve_2)$ git describe --match "v[0-9]*" HEAD v2.36.1-165-gdd96dd88c3 ~/repos/git (die_preserve_2)$ sudo git describe --match "v[0-9]*" HEAD fatal: unsafe repository ('/home/philip/repos/git' is owned by someone else) To add an exception for this directory, call:

     git config --global --add safe.directory /home/philip/repos/git
~/repos/git (die_preserve_2)$ git config --global --get safe.directory

Is this a temporary position, as the sudo safe.directory problem is still to be added to next? Or is it a secondary side effect of the install method as per [1,2]?

Philip

[1] https://www.digitalocean.com/community/tutorials/how-to-install-git-from-source-on-ubuntu-20-04-quickstart

     see `sudo make prefix=/usr/local install`
[2] 
https://www.digitalocean.com/community/tutorials/how-to-install-git-on-ubuntu-20-04
Next: Philip Oakley
Message 1 of 5 in “sudo: git describe during GIT_VERSION_GEN not as expected..”
  1. Philip OakleyMay 15, 2022
  2. Philip OakleyMay 15, 2022
  3. Carlo ArenasMay 15, 2022
  4. Philip OakleyMay 15, 2022
  5. Junio C HamanoMay 15, 2022

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.