summaryrefslogtreecommitdiff
path: root/test-retroactive.sh
diff options
context:
space:
mode:
authorJed Brown <jed@59A2.org>2013-02-14 19:17:49 -0600
committerJed Brown <jed@59A2.org>2013-02-14 19:21:26 -0600
commitb8524eb4574ac8f0d340ed4e9c4607634c4758af (patch)
tree5639331520f6ca77f5733ff7d1e3901b90c40604 /test-retroactive.sh
parent63afe8a8cb64d3eeb5ef2b35cf660436518ec41c (diff)
downloadgit-fat-b8524eb4574ac8f0d340ed4e9c4607634c4758af.tar.gz
Add 'git fat index-filter .. --manage-gitattributes'
This writes a .gitattributes file for every commit in the history, appending rules for all the now-managed fat files.
Diffstat (limited to 'test-retroactive.sh')
-rwxr-xr-xtest-retroactive.sh34
1 files changed, 34 insertions, 0 deletions
diff --git a/test-retroactive.sh b/test-retroactive.sh
new file mode 100755
index 0000000..b5c2ffe
--- /dev/null
+++ b/test-retroactive.sh
@@ -0,0 +1,34 @@
+#!/bin/sh -ex
+
+git init retro
+cd retro
+cp /usr/share/dict/words words.big
+git add words.big
+git commit -m'Add big file without using git-fat'
+sort words.big > sorted.big
+git add sorted.big
+git commit -m'Add sorted file without using git-fat'
+cat > .gitattributes <<EOF
+original-attributes -text
+EOF
+git add .gitattributes
+echo 'truncated' > words.big
+git commit -am'Truncated words.big and add .gitattributes'
+git fat init
+cat > .gitattributes <<EOF
+*.big filter=fat -text
+EOF
+git add .gitattributes
+git checkout .
+git commit -am'Import big files into git-fat'
+
+git log --stat
+
+git fat find 10000 | awk '{print $1}' > fat-files
+git filter-branch --index-filter "git fat index-filter $(realpath fat-files) --manage-gitattributes" --tag-name-filter cat -- --all
+
+git log --stat
+git checkout HEAD^
+rm *
+git checkout .
+ls -al