Hacker News new | ask | show | jobs
by wim 884 days ago
Another issue which git won't solve is if you collaborate on text which has "structure". For example when merging indented (todo) lists as flat text, bullets might end up in the wrong place, e.g.

  [ ] Project
      [ ] Don't do this
          [ ] Task A
While offline, user #1 adds '[ ] Task B' and '[ ] rm -rf /' under "Don't Do This", while user #2 adds '[ ] Do This' under 'Project'. Obviously you don't want to merge this as:

   [ ] Project
      [ ] Don't do this
          [ ] A
      [ ] Do This
          [ ] B
          [ ] rm -rf /

We're working on an app [1] which needs to deal with this, but in general it also makes git less suitable for things like outliners or other collaborative text editors where people can work on lists, tables, and so on (structured data basically).

[1] https://thymer.com/

2 comments

Does the app store structured text in a structured way? You probably need to for this to work the way you want.

We are writing a version controlled database (Dolt) and we recently implemented automatic merging of the contents of JSON documents, seems related to what you're doing:

https://www.dolthub.com/blog/2024-01-16-announcing-json-merg...

I believe that handling merges like this correctly was a motive for designing pijul: https://pijul.org

See the item on the splash page about 'merge correctness'. Unfortunately I wasn't able to find the post detailing the behavior with a bit of searching.