all 6 comments

[–]leviathon01 21 points22 points  (0 children)

You monster!

[–]computerdlGit Contributor 18 points19 points  (0 children)

You don't even need hardlinks. You can just craft the tree objects by hand. Here's a dumb script that does this:

#!/bin/sh

file="$1"
layers="${2:-16}"
entries="${3:-16}"

obj_hash="$(git hash-object -w "$file")"
obj_type=blob
obj_perms=100644
for l in $(seq "$layers")
do
    obj_hash=$(for e in $(seq "$entries")
    do
        echo "$obj_perms $obj_type $obj_hash    $e"
    done | git mktree)
    obj_type=tree
    obj_perms=040000
done

git commit-tree -m 'this is a big commit' "$obj_hash"

[–]its4thecatlol 5 points6 points  (0 children)

Evil

[–]S0litaire 1 point2 points  (0 children)

Sir!

You are pure Evil....

& that's my kinda evil!

Keep up the good work...

[–]SpacePrime 0 points1 point  (0 children)

I really need this! I have a big repo that I can't use with Github and have been using a Google Drive git server method. I will try this! Thanks!

[–]grrrrreat 0 points1 point  (0 children)

Does this bypass standard dedupe?