Next: , Up: Troubleshooting   [Contents][Index]


7.1 GIT conflicts

GIT conflict may happen if 2 PUBLISHER (see Who)s are editing the same meta-data.

We initialise 2 mediatex servers on the same host (we need 2 different ports):

# mediatex -c serv1 adm init
# mediatex -c serv2 adm init
# sed --follow-symlinks -i /etc/mediatex/serv1.conf -e "s/6561/6001/"
# sed --follow-symlinks -i /etc/mediatex/serv2.conf -e "s/6561/6002/"
# /etc/init.d/mediatexd-serv1 restart
# /etc/init.d/mediatexd-serv2 restart

We initialise a collection shared by the 2 servers:

# mediatex -c serv1 adm add coll hello
# mediatex -c serv2 adm add coll serv1-hello@localhost
# mediatex -c serv1 add key ~serv2-hello/.ssh/id_rsa.pub to coll hello
# mediatex -c serv2 adm add coll serv1-hello@localhost

Now we edit the same stanza:

# vi ~serv1-hello/git/catalog000.txt
<<<
  "another thing?" = "no"
---
  "another thing?" = "yes"
>>>

# vi ~serv2-hello/git/catalog000.txt
<<<
  "another thing?" = "no"
---
  "another thing?" = "maybe"
>>>

A conflict will occurs when second server upgrade:

# mediatex -c serv1 upgrade
# mediatex -c serv2 upgrade
scanner read unexpected caractere '<'
catalog parser fails on line 19

You have to edit that file again to resolve the conflict:

<<<<<<< HEAD
  "another thing?" = "maybe"
=======
  "another thing?" = "yes"
>>>>>>> 1d155a18d058093d47cd8649b5cd4d241de0c86f

Now upgrade do no more complains:

# mediatex -c serv2 upgrade

If you need specific permissions you can use “$ mediatex su [coll coll]” to become the collection system user.

# mediatex -c serv2 su coll hello
$ cd ~/git
$ git status

Next, please refer to GIT manual (man 1 git).

Cleanup:

# mediatex -c serv1 adm purge
# mediatex -c serv2 adm purge
# rm -fr /var/lib/mediatex/serv1
# rm -fr /var/lib/mediatex/serv2

Next: , Up: Troubleshooting   [Contents][Index]