Created
October 27, 2016 20:50
-
-
Save motivic/c1ee9e568d9f9f5523214b72296bf789 to your computer and use it in GitHub Desktop.
Print out uncompressed contents of `.git/objects`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| base_dir=".git/objects" | |
| blue=$(tput setaf 4) | |
| normal=$(tput sgr0) | |
| for d in $(ls -R $base_dir); do | |
| if [[ -d "$base_dir/$d" ]]; then | |
| for f in $(ls -R $base_dir/$d); do | |
| file="$base_dir/$d/$f" | |
| if [[ -f $file ]]; then | |
| printf "%40s" "${blue}$file${normal}" | |
| perl -MCompress::Zlib -e 'undef $/; print "\n"; print uncompress(<>)' $file | |
| printf "\n\n"; | |
| fi | |
| done | |
| fi | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment