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

Re: [RFC/PATCH 4/4] Disallow working directory commands in a bare repository.

From
Junio C Hamano <junkio@cox.net>
Date
Dec 31, 2006, 08:01 UTC
Message-ID
<7vk608fq9u.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<20061231061122.GB6106@spearce.org>
"Shawn O. Pearce" <spearce@spearce.org> writes:
Show 14 quoted lines
> Agreed.  But as you point out...
>  
>> If we could outlaw $GIT_DIR/index in a bare repository, then
>> ...
>> Alas, many public repositories you would see (e.g. check
>> kernel.org) have been primed with rsync of .git/ from
>> developer's working repository and have leftover index that is
>> otherwise unused.  Because of this heavy historical baggage, I
>> suspect that it is rather hard to convince people to allow us to
>> use this technique.
>
> I almost coded the require_not_bare() to look for $GIT_DIR/index
> but didn't for the reasons you point out above.  It is too bad that
> we didn't enforce the existance of the index file better in the past.
This, and this,...
Show 12 quoted lines
>> ...
>> If we outlawed working-tree commands when $GIT_DIR environment
>> exists, how much hurt are we talking about, I wonder.
>
> I wouldn't be hurt, but I don't call Porcelain-ish unless I'm
> entering commands directly on the command line, and I never set
> GIT_DIR except in scripts, and even then its very rare and is more
> to point at a bare repository than one with a working directory.
> I suspect that probably isn't true for everyone.
> ...
> Why not just tell these users to setup the working directories with
> local .git directories and not use GIT_DIR?

suggest that we might want to bite the bullet and declare that these things are not supported anymore in v1.5.0.

So far, especially after fixing the i18n issue in response to qgit problem report, I do not think we have any serious backward incompatibility that the users cannot opt out of that we need to mention in v1.5.0 announcement. Even not the incompatibilities the 'old news' section talks about are.

I think an index file in a bare repository is not what the user wanted to have because it was useful, but is left there because it does not hurt. So in that sense, I do not think we need to ask users' permission to do this change, as long as we make sure we give them enough advance warning.

I do not offhand think of a valid workflow that relies on setting GIT_DIR in the environment and being able to run working-tree commands, that cannot be worked around if we declar that GIT_DIR is for our internal use (and no, naming the directory other people call .git to .svn does not count as a valid workflow), but I think this may be a bit more serious change than the index file one.

Comments?
Previous: Shawn O. PearceNext: Theodore Tso
Message 13 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.