Parallel Annotation: Merging
This should be done by the lab technician after the lab member responsible for a given type of annotating tells them to.
Let $LENA_PATH
refer to $BLAB_SHARE/VIHI/SubjectFiles/LENA
.
Let's say we are merging XX_123_456
which was annotated by Jane Doe
. The annotation should live under
$IN_PROGRESS_PATH=$LENA_PATH/annotations-in-progress/XX_123_456_Jane-Doe
Check the recording is ready to merge
First, make sure that all the changes have been committed and pushed to BLab share:
git -C $IN_PROGRESS_PATH status
If it doesn't say
Your branch is up to date with 'blab_share/annotating/XX_123_456_Jane-Doe'.
and
nothing to commit, working tree clean
ask the lab member who asked you to merge the recording to deal with that first.
If everything has been pushed and committed, move on to merging.
Merge
If you are merging just a couple of recordings then you can work directly in $LENA_PATH/annotations
. Otherwise, use a local clone - it will be a lot faster.
Merging in $LENA_PATH/annotations
$LENA_PATH/annotations
First, cd
into $LENA_PATH/annotations
Basic git-based merge:
git merge -m "merge: XX_123_456_Jane-Doe" annotating/XX_123_456_Jane-Doe
In case of git conflicts
There is a CLI uitlity in blabpy
that helps you merge the files:
eaf merge XX/XX_123/XX_123_456/XX_123_456.eaf
If there are conflicts/issues that eaf merge
will fail at, there will be three new files saved: XX_123_456.<suffix>
where suffix is one of: OURS
, THEIRS
, BASE
. Edit these files as necessary.
Below are a few examples of potential issues and what was done to fix those:
Once the three sides are compatible, run
eaf merge XX/XX_123/XX_123_456/XX_123_456.eaf --use-temps
And, once the above runs successfully,
git add XX/XX_123/XX_123_456/XX_123_456.eaf
git commit
Merging using a local clone
Push all the branches to GitHub:
# from $LENA_PATH/annotations
git push origin 'refs/heads/annotating/*:refs/heads/annotating/*'
Switch to the local folder you want the clone to live in and clone and fetch all branches:
gh repo clone bergelsonlab/VIHI_LENA
cd VIHI_LENA
git fetch --all
Continue with the merging process as described in Merging in $LENA_PATH/annotations with the following change: whereas before you had the branch named like this:
annotating/XX_123_456_Jane-Doe
It will now be
origin/annotating/XX_123_456_Jane-Doe
Once done, run git push
from the local clone and git pull
in $LENA_PATH/annotations
.
Cleanup
Once the actual merging is done, go to $LENA_PATH/annotations
and then
git branch -d annotating/XX_123_456_Jane-Doe
Delete the folder at
$IN_PROGRESS_PATH
.
If you were using a local clone, you'll additionally need to run
git push origin --delete annotating/XX_123_456_Jane-Doe
either from your local clone or from $LENA_PATH/annotations
.
Status check
Should be done weekly.
There are principally two checks we need to run. We have scripts in the blabsh
repo that can help with that.
There is no unsaved work in
annotations-in-progress
child folders. Use scriptpar-ann_check-in-progress-folders.sh
There are no loose (merged but not deleted) branches in
annotations
(main blab share clone). Use scriptpar-ann_check-branches
A few caveats:
It is OK to have unsaved work in a folder that's been modified today - this is probably someone actively working on it.
par-ann_check-branches
distinguishes two cases when a branch appears merged into main:After the branching, no new commits were added to the branch. This is OK if
Last updated