Re: [PATCH 2/2] introduce "preciousObjects" repository extension

2015-06-25 Thread Jeff King
On Wed, Jun 24, 2015 at 10:15:08AM -0700, Junio C Hamano wrote: > > I agree that would be better. I originally just blocked all use of > > git-repack, but at the last minute softened it to just "repack -d". I'm > > not sure if that would actually help anyone in practice. Sure, doing > > "git repac

Re: [PATCH 2/2] introduce "preciousObjects" repository extension

2015-06-24 Thread Junio C Hamano
Jeff King writes: >> > + if (delete_redundant && repository_format_precious_objects) >> > + die("cannot repack in a precious-objects repo"); >> >> This message initially threw me off during my cursory reading, but >> the code tells me that this is only about "repack -d". >> >> Unfortu

Re: [PATCH 2/2] introduce "preciousObjects" repository extension

2015-06-24 Thread Duy Nguyen
On Wed, Jun 24, 2015 at 3:12 PM, Jeff King wrote: > On Tue, Jun 23, 2015 at 06:54:11AM -0400, Jeff King wrote: > >> diff --git a/builtin/prune.c b/builtin/prune.c >> index 0c73246..fc0c8e8 100644 >> --- a/builtin/prune.c >> +++ b/builtin/prune.c >> @@ -218,6 +218,9 @@ int cmd_prune(int argc, const

Re: [PATCH 2/2] introduce "preciousObjects" repository extension

2015-06-24 Thread Jeff King
On Tue, Jun 23, 2015 at 06:54:11AM -0400, Jeff King wrote: > diff --git a/builtin/prune.c b/builtin/prune.c > index 0c73246..fc0c8e8 100644 > --- a/builtin/prune.c > +++ b/builtin/prune.c > @@ -218,6 +218,9 @@ int cmd_prune(int argc, const char **argv, const char > *prefix) > return

Re: [PATCH 2/2] introduce "preciousObjects" repository extension

2015-06-24 Thread Jeff King
On Tue, Jun 23, 2015 at 05:31:14PM -0400, David Turner wrote: > On Tue, 2015-06-23 at 06:54 -0400, Jeff King wrote: > > + mkconfig 1 preciousObjects >.git/config && > > nit: I think it's better to use git config rather than manually writing > config files. git config is more future-proof if we

Re: [PATCH 2/2] introduce "preciousObjects" repository extension

2015-06-24 Thread Jeff King
On Tue, Jun 23, 2015 at 02:05:28PM -0700, Junio C Hamano wrote: > Jeff King writes: > > > This extension does not change git's behavior at all. It is useful only > > for testing format-1 compatibility. > > + > > +`preciousObjects` > > +~ > > + > > +When the config key `extensio

Re: [PATCH 2/2] introduce "preciousObjects" repository extension

2015-06-23 Thread David Turner
On Tue, 2015-06-23 at 06:54 -0400, Jeff King wrote: > + mkconfig 1 preciousObjects >.git/config && nit: I think it's better to use git config rather than manually writing config files. git config is more future-proof if we up switching config backends; it's also more composable with other con

Re: [PATCH 2/2] introduce "preciousObjects" repository extension

2015-06-23 Thread Junio C Hamano
Jeff King writes: > This extension does not change git's behavior at all. It is useful only > for testing format-1 compatibility. > + > +`preciousObjects` > +~ > + > +When the config key `extensions.preciousObjects` is set to `true`, > +objects in the repository MUST NOT be dele

Re: [PATCH 2/2] introduce "preciousObjects" repository extension

2015-06-23 Thread Jeff King
On Tue, Jun 23, 2015 at 06:14:22PM +0700, Duy Nguyen wrote: > > + if (delete_redundant && repository_format_precious_objects) > > + die("cannot repack in a precious-objects repo"); > > + > > if (pack_kept_objects < 0) > > pack_kept_objects = write_bitmap

Re: [PATCH 2/2] introduce "preciousObjects" repository extension

2015-06-23 Thread Duy Nguyen
On Tue, Jun 23, 2015 at 5:54 PM, Jeff King wrote: > diff --git a/builtin/prune.c b/builtin/prune.c > index 0c73246..fc0c8e8 100644 > --- a/builtin/prune.c > +++ b/builtin/prune.c > @@ -218,6 +218,9 @@ int cmd_prune(int argc, const char **argv, const char > *prefix) > return 0; >

[PATCH 2/2] introduce "preciousObjects" repository extension

2015-06-23 Thread Jeff King
If this extension is used in a repository, then no operations should run which may drop objects from the object storage. This can be useful if you are sharing that storage with other repositories whose refs you cannot see. For instance, if you do: $ git clone -s parent child $ git -C parent c