Merge pull request #37976 from AutomaticFrenzy/patch/dmi-merger

Add a Python script to fix DMI conflicts
This commit is contained in:
Jordan Brown
2018-05-25 11:54:36 -04:00
committed by letterjay
parent cc088d9113
commit e37a9a36ed
8 changed files with 446 additions and 9 deletions
+5
View File
@@ -14,6 +14,10 @@ automatically by GUI tools like TortoiseGit and GitHub for Windows, but
## Current Hooks
* **Pre-commit**: Runs [mapmerge2] on changed maps, if any.
* **DMI merger**: Attempts to [fix icon conflicts] when performing a git merge.
If it succeeds, the file is marked merged. If it fails, it logs what states
are still in conflict and adds them to the .dmi file, where the desired
resolution can be chosen.
## Adding New Hooks
@@ -34,3 +38,4 @@ version of Python is found.
[merge drivers]: https://git-scm.com/docs/gitattributes#_performing_a_three_way_merge
[Git for Windows]: https://gitforwindows.org/
[mapmerge2]: ../mapmerge2/README.md
[fix icon conflicts]: ../mapmerge2/merge_driver_dmi.py
+2
View File
@@ -0,0 +1,2 @@
#!/bin/bash
exec tools/hooks/python.sh -m merge_driver_dmi "$@"
+2
View File
@@ -10,5 +10,7 @@ for %%f in (*.merge) do (
driver = tools/hooks/%%f %%P %%O %%A %%B %%L >> ..\..\.git\config
)
echo Installing Python dependencies
python -m pip install -r ..\mapmerge2\requirements.txt
echo Done
pause
+3
View File
@@ -1,4 +1,5 @@
#!/bin/bash
set -e
shopt -s nullglob
cd "$(dirname "$0")"
for f in *.hook; do
@@ -9,4 +10,6 @@ for f in *.merge; do
echo Installing merge driver: ${f%.merge}
git config --replace-all merge.${f%.merge}.driver "tools/hooks/$f %P %O %A %B %L"
done
echo Installing Python dependencies
./python.sh -m pip install -r ../mapmerge2/requirements.txt
echo "Done"