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

git describe oddity with GIT_DIR

From
Thomas Braun <thomas.braun@virtuell-zuhause.de>
Date
Oct 16, 2014, 13:34 UTC
Message-ID
<543FC965.7040600@virtuell-zuhause.de>
Hi,

I've encountered an oddity with git describe. Consider the following snippet: ----- mkdir test cd test git init echo 1 > file git add file git commit -m "changes" $ git describe --always --dirty 8ad486e $ cd .. $ git --git-dir=test/.git describe --always --dirty 8ad486e-dirty $ GIT_DIR=test/.git git describe --always --dirty 8ad486e-dirty -----

The "-dirty" suffix appears if invoking git not from the worktree itself, but should actually never appear.

According to my research this behaviour is there since 9f67d2e8 (Teach "git describe" --dirty option, 2009-10-27).

Is that to expected?

Thanks Thomas

Next: Junio C Hamano
Message 1 of 3 in “git describe oddity with GIT_DIR”
  1. Thomas BraunOct 16, 2014
  2. Junio C HamanoOct 16, 2014
  3. Thomas BraunOct 16, 2014

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.