Last active
February 13, 2019 02:33
-
-
Save yetti/fdff27f15e602a902aeb9c1a2de4621e to your computer and use it in GitHub Desktop.
Sync SVN revision to Git commit notes after BFG clean on SubGit repository.
This file contains 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
#!/bin/bash | |
path=$1 | |
if [[ -n "$path" ]]; then | |
git fetch origin refs/svn/map:refs/notes/commits | |
cat $path | git notes copy --stdin | |
cat $path | cut -d' ' -f 1 | git notes remove --stdin | |
git notes prune | |
git update-ref refs/notes/commits $(git commit-tree refs/notes/commits^{tree} -m "notes squashed") | |
git fetch | |
git push origin +refs/notes/*:refs/notes/* | |
# git log --pretty=format:"%H %N" --show-notes * >> notes.log | |
# echo "commits with notes logged to notes.log" | |
else | |
echo "missing path to object-id-map.old-new.txt" | |
fi |
This file contains 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
Clean up unwanted stuff: | |
$ rm -rf refs/original | |
$ git fsck | |
$ git reflog expire --expire=now --all && git gc --prune=now --aggressive | |
$ git repack -a |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment