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

Re: [BUG] git-new-workdir doesn't understand packed refs

From
Julian Phillips <julian@quantumfyre.co.uk>
Date
Apr 18, 2007, 07:26 UTC
Message-ID
<Pine.LNX.4.64.0704180822270.4684@beast.quantumfyre.co.uk>
In-Reply-To
<20070418055215.GA32634@xp.machine.xx>
On Wed, 18 Apr 2007, Peter Baumann wrote:
Show 34 quoted lines
> On Tue, Apr 17, 2007 at 10:55:17PM +0100, Julian Phillips wrote:
>>  On Tue, 17 Apr 2007, Peter Baumann wrote:
>>
>>> running git-gc or git-gc --prune isn't save because e.g. all the tags
>>> are packed and .git/packed-refs isn't shared on the several workdirs.
>>
>>  Do you mean that the link wasn't created?  Or that the link was removed and
>>  replaced with a file when you ran gc from a workdir?
>>
>
> The problem is, when I created the new workdir, I don't have a file
> .git/packed-refs, so a new workdir was created with a dangling symlink,
> e.g.  workdir/.git/packed-refs -> repo/.git/packed-refs (but the last one
> doesn't exist). As it seems, git gc removes the dangling symlink and
> replaces it with a file.
>
> Steps to reproduce (written in this mail; after /usr/bin/script gave me an
> output whith color coded text *GRR* in ASCII squences):
>
> 	mkdir a && cd a && git init
> 	echo 1 > file.txt
> 	git add file.txt
> 	git commit -m "file added"
> 	git tag v0
> 	cd ..
>
> 	git-new-workdir a b
> 	cd b && git-gc
>
>
> Oh. Wait. Just forget that theorie about dangling symlink. git-gc replaces
> the symlink in a new workdir with a file. Just confirmed that.
>
> So it isn't save to run git-gc in a workdir.

True. I don't think that it would be a good idea to run any purely repository type commands in a workdir.

-- 
Julian

  ---
You know you're using the computer too much when:
you call a doctor a "virus scanner"
 	-- Lews_Therin
Previous: Peter BaumannNext: Junio C Hamano
Message 4 of 22 in “[BUG] git-new-workdir doesn't understand packed refs”
  1. Peter BaumannApr 17, 2007
  2. Julian PhillipsApr 17, 2007
  3. Peter BaumannApr 18, 2007
  4. Julian PhillipsApr 18, 2007
  5. Junio C HamanoApr 18, 2007
  6. Peter BaumannApr 18, 2007
  7. Julian PhillipsApr 18, 2007
  8. Junio C HamanoApr 18, 2007
  9. Peter BaumannApr 18, 2007
  10. Junio C HamanoApr 18, 2007
  11. Peter BaumannApr 18, 2007
  12. Junio C HamanoApr 18, 2007
  13. Peter BaumannApr 18, 2007
  14. Junio C HamanoApr 18, 2007
  15. Add test for symlinked .git/packed-refsPeter Baumann, Apr 19, 2007
  16. Junio C HamanoApr 19, 2007
  17. pack-refs: dereference .git/packed-refs if it is a symlinkPeter Baumann, Apr 20, 2007
  18. Junio C HamanoApr 21, 2007
  19. Julian PhillipsApr 18, 2007
  20. pack-refs: dereference .git/packed-refs if it is a symlinkPeter Baumann, Apr 18, 2007
  21. Linus TorvaldsApr 18, 2007
  22. Peter BaumannApr 18, 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.