Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>This is an adaptation of <a href="https://stackoverflow.com/questions/223678/git-which-commit-has-this-blob#223890">the <code>git-find-blob</code> script I posted previously</a>:</p> <pre class="lang-perl prettyprint-override"><code>#!/usr/bin/perl use 5.008; use strict; use Memoize; sub usage { die "usage: git-large-blob &lt;size[b|k|m]&gt; [&lt;git-log arguments ...&gt;]\n" } @ARGV or usage(); my ( $max_size, $unit ) = ( shift =~ /^(\d+)([bkm]?)\z/ ) ? ( $1, $2 ) : usage(); my $exp = 10 * ( $unit eq 'b' ? 0 : $unit eq 'k' ? 1 : 2 ); my $cutoff = $max_size * 2**$exp; sub walk_tree { my ( $tree, @path ) = @_; my @subtree; my @r; { open my $ls_tree, '-|', git =&gt; 'ls-tree' =&gt; -l =&gt; $tree or die "Couldn't open pipe to git-ls-tree: $!\n"; while ( &lt;$ls_tree&gt; ) { my ( $type, $sha1, $size, $name ) = /\A[0-7]{6} (\S+) (\S+) +(\S+)\t(.*)/; if ( $type eq 'tree' ) { push @subtree, [ $sha1, $name ]; } elsif ( $type eq 'blob' and $size &gt;= $cutoff ) { push @r, [ $size, @path, $name ]; } } } push @r, walk_tree( $_-&gt;[0], @path, $_-&gt;[1] ) for @subtree; return @r; } memoize 'walk_tree'; open my $log, '-|', git =&gt; log =&gt; @ARGV, '--pretty=format:%T %h %cr' or die "Couldn't open pipe to git-log: $!\n"; my %seen; while ( &lt;$log&gt; ) { chomp; my ( $tree, $commit, $age ) = split " ", $_, 3; my $is_header_printed; for ( walk_tree( $tree ) ) { my ( $size, @path ) = @$_; my $path = join '/', @path; next if $seen{ $path }++; print "$commit $age\n" if not $is_header_printed++; print "\t$size\t$path\n"; } } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload