Re: [BUG] Destructive access to an "objects/info/alternates" repository

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jan 04, 2021 at 03:47:53PM -0500, Stefan Monnier wrote:
> > I agree with Stefan that this is undesired behaviour, even when it only
> > happens when attempting to clean up garbage -- git-gc (and git-count-objects)
> > should distinguish between garbage in the parent repository and its own
> > repository and not attempt any modification of the parent repository during
> > gc or any other operation.
> 
> Great, so IIUC:
> - this is a harmless warning

Well, this is a benign situation in general, since git only tries to delete
files that it determined to be garbage. Even if it succeeded in your case, it
wouldn't really modify the actual shared repository state/contents.

> - it's considered as a bug

I'm not really someone who decides if it's a bug or not. :) I *think* it's a
bug, since git modifies the repository from which it should be merely
borrowing objects (a read-only operation). Even if the results are benign,
it's not something that should be happening, in my opinion.

> - so my use case should work fine in practice and is not considered as
>   "too weird to be supported"

It's easy to replicate, if someone feels like fixing it:

mkdir repo1
cd repo1
git init
echo test > test
git add test
git commit -am test
touch .git/objects/pack/pack-abcd.idx
cd ..
git clone -s repo1 repo2
cd repo2
git gc
ls -al ../repo1/.git/objects/pack/pack-abcd.idx
/bin/ls: cannot access '../repo1/.git/objects/pack/pack-abcd.idx': No such file or directory

Hope this helps.

-K



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux