Re: [PATCH v2 15/16] config: add core.noshallow to prevent turning a repo into a shallow one
- From
Duy Nguyen <pclouds@gmail.com>
- Date
- Jul 23, 2013, 01:28 UTC
- Message-ID
- <CACsJy8Ddac5r7opAgtk-CAkc=jwmBmmOs7FU6DziysCZ=992dQ@mail.gmail.com>
- In-Reply-To
- <BF5D998BFA5241938531635E1D8B79DF@PhilipOakley>
On Tue, Jul 23, 2013 at 2:23 AM, Philip Oakley <philipoakley@iee.org> wrote:
Show 12 quoted lines
> From: "Nguyễn Thái Ngọc Duy" <pclouds@gmail.com> > Subject: [PATCH v2 15/16] config: add core.noshallow to prevent turning a > repo into a shallow one > > Surely this should be the default now that it is possible to corrupt a > golden repo by pushing/fetching a shallow repository to it and it then > becomes shallow, and all the followers become shallow as well, with > consequent problems (IIUC) [PATCH v2 05/16]. > > It would be just as easy to change the config to core.allowshallow which > then must be enabled by the user, and can be mentioned in the shallow clone > option's documentation.
Clarification, it's not really "corrupt". If you have full history from a ref "A", fetching from another shallow clone does not touch the history of ref A at all (that is if you do _not_ specify --depth). It may add a a shallow ref B, which is the reason the whole repo becomes shallow. The same goes for push. This is not implemented, but I'm thinking of adding "clean .git/shallow" to git repack -ad. Then if you delete ref B and repack -ad, the repo could become full again.
But yeah, maybe defaulting to no shallow is better. Will do so in the reroll unless someone objects. -- Duy