diff --git a/.gitattributes b/.gitattributes index 48f68e2e32..8560ac29f7 100644 --- a/.gitattributes +++ b/.gitattributes @@ -2,5 +2,9 @@ # needs additional setup, see tools/mapmerge/install.txt *.dmm merge=merge-dmm +# dmi icon merger hook +# needs additional setup, see tools/dmitool/merging.txt +*.dmi merge=merge-dmi + # force changelog merging to use union html/changelog.html merge=union diff --git a/tools/dmitool/dmimerge.sh b/tools/dmitool/dmimerge.sh new file mode 100644 index 0000000000..dbe846fc6a --- /dev/null +++ b/tools/dmitool/dmimerge.sh @@ -0,0 +1,8 @@ +java -jar tools/dmitool/dmitool.jar merge $1 $2 $3 $2 +if [ "$?" -gt 0 ] +then + echo "Unable to automatically resolve all icon_state conflicts, please merge manually." + exit 1 +fi + +exit 0 diff --git a/tools/dmitool/merging.txt b/tools/dmitool/merging.txt new file mode 100644 index 0000000000..a9e7776d9b --- /dev/null +++ b/tools/dmitool/merging.txt @@ -0,0 +1,12 @@ +1. Install java(http://www.java.com/en/download/index.jsp) +2. Make sure java is in your PATH. To test this, open git bash, and type "java". If it says unknown command, you need to add JAVA/bin to your PATH variable (A guide for this can be found at https://www.java.com/en/download/help/path.xml ). + +Merging +The easiest way to do merging is to install the merge driver. For this, open `Baystation12/.git/config` in a text editor, and paste the following lines to the end of it: + +[merge "merge-dmi"] + name = iconfile merge driver + driver = ./tools/dmitool/dmimerge.sh %O %A %B + +After this, merging DMI files should happen automagically unless there are conflicts (an icon_state that both you and someone else changed). +If there are conflicts, you will unfortunately still be stuck with opening both versions in the editor, and manually resolving the issues with those states. \ No newline at end of file