Fix documentation and add license header for reposize.sh

Change-Id: I474f9a800443fcaa76c764132c25b6aab7342999
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
This commit is contained in:
Matthias Sohn 2014-04-29 11:32:54 +02:00
parent 7833b5dab6
commit 61bc05e461

View File

@ -1,8 +1,24 @@
#!/bin/bash
# Shows you the largest objects in your repo's pack files.
#
# Copyright (C) 2014 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Show n largest objects in a git repo's pack files.
#
# usage:
# $ git-find-big-blobs 100 # find and list biggest 100 objects
# $ reposize.sh 100 # find and list biggest 100 objects
#
# derived from
# http://stubbisms.wordpress.com/2009/07/10/git-script-to-show-largest-pack-objects-and-trim-your-waist-line/
@ -38,7 +54,7 @@ IFS=$'\n';
# list all objects including their size, sort by size, take top $1 biggest blobs
objects=$(git verify-pack -v $gitdir/objects/pack/pack-*.idx | grep -v chain | sort -k3nr | head -n $1)
echo "All sizes are in kB's. The pack column is the size of the object, compressed, inside the pack file."
echo "All sizes are in kiB's. The pack column is the size of the object, compressed, inside the pack file."
output="size,pack,SHA,location"
for y in $objects