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

Re: git reset --hard in .git causes a checkout in that directory

From
Jeff King <peff@peff.net>
Date
Dec 6, 2009, 04:15 UTC
Message-ID
<20091206041517.GA23983@coredump.intra.peff.net>
In-Reply-To
<7vfx7pwa6p.fsf@alter.siamese.dyndns.org>
On Sat, Dec 05, 2009 at 10:24:46AM -0800, Junio C Hamano wrote:
Show 7 quoted lines
> > ...  The test already checks that the change won't break soft reset,
> > which is good, but it does not seem to check/specify what should happen in
> > the mixed reset in this case (I think it should be allowed).
> 
> Heh, I was not thinking straight. A bare repository does not have the
> index, so allowing (cd .git && git reset) is Ok but mixed in a bare
> repository (cd bare.git && git reset) is not.

Hmm. I would have thought it would be allowed in a bare repository, to explicitly let people treat the bare repo as a pseudo-database, just pulling out the files when they want to. And I was all set to argue against restricting it, but looking at your tests, it seems we already disallow it. So I don't see a harm in verifying the current behavior.

-Peff
Previous: Junio C HamanoNext: Junio C Hamano
Message 5 of 8 in “git reset --hard in .git causes a checkout in that directory”
  1. Maarten LankhorstDec 3, 2009
  2. Jeff KingDec 4, 2009
  3. Junio C HamanoDec 4, 2009
  4. Junio C HamanoDec 5, 2009
  5. Jeff KingDec 6, 2009
  6. Junio C HamanoDec 5, 2009
  7. Jeff KingDec 6, 2009
  8. Junio C HamanoDec 6, 2009

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.