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

[BUG] bare repository detection does not work with aliases

From
Mark Lodato <lodatom@gmail.com>
Date
Mar 7, 2013, 22:47 UTC
Message-ID
<CAHREChhuX82ibNEDQnQUeS9TEeyMFGpuNhyXzt1Pn-Tt2BVOQA@mail.gmail.com>

It seems that the fallback bare repository detection in the absence of core.bare fails for aliases.

$ git init --bare foo $ cd foo $ git config alias.s 'status -sb' $ git s fatal: This operation must be run in a work tree $ sed -i -e '/bare =/d' config $ git s ## Initial commit on master ?? HEAD ?? config ?? description ?? hooks ?? info/ $ git status -sb fatal: This operation must be run in a work tree

The reason I am using the fallback is to use a single bare repository with multiple working directories (via git-new-workdir) as suggested in 8fa0ee3b [1].

[1] https://github.com/git/git/commit/8fa0ee3b50736eb869a3e13375bb041c1bf5aa12
Next: Jeff King
Message 1 of 16 in “[BUG] bare repository detection does not work with aliases”
  1. Mark LodatoMar 7, 2013
  2. Jeff KingMar 8, 2013
  3. Junio C HamanoMar 8, 2013
  4. Jeff KingMar 8, 2013
  5. setup: suppress implicit "." work-tree for bare reposJeff King, Mar 8, 2013
  6. Johannes SixtMar 8, 2013
  7. Jeff KingMar 8, 2013
  8. Junio C HamanoMar 8, 2013
  9. Jeff KingMar 8, 2013
  10. [PATCHv2] setup and GIT_IMPLICIT_WORK_TREEJeff King, Mar 8, 2013
  11. 1/3 cache.h: drop LOCAL_REPO_ENV_SIZEJeff King, Mar 8, 2013
  12. 2/3 environment: add GIT_PREFIX to local_repo_envJeff King, Mar 8, 2013
  13. Eric SunshineMar 8, 2013
  14. Jeff KingMar 8, 2013
  15. Junio C HamanoMar 8, 2013
  16. 3/3 setup: suppress implicit "." work-tree for bare reposJeff King, Mar 8, 2013

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.