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

Re: [PATCH 3/4] Automatically detect a bare git repository.

From
Shawn O. Pearce <spearce@spearce.org>
Date
Jan 1, 2007, 21:01 UTC
Message-ID
<20070101210103.GB26821@spearce.org>
In-Reply-To
<20061231125205.GB14286@thunk.org>
Theodore Tso <tytso@mit.edu> wrote:
Show 12 quoted lines
> On Sat, Dec 30, 2006 at 11:30:19PM -0500, Shawn O. Pearce wrote:
> > Many users find it unfriendly that they can create a bare git
> > repository easily with `git clone --bare` but are then unable to
> > run simple commands like `git log` once they cd into that newly
> > created bare repository.  This occurs because we do not check to
> > see if the current working directory is a git repository.
> 
> Thanks for coding this up!   
> 
> If you do this, does this mean that we can also eliminate the global
> variable --bare, since git will be able to figure out we're in a bare
> repository all by itself?

Probably not. `git --bare foo` is a Poreclain-ish level option which has been supported for several versions. Removing it may cause pain for users to retrain their fingers to just ignore it.

Besides `git --bare` can be used in cases where the bare Git repository is actually located within another repository's working directory and the automatic detection is picking up the other repository's metadata and not the bare repository's metadata.

So I think --bare is still here to stay for a while. The new automatic detection just offers slightly less surprise for users.

-- 
Shawn.
Previous: Theodore TsoNext: Martin Waitz
Message 7 of 17 in “Replace "GIT_DIR" with GIT_DIR_ENVIRONMENT.”
  1. 2/4 Replace "GIT_DIR" with GIT_DIR_ENVIRONMENT.Shawn O. Pearce, Dec 31, 2006
  2. 3/4 Automatically detect a bare git repository.Shawn O. Pearce, Dec 31, 2006
  3. Junio C HamanoDec 31, 2006
  4. Shawn PearceDec 31, 2006
  5. Junio C HamanoDec 31, 2006
  6. Theodore TsoDec 31, 2006
  7. Shawn O. PearceJan 1, 2007
  8. Martin WaitzDec 31, 2006
  9. Shawn O. PearceJan 1, 2007
  10. 4/4 Disallow working directory commands in a bare repository.Shawn O. Pearce, Dec 31, 2006
  11. Junio C HamanoDec 31, 2006
  12. Shawn O. PearceDec 31, 2006
  13. Junio C HamanoDec 31, 2006
  14. Theodore TsoDec 31, 2006
  15. Johannes SchindelinDec 31, 2006
  16. Junio C HamanoDec 31, 2006
  17. Johannes SchindelinJan 2, 2007

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.