You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@brooklyn.apache.org by he...@apache.org on 2016/02/01 19:01:18 UTC

[20/50] [abbrv] brooklyn-client git commit: rename big-to-small as git-biggest-files, also add git-follow-file.sh for convenience

http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/ba85cc55/git-biggest-files.sh
----------------------------------------------------------------------
diff --git a/git-biggest-files.sh b/git-biggest-files.sh
new file mode 100755
index 0000000..5ffaab5
--- /dev/null
+++ b/git-biggest-files.sh
@@ -0,0 +1,17 @@
+
+# lists files in history in size order, to stdout
+# capped at 200 of the biggest blobs by default; or provide the max as the parameter, e.g. git-biggest-files.sh 10
+
+SIZE=200
+
+if [ ! -z "$1" ] ; then SIZE=$1 ; fi
+
+# however this does not show the former names of the blobs so if the same file is in 
+# multiple times this script will show only one instance; apply `git-follow-file` to do that
+
+git rev-list --objects --all | sort -k 2 > /tmp/TMP-big-shas.txt
+git gc 2> /tmp/TMP-big-log.txt && git verify-pack -v .git/objects/pack/pack-*.idx | egrep "^\w+ blob\W+[0-9]+ [0-9]+ [0-9]+$" | sort -k 3 -n -r | head -${SIZE} > /tmp/TMP-big-objects.txt
+for SHA in `cut -f 1 -d\  < /tmp/TMP-big-objects.txt`; do echo $(grep $SHA /tmp/TMP-big-objects.txt) $(grep $SHA /tmp/TMP-big-shas.txt) | awk '{print $1,$3,$7}' ; done;
+
+rm /tmp/TMP-big-* 
+

http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/ba85cc55/git-follow-file.sh
----------------------------------------------------------------------
diff --git a/git-follow-file.sh b/git-follow-file.sh
new file mode 100755
index 0000000..4fe45f9
--- /dev/null
+++ b/git-follow-file.sh
@@ -0,0 +1 @@
+git log --format='%H' --name-status --follow -- $1 | awk '{if ($3) print $3; if ($2) print $2;}' | uniq