Created
October 28, 2015 10:50
-
-
Save igrr/6e61e11f729efa733edd to your computer and use it in GitHub Desktop.
Updates to the esp8266/arduino 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 | |
set -e | |
# get a fresh copy | |
git clone arduino arduino-new | |
cd arduino-new | |
git remote remove origin | |
# untie our commmits from master IDE branch | |
echo "a12c6fcea253a987e2b83aca2d9f717d0d201472" > .git/info/grafts | |
echo "b0a05473c36a8ceb5b24079222df8dc77b5a7b8e baff76ff91b465f00dd0e5e46d1d5930a3bea0c4" >> .git/info/grafts | |
echo "95f969cb7cc9267a6fd27c5e48d2397a0ff557af bfafcf8c6a7bc2a3a29e1ac06a474050211276b0" >> .git/info/grafts | |
echo "f206d31581fc98952d561238a1cd247b515ac03e d8e22e3ca7c6e07e685f12b03a3422066724c728" >> .git/info/grafts | |
echo "e8789e9cb5a60b5b7c94561109a59918c4a33c21 37759286bb2eb25f59ada08c8e51d03f72230bfd" >> .git/info/grafts | |
echo "c540bbab007683105ce2684eefd1c6b96a092106 22ea72a2d601bb9f286875ea3c69c029e919aa8f" >> .git/info/grafts | |
echo "c7e363ca7b49a7b0784c034f486e428c59ba9440 edccc2c158e6c699c0cb97c57fa3737a67f9f351" >> .git/info/grafts | |
# remove tags | |
git tag | xargs git tag -d | |
# remove everything except things which we need | |
git filter-branch --index-filter 'git rm -q --cached --ignore-unmatch * && | |
git reset -q $GIT_COMMIT -- \ | |
hardware/arduino/esp8266 \ | |
hardware/esp8266com/esp8266 \ | |
docs \ | |
libraries/OneWire \ | |
libraries/SD' \ | |
--prune-empty | |
# move hardware/arduino/esp8266 and hardware/esp8266com/esp8266 into root dir | |
# rename docs into doc | |
git filter-branch -f --index-filter 'git ls-files -s \ | |
| gsed "s|\thardware/arduino/esp8266/\(.*\)|\t\1|" \ | |
| gsed "s|\thardware/esp8266com/esp8266/\(.*\)|\t\1|" \ | |
| gsed "s|\tdocs/\(.*\)|\tdoc/\1|" \ | |
| GIT_INDEX_FILE=$GIT_INDEX_FILE.new git update-index --index-info \ | |
&& mv "$GIT_INDEX_FILE.new" "$GIT_INDEX_FILE"' | |
# make a fresh clone which doesn't have stray objects | |
cd .. | |
git clone file://$PWD/arduino-new arduino-new-clean | |
du -hs arduino-new-clean |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment