2GB limit

Maritza Mendez martitzam at gmail.com
Fri Oct 8 16:46:25 BST 2010


On Thu, Oct 7, 2010 at 11:28 PM, Martin Pool <mbp at canonical.com> wrote:

> On 8 October 2010 17:19, Maritza Mendez <martitzam at gmail.com> wrote:
> >
> >
> > On Thu, Oct 7, 2010 at 4:37 PM, Martin Pool <mbp at canonical.com> wrote:
> >>
> >> I think you could use a precommit hook to check this, and there is a
> >> bug asking for a builtin feature to warn about committing large files.
> >>  I think that would be quite useful, even if we had no size limits at
> >> all.
> >>
> >
> > Thanks for the push.  I have a shell of a very simple plugin started
> which
> > adds 'bzr commit-limit [SIZE]' to get/set the maximum comittable filesize
> in
> > megabytes and extends the builtin 'commit' with a pre-commit hook to
> > actually enforce the limit.  I'd like to set SIZE separately for each
> > branch.  I see various examples of caching per-branch conf data.  Would
> > someone kindly point me to an existing canonical (no pun!) example of how
> > per-branch persistent data should be saved and retrieved?
>
> I would suggest that, rather than adding a command to set this, you
> just put it in the config.  Then when vila's upcoming set/get config
> commands land, they'll be able to manipulate this.  I would take a
> setting like 'commit_file_size_limit' from the BranchConfig, which the
> commit code should be able to obtain from the branch object.  I think
> it would be reasonable to add a builtin default: I'm not sure what
> size would be so large that you probably don't want to add it without
> thinking: perhaps 10MB or 100MB?
>
> --
> Martin
>

Thanks!  I was not aware of the config work.  That sounds like the way to
go.  Now my poor little plugin will be even poorer, and I see that as a
*good* thing.  I really was not looking forward to writing all the exception
handling and data validation I would expect in code which touches config
data.  I've been playing with a 1MB default only for testing.  I think 10 MB
is probably a reasonable number for a lot of people, but everyone has to
choose.

And although my "commit-limit" plugin is currently lame with only one kind
of limit (size), the idea is to extend it to limit based on other
attributes, like datatype (either by extension or by inference based on the
first 1KB), mtime, et cetera..  The config work should make this very easy!


~M
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://lists.ubuntu.com/archives/bazaar/attachments/20101008/beed02b3/attachment.htm 


More information about the bazaar mailing list