Using LyX as merge tool for git
Dan
d3vf4n at tutanota.com
Mon Oct 16 01:47:37 UTC 2023
15 d’oct. de 2023, 20:37 per markus at memotech.franken.de:
> Hi fellow LyX users,
>
> Just wanted to share with you how it's possible to use the compare feature of LyX to resolve git merge conflicts by registering LyX as a merge tool for git:
>
> [...]
>
> When you have a git-managed LyX file with merge conflicts you can then run "git mergetool -t lyx path/to/file.lyx" from inside the git repository of that file.
>
> This should make LyX start up in compare mode and give you the ability to accept / reject the changes.
> When finished, you need to override the conflicted file with the generated changes1.lyx file, close the LyX window and confirm to git that the merge was successful.
>
An interesting alternative for handling LyX files, indeed. I am not sure it is reliable, though. Follow through the next steps to see why
1. Create a new file in Lyx with some random text and save it ("newfile1.lyx").
2. Press "Return" and append some random text to the file; save it as a different document ("newfile1-modified.lyx").
3. Compare both documents (Tools > Compare...).
The result is the expected: only the added text is marked as a change.
Now continue with this
4. In "newfile1-modified.lyx" change the type face of the document's first word (from serif to sans serif, for instance).
5. Save the document and run the comparision (step 3) again.
The result can be very unexpected and confusing (see attached images): non-modified text is marked as changed and viceversa.
On top of this, the document comparison function only searches for changes in the contents of the document; does not seem to check for (all) its properties such as
- You cannot tell whether the document changed from compressed to not compressed (or viceversa).
- You cannot tell whether the document changed its setting to save transient properties or not.
- A change in the document's language makes the whole text to be maked as changes.
These are a few that I have tested.
I am not saying it is useless, but it has some limitations that should be taken into account when using it.
Daniel.
--
Enviat amb Tutanota.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Lyx-compare-docs_1.png
Type: image/png
Size: 92708 bytes
Desc: not available
URL: <http://lists.lyx.org/pipermail/lyx-users/attachments/20231016/8c956825/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Lyx-compare-docs_2.png
Type: image/png
Size: 97648 bytes
Desc: not available
URL: <http://lists.lyx.org/pipermail/lyx-users/attachments/20231016/8c956825/attachment-0003.png>
More information about the lyx-users
mailing list