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

Re: repack behaves unexpectedly if called in a bare _subrepo_

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 17, 2007, 17:22 UTC
Message-ID
<7vir9mzeao.fsf@assigned-by-dhcp.pobox.com>
In-Reply-To
<20070617153810.GB2763@steel.home>
Alex Riesen <raa.lkml@gmail.com> writes:
Show 16 quoted lines
> Just a heads-up. This took me by surprise. And I suppose it will be
> the same even if the subrepo is a real subproject.
>
> To illustrate:
>
> (
>     mkdir super && cd super
>     git init
>     echo 0 > a; git add a; git commit -m0
>     echo 2 >> a; git commit -a -m1
>     echo 3 >> a; git commit -a -m2
>     cp -a .git sub
>     cd sub
>     git --bare config --bool core.bare true
>     git repack -a -d
> )

I think what is happening is that in that bare repository 'sub', the sequence we find where a git repository is is defined so that the current directory is checked way after "one of my parents with .git/ subdirectory" check.

If super (a directory) has a subproject sub as its subproject, then you would be copying .git to sub/.git, not sub/, wouldn't you? What are you trying to achieve?

Previous: Alex RiesenNext: Alex Riesen
Message 2 of 3 in “repack behaves unexpectedly if called in a bare _subrepo_”
  1. Alex RiesenJun 17, 2007
  2. Junio C HamanoJun 17, 2007
  3. Alex RiesenJun 17, 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.