warn when committing large (binary) files

Bug #54624 reported by Martin Pool
6
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
Medium
Shannon Weyrick

Bug Description

From: martin f krafft

This just in on #revctrl:

  Vesta has this really simple feature where any time you try to
  commit a file over a certain limit (which defaults to 1MB), it
  complains unless you give a command-line flag that changes that
  upper limit.

I think this would be a good feature to have in bzr, and while
I would see this even in core (with a default limit that can be
overridden for each branch), I realise that it need not be, that it
would also be a worthy plugin.

I can't implement this at the moment, but I wanted to get the idea
out. Maybe someone else has the time and muse...

Tags: easy memory

Related branches

Revision history for this message
John A Meinel (jameinel) wrote :

It could be nice to at least warn, so that people don't commit their large ISO image accidentally. (Or commit their .obj, .pch, etc files)

Changed in bzr:
importance: Undecided → Wishlist
status: Unconfirmed → Confirmed
Martin Pool (mbp)
tags: added: easy memory
Changed in bzr:
importance: Wishlist → Medium
Changed in bzr:
assignee: nobody → Shannon Weyrick (weyrick)
Revision history for this message
Martin Pool (mbp) wrote : Re: [Bug 54624] Re: warn when committing large (binary) files

Hi, Shannon, thanks for your interest in this. If you want to talk
about how to do it, feel very free to ask here or on irc, and also to
put up a branch for review even before you're totally sure it's the
right fix.

Basically, you probably want a check inside the commit builder at the
time it's storing an individual file and to raise a warning through
the ui_factory. Secondary issues:

 * should be configurable as far as size or turning it off altogether?
 * one warning per file?
 * need to test it, probably by turning the configured size down very
low so that we don't actually need to commit a huge file.

hth, don't hesitate to ask.

Martin

Revision history for this message
Shannon Weyrick (weyrick) wrote :

Thanks Martin. I'm just starting to orient to the codebase, so certainly all pointers are appreciated.

If it's done in the commit builder, does this mean the "add" operation would succeed silently, and it would only warn during commit? From a user perspective, I think I'd want the warning at add time.

I'm also wondering exactly what action it takes when it finds the large file(s). Should it refuse to add it, and require a command line option to force (as in the original description above)? Or should it merely warn that you've added it? And is this only checked for binary files?

I think having a configurable size threshold makes sense, and perhaps setting it to 0 can turn it off.

Agreed on the test plan.

Shannon

Revision history for this message
Shannon Weyrick (weyrick) wrote :

I've pushed a first cut of this. Comments welcome.

Revision history for this message
Jelmer Vernooij (jelmer) wrote :

bOn Fri, 2011-08-05 at 21:02 +0000, Shannon Weyrick wrote:
> I've pushed a first cut of this. Comments welcome.

> ** Branch linked: lp:~weyrick/bzr/54624-warn-on-large-files
Can you perhaps create a merge proposal for this branch against lp:bzr?

Cheers,

Jelmer

Revision history for this message
Shannon Weyrick (weyrick) wrote :

Yes, proposed. Thanks.
Shannon

Changed in bzr:
status: Confirmed → Fix Committed
Revision history for this message
Jelmer Vernooij (jelmer) wrote :

  status fixreleased

We use fixreleased for branches that have landed in bzr.

Thanks for your work on this!

Changed in bzr:
status: Fix Committed → Fix Released
Martin Packman (gz)
Changed in bzr:
milestone: none → 2.5b1
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.