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

Re: [bug] git-add won't add foo/.git/bar

From
Julian Phillips <julian@quantumfyre.co.uk>
Date
Mar 25, 2008, 01:42 UTC
Message-ID
<Pine.LNX.4.64.0803250050320.30488@kaos.quantumfyre.co.uk>
In-Reply-To
<fs9i36$qck$1@ger.gmane.org>
On Tue, 25 Mar 2008, Michael Gebetsroither wrote:
Show 12 quoted lines
> * Junio C Hamano <gitster@pobox.com> wrote:
>> Julian Phillips <julian@quantumfyre.co.uk> writes:
>>> On Tue, 25 Mar 2008, Michael Gebetsroither wrote:
>
>>>> % git-add -f foo/.git/bar
>>>> fatal: unable to add foo/.git/bar to index
>
>> Also it is false that we should only care about the first one.  Think
>> submodules.
>
> Would it be possible to allow it with git-add -f or does that break to
> many cases?

It would be possible, but Junio has convinced me that it wouldn't really be wise. Inside the working tree .git is a special name - end of story.

It would be relatively easy to change the check that prevents you from doing it - but this wouldn't stop any of the nasty things that could ensue. You might never have a problem with a simple layout, but it could cause mayhem for others with more complicated layouts.

(I've never used any of the more complicated layouts either, which is why I didn't initially see the problems ... ho hum)

-- 
Julian

  ---
Hlade's Law:
 	If you have a difficult task, give it to a lazy person --
 	they will find an easier way to do it.
Previous: Michael GebetsroitherNext: Michael Gebetsroither
Message 9 of 10 in “[bug] git-add won't add foo/.git/bar”
  1. Michael GebetsroitherMar 24, 2008
  2. Julian PhillipsMar 25, 2008
  3. Junio C HamanoMar 25, 2008
  4. Julian PhillipsMar 25, 2008
  5. Junio C HamanoMar 25, 2008
  6. Julian PhillipsMar 25, 2008
  7. Documentation/git.txt: Mention unsupported use of --git-dir/GIT_DIRJulian Phillips, Mar 25, 2008
  8. Michael GebetsroitherMar 25, 2008
  9. Julian PhillipsMar 25, 2008
  10. Michael GebetsroitherMar 26, 2008

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.