Merge pull request #37976 from AutomaticFrenzy/patch/dmi-merger
Add a Python script to fix DMI conflicts
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
#!/bin/bash
|
||||
exec tools/hooks/python.sh -m merge_driver_dmi "$@"
|
||||
@@ -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
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user