sanskrit-lexicon / csl-corrections

Replacement for sanskrit-lexicon/CORRECTIONS. User corrections to sanskrit-lexicon/csl-orig
GNU General Public License v3.0
0 stars 0 forks source link

Git revert for syncing problem #4

Closed funderburkjim closed 4 years ago

funderburkjim commented 4 years ago

Dhaval - Had an awkward time with git. I think it occurred because 1) you pushed a change (involving cfr.tsv, WIL) 2) while I was locally also making changes to cfr.tsv (involving pwg). 3) Also, There were 4 additional WIL corrections at Cologne that were not present in my local cfr.tsv -- again, probably they were entered while I was working.

I think I solved the problem with a 'git revert',

Here are some details that may let you check my work.

Some details

I pulled , did some corrections to pwg, and pushed. (all local)

Then, on Cologne, I pulled --- but got an error. I also tried to 'push' from cologne, and also got an error.

I solved this by doing a 'revert', but just before the revert here are the git logs for Cologne csl-corrections, and (a newly clone) Github (same as my local).

Cologne git log before the revert

commit b90b1ae96dbdaafb85d0f5f95d74b2aa36f25422 (HEAD -> master)
Author: drdhaval2785 <drdhaval2785@gmail.com>
Date:   Wed Dec 18 20:51:18 2019 +0530

    WIL:35063,35064

commit 6b5f2772eeb1d2f38a2fef23ae11e56ffec471e8
Author: drdhaval2785 <drdhaval2785@gmail.com>
Date:   Wed Dec 18 08:24:13 2019 +0530

    ae:11278

commit 3dc632f8fde17b0c4d6176ccf85c413ca88f31f4
Merge: d833dd9 b0627bd
Author: drdhaval2785 <drdhaval2785@gmail.com>
Date:   Wed Dec 18 08:20:07 2019 +0530

    Merge branch 'master' of https://github.com/sanskrit-lexicon/csl-corrections

commit d833dd985cb171d75ccbc58fda59b2ebb9b5cf95
Author: drdhaval2785 <drdhaval2785@gmail.com>
Date:   Wed Dec 18 08:19:55 2019 +0530

Github (and my local) log:

I recloned github, and then did a local log

commit c4eb672c105224c19e603c7d80526d0e5c6c3fa6
Author: funderburkjim <funderburkjim@gmail.com>
Date:   Wed Dec 18 18:33:49 2019 -0500

    user corrections added while doing pwg corrections. The last 4 lines now agree with Cologne

commit 48dc4b90d370a5181ce4c2f28cbdac3a5f643bf1
Author: funderburkjim <funderburkjim@gmail.com>
Date:   Wed Dec 18 18:20:51 2019 -0500

    pwg:35439,droRa; 19764,kram; 101905,SreyaMs (print change); 102723,sa; 102722,sa

commit 0525f95bfe9414bbdb3390b7f54c9e93cce1e157    <<< where I will revert
Author: funderburkjim <funderburkjim@gmail.com>
Date:   Wed Dec 18 18:20:01 2019 -0500

    print message for any dictionaries with pending corrections   

<<< note this commit missing in Cologne git log!

commit 40da6590a0ab6ac47eb678aa26d186836f5aacfa    
Author: drdhaval2785 <drdhaval2785@gmail.com>
Date:   Wed Dec 18 21:20:06 2019 +0530

    WIL corrections

commit b90b1ae96dbdaafb85d0f5f95d74b2aa36f25422   
Author: drdhaval2785 <drdhaval2785@gmail.com>
Date:   Wed Dec 18 20:51:18 2019 +0530

    WIL:35063,35064

The local revert

git revert 0525f95  
[master 991402a] Revert "print message for any dictionaries with pending corrections"
 1 file changed, 2 deletions(-)

And finally ...

On local machine: git push

On Cologne: git pull # now it works.

It appears that the only difference is that file changed by 0525f95 needs to be rechanged.

how to guard against this?

Very time-consuming to deal with this, though learned a bit about 'git revert'.

@drdhaval2785 Questions:

  1. Do you think the problem is solved?
  2. Any way to guard against this ?
drdhaval2785 commented 4 years ago
  1. I think the problem is resolved.
  2. As we are working on the same files, it will be prudent to device a mechanism to avoid stepping on each others' foot.

My suggestion would be

On local machine, before starting corrections

cd csl-corrections
git pull origin master
cd ../csl-orig
git pull origin master

This will ensure that all changes on cologne is pulled before starting.

After finishing corrections locally

cd csl-corrections
git add .
git commit -m 'commit message'
git pull origin master
git push origin master

The step of git pull origin master will pull any additional commits which may have been made on github while one was working.

If there is no clash, continue as usual with pushing step.

If there is a clash

Git will throw an error on local machine that X file is changed in both commits and therefore I am unable to merge. In our case these files may be cfr.tsv or correctionform.txt or something like it.

When this file is opened in text editor, it will be like

>>>>>>> HEAD abcd
change 1
<<<<<<<< HEAD efgh
change 2 in the same line.

Make editing in the file and keep only the relevant line.

Thereafter you can commit and push from local , without any problem.

drdhaval2785 commented 4 years ago

A live example of the clash

<<<<<<< HEAD
12/17/2019 05:38:26 MW   260415 हथ  हठ  In Printed book page 1287,3 it is scripted Haṭha. Notice the diacritic mark of the letter ṭ.    Typo. Not infrequently I have encountered words that are present in MW but not in Apte. So I go about seeking clarification from my knowledgeable friends. That is how I learnt about हथ    sanaatani@gmail.com:No correction needed.
12/17/2019 20:30:45 MW      maatR^ikaa          Typo    :Not enough information
=======
12/17/2019 05:38:26 MW   260415 हथ  हठ  In Printed book page 1287,3 it is scripted Haṭha. Notice the diacritic mark of the letter ṭ.    Typo. Not infrequently I have encountered words that are present in MW but not in Apte. So I go about seeking clarification from my knowledgeable friends. That is how I learnt about हथ    sanaatani@gmail.com
12/17/2019 20:30:45 MW      maatR^ikaa          Typo    
12/18/2019 19:52:27 WIL  167    अक्षविद्    विट् who knows. विद् who knows. विट्    tvitaly1@yandex.ru
12/18/2019 20:02:33 WIL  167    अक्षविद्    विट् who knows. विद्  who knows.    विट्    tvitaly1@yandex.ru
12/18/2019 20:46:26 WIL  5927   आवेद्य  विट् to know,   विद् to know,   विट्    tvitaly1@yandex.ru
12/18/2019 22:09:47 WIL  41435  सा  तट् that, &c.   तद् that, &c.   तट् tvitaly1@yandex.ru
>>>>>>> 116c27c04445ea17ef922d3fa09f87a896ad76f0

This means that my local changes in हथ and मातृका are not present in the github. Whereas the addition of 4 WIL changes is not present in my local copy.

The corrected version would read like this

12/17/2019 05:38:26 MW   260415 हथ  हठ  In Printed book page 1287,3 it is scripted Haṭha. Notice the diacritic mark of the letter ṭ.    Typo. Not infrequently I have encountered words that are present in MW but not in Apte. So I go about seeking clarification from my knowledgeable friends. That is how I learnt about हथ    sanaatani@gmail.com:No correction needed.
12/17/2019 20:30:45 MW      maatR^ikaa          Typo    :Not enough information
12/18/2019 19:52:27 WIL  167    अक्षविद्    विट् who knows. विद् who knows. विट्    tvitaly1@yandex.ru
12/18/2019 20:02:33 WIL  167    अक्षविद्    विट् who knows. विद्  who knows.    विट्    tvitaly1@yandex.ru
12/18/2019 20:46:26 WIL  5927   आवेद्य  विट् to know,   विद् to know,   विट्    tvitaly1@yandex.ru
12/18/2019 22:09:47 WIL  41435  सा  तट् that, &c.   तद् that, &c.   तट् tvitaly1@yandex.ru

Note that I have removed <<< and === etc lines and kept only the relevant part.

After this, I can do git add, commit, push etc without any problem.

Because in local machine, we have luxury of using text editor of our choice, such changes are easier made in local machine than upstream cologne server. Therefore a 'git pull' locally gives me more comfort when there is a clash. I can correct and update.

This would obviate the need of git revert or recloning or any other drastic step.

drdhaval2785 commented 4 years ago

It has served its documentation purpose. Closing.