HackerPapers

arXiv:1311.3903cs.LO

A Categorical Theory of Patches

Samuel Mimram, Cinzia Di Giusto

Abstract

When working with distant collaborators on the same documents, one often uses a version control system, which is a program tracking the history of files and helping importing modifications brought by others as patches. The implementation of such a system requires to handle lots of situations depending on the operations performed by users on files, and it is thus difficult to ensure that all the corner cases have been correctly addressed. Here, instead of verifying the implementation of such a system, we adopt a complementary approach: we introduce a theoretical model, which is defined abstractly by the universal property that it should satisfy, and work out a concrete description of it. We begin by defining a category of files and patches, where the operation of merging the effect of two coinitial patches is defined by pushout. Since two patches can be incompatible, such a pushout does not necessarily exist in the category, which raises the question of which is the correct category to represent and manipulate files in conflicting state. We provide an answer by investigating the free completion of the category of files under finite colimits, and give an explicit description of this category: its objects are finite sets labeled by lines equipped with a transitive relation and morphisms are partial functions respecting labeling and relations.

arXiv comments
Journal reference
MFPS - Mathematical Foundations of Programming Semantics 298 (2013) 283-307
DOI
doi:10.1016/j.entcs.2013.09.018
Subjects
cs.LOLogic in Computer Science math.CTCategory Theory

On Hacker News

Linked by 11 identifiable commenters in 11 comments across 11 threads, from Feb 2017 to Nov 2020. Found in 2 HN submissions from Feb 2021 to Feb 2021. Open submission discussions.

Comments linking this paper, per year.

Discussed in comments11 threads

  1. Pijul: Towards 1.0 1 comment
    • No big deal from my perspective. I was just explaining my cautious wording. I know you've been open about working with/from "ideas/people" in the darcs community, and good about the shoulders [1] the pijul work stands on/improves, and I also dislike people not giving credit…

      cb321View on HNParent context

    • In the vaguest sense, sure. But if a file is a list of lines, this "ambiguous file" is a digraph of lines. If a file is instead a tree of strings, what does an "ambiguous file" look like? See this paper which was the source of some of the main ideas of Pijul, and in particular…

      creataView on HNParent context

  2. CRDTs: The Hard Parts [video] 1 comment
    • I have no real understanding of this, but following the bread crumbs, I found this in Pijul's site (my emphasis below): > In that paper, and in Pijul, the definition of a file is slightly expanded, to included these cases, and “artificially add” all pushouts of all possible…

      lioetersView on HNParent context

    • Rust or any procedural language seems not to be the most apt lang to do a first implementation / rewrite of a patch theory. Patches themselves have already been generalized to paths using HOTT ref: https://www.cs.cmu.edu/~rwh/papers/htpt/paper.pdf. The takeaway from…

      potiuperView on HNParent context

  3. Git rebase in depth 1 comment
    • Pijul (https://pijul.org/) is based on a categorical theory of patches (https://arxiv.org/abs/1311.3903). It is similar to Darcs but written in Rust. They claim that Pijul has solved the exponential merge problem. The docs, FAQ, and blogs, in particular the last one, are…

      pdobsanView on HNParent context

  4. Applied Category Theory 1 comment
    • I am a mathematician and generally bearish on category theory in programming. The best argument for it I've seen so far is that it can inform the design of your system to give it desirable properties, like how the DVCS Pijul [1] bases its data structures on patches and its merge…

      gunnihinnView on HNParent context

    • This article has led me to Shapiro & Preguiça (2007) https://arxiv.org/pdf/0710.1784.pdf The whole idea that commutativity gives you a better-behaved transition to consistency reminds me of how the theory of patches gives DARCS/Pijul better handling of branches than Git. Cf.…

      chalstView on HNParent context

  5. Pijul for Git users 1 comment
    • > Pijul is the only version control system based on a complete mathematical theory of patches. [1] Can someone please provide a link to that theory? [1] https://nest.pijul.com/ EDIT: This? https://arxiv.org/abs/1311.3903

      lixtraView on HNParent context

    • Yeah, the logic behind it is based on patch theory (a subset of category theory) as put forth in this paper: https://arxiv.org/abs/1311.3903 It's a really interesting idea.

      erkinView on HNParent context

  6. The GNUnet System 1 comment
    • Thanks for mentioning 'Dat Project', hadn't heard of it before. Do you know if any of these distributed file stores are making use of this[1] result like Pijul? It'd be amazing if these projects converge on making version control, package management and any sort of information…

      openfutureView on HNParent context

    • This might be deeper than you are looking for, but this is the theory it's based on, and even has diagrams. :) https://arxiv.org/abs/1311.3903

      tupshinView on HNParent context

Submitted to Hacker News

Connected through shared HN threads, not inferred similarity or a recommendation.