From: Fredrik Gustafsson <iveqy@iveqy.com>
To: Robert Dailey <rcdailey.lists@gmail.com>
Cc: Git <git@vger.kernel.org>
Subject: Re: Unable to shrink repository size
Date: Thu, 6 Mar 2014 08:46:10 +0100 [thread overview]
Message-ID: <20140306074610.GO24892@paksenarrion.iveqy.com> (raw)
In-Reply-To: <CAHd499AW6nev81iVVhuoYfT0us28SSBDwbHCBa3teYB=cJR99g@mail.gmail.com>
On Wed, Mar 05, 2014 at 08:55:30PM -0600, Robert Dailey wrote:
> What I'd like to do is somehow hunt down the largest commit (*not*
> blob) in the entire history of the repository to hopefully find out
> where huge directories have been checked in.
>
> I can't do a search for largest file (which most google results seem
> to show to do) since the culprit is really thousands of unnecessary
> files checked into a single subdirectory somewhere in history.
>
> Can anyone offer me some advice to help me reduce the size of my repo
> further? Thanks.
I'm not sure if you can do this with git. However since git is a command
line application it's pretty easy to script it with sh. The negative
part beeing the lack of speed, but since this is a one-time thing I
don't think that it matters.
Since you told us that it is a commit with a huge number of files that
you're looking for, I took that approach instead of calculating the size
of each commit, since that would be more expensive to do.
for commit in $(git log --pretty=oneline | cut -d " " -f 1)
do
nbr=$(git show --pretty="format:" --name-only $commit | wc -l)
echo "$nbr: $commit"
done | sort | tail -1
This will give you the commit with most files changed. (Although, there
will be a +1 error on the number of files edited).
--
Med vänlig hälsning
Fredrik Gustafsson
tel: 0733-608274
e-post: iveqy@iveqy.com
next prev parent reply other threads:[~2014-03-06 7:44 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-06 2:55 Unable to shrink repository size Robert Dailey
2014-03-06 5:21 ` Elijah Newren
2014-03-06 7:46 ` Fredrik Gustafsson [this message]
2014-03-06 12:56 ` Duy Nguyen
2014-03-06 15:25 ` Jeff King
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140306074610.GO24892@paksenarrion.iveqy.com \
--to=iveqy@iveqy.com \
--cc=git@vger.kernel.org \
--cc=rcdailey.lists@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).