add(fish): largest object in repo fish function

cleaned up other fish functions
cleaned up nvim lsp-config
This commit is contained in:
Léana 江 2023-03-22 19:04:37 +01:00
parent da08b92ed7
commit 3cd7ed6f6d
5 changed files with 77 additions and 41 deletions

View file

@ -1,6 +1,5 @@
#!/opt/homebrew/bin/fish
function brew_update
echo ===== (date) =====
/opt/homebrew/bin/brew update
/opt/homebrew/bin/brew upgrade
/opt/homebrew/bin/brew autoremove

View file

@ -0,0 +1,30 @@
function largest-objects-in-repo
# Shows you the largest objects in your repo's pack file. Written for osx.
# @see http://stubbisms.wordpress.com/2009/07/10/git-script-to-show-largest-pack-objects-and-trim-your-waist-line/
# @author Antony Stubbs
# translated to fish with ChatGPT, reviewed by Léana :P
# set the internal field spereator to line break, so that we can iterate easily over the verify-pack output
set -fx IFS "\n"
# list all objects including their size, sort by size, take top 10
set objects (git verify-pack -v .git/objects/pack/pack-*.idx | grep -v chain | sort -k3nr | head)
echo "All sizes are in kB. The pack column is the size of the object, compressed, inside the pack file."
set output "size,pack,SHA,location"
for obj in $objects
# extract the size in bytes
set size (math (echo $obj | cut -f 5 -d ' ') / 1024)
# extract the compressed size in bytes
set compressedSize (math (echo $obj | cut -f 6 -d ' ') / 1024)
# extract the SHA
set sha (echo $obj | cut -f 1 -d ' ')
# find the objects location in the repository tree
set other (git rev-list --all --objects | grep $sha)
#lineBreak=`echo -e "\n"`
set output "$output\n$size,$compressedSize,$other"
end
echo -e $output | column -t -s ', '
end

View file

@ -1,5 +1,4 @@
function sync_notes
echo ===== (date) =====
rsync --recursive --verbose --chown=caddy:caddy --chmod=u=rwX,g=rX,o=rX --exclude=".DS_Store" --update --times --compress --delay-updates --delete \
/Users/leana/Documents/Rennes\ 1/L2/Prise\ de\ notes/ \
earth2077.fr:/srv/http/notes/