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

libgit2::git_describe_workdir() fails with depth-cloned + detached head

From
LLLukas Lueg <lukas.lueg@gmail.com>
Date
Feb 17, 2017, 15:39 UTC
Message-ID
<CAJF-kYmrqgTtj=TMdzAaru-XKVUyQqXLTDY6Cytc-3VQEz0LTw@mail.gmail.com>
Hi,

I have a build on Travis failing with a weird error that happens while trying to get a description from a repo. One of the integration tests that are executed on Travis executes libgit2::git_describe_workdir() on it's own repo and fails with code: -3, klass: 9, message: "object not found - no match for id (77f95f14776deb7e120a2a26f7b56abf2903bc62)".

The id 77f95f1 from the error message refers to a commit that is of no particular interest and actually weeks behind; I never asked for it.

I was finally able to reproduce the problem by very carefully following how Travis clones the repo:

git clone --depth=50 https://... repo_root cd repo_root git fetch origin +refs/pull/414/merge: git checkout -qf FETCH_HEAD

If and only if the repo is cloned recursively, the call to libgit2::git_describe_workdir() results in this error, always referring to 77f95f1. If the repo is cloned without '--depth 50', no error occurs. The repo does not even have submodules.

My local git client does the right thing and get's the latest commit oid without problems.

Any idea what's going on here?

Best regards Lukas

Message 1 of 1 in “libgit2::git_describe_workdir() fails with depth-cloned + detached head”
  1. Lukas LuegFeb 17, 2017

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.