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

To push into a non-bare repository, or not to push into it...

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Nov 29, 2007, 01:33 UTC
Message-ID
<Pine.LNX.4.64.0711290122440.27959@racer.site>
Hi,

how about resolving this recurring subject of discussion by introducing a config variable, say "branch.allowPushingIntoHEAD". We'd teach git-init to set it to "false", and receive-pack would refuse to update HEAD if it is "false", _unless_ core.bare = true.

Of course, we would default the value to "false" to leave existing setups functional.

However, if it is "true" (and core.bare is not true) -- which would need user interaction to explicitely set it -- receive-pack would also make sure that the working tree is clean (locking the index for the complete operation), and call "read-tree -u -m HEAD" in the end.

By refusing the update we would be able to give users a severe *WARNING*, but a hint how to put their HEAD in the noose.

I'd do a patch, but I am 1) tired, and 2) more thinking about that git-repack enhancement for repo.or.cz.

Ciao, Dscho

Next: Junio C Hamano
Message 1 of 2 in “To push into a non-bare repository, or not to push into it...”
  1. Johannes SchindelinNov 29, 2007
  2. Junio C HamanoDec 1, 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.