Details on output of pijul diff

Is there somewhere I can read more on how to interpret the output of pijul diff? The broad strokes are relatively self-explanatory (good job on that!), but I would appreciate a guide explaining what the various symbols and numbers mean, or at least telling me which ones I don’t really need to care about, because they won’t tell me much if I only ever work with files and not directly with Pijul’s internal format :slight_smile:

(Congratulations on working towards 1.0! I’ve been following Pijul for a while and it already taught me to be much more wary of Git, among other things, so thanks for that :slight_smile: The next bump seems to be marketing – people often seem to assume Git already works kind of like Pijul, and/or that Git’s issues are unavoidable and any VCS will have them. I realize that must be frustrating. And threading the needle between toy examples that people automatically dismiss, and a theory deep dive that no one will read unless they’re already at least a little bit convinced that Pijul is onto something, is no easy task. Good luck!)

3 Likes

You’re talking about

  B:BD 3.426214 -> 2.0:19/2
  up 3.426214, new 0:19, down 3.426233 

specifically right? I’m curious too

2 Likes

These are specifications of edges and vertices in the graph, in a compressed format (that was the main issue before, and the reason we didn’t have a good text forat):

This means: let e be the edge from position 3.426214 to the vertex 2.0:19 that was introduced by change /2. Turn the B flag of e (B meaning it is a “block” or “normal” edge) into a Deleted (BD) flag.

Now, 3., 2. and /2 refer to the dependencies section of the diff, and 426214, 0 and 19 are byte positions within these changes, i.e. 3.426214 is position 426214 in the contents of change numbered 3 in the dependencies section.

Edit: wait, I forgot the other part, up…new…down. This means insert a new vertex between these positions, and the new vertex has length 19.

2 Likes

Thanks for that! So it sounds like this is mostly related to Pijul’s internal graph structure and I don’t need to pay too close attention to it? Still, it’s good to have a general idea, especially the part about which numbers refer to the dependency list.

Another somewhat intriguing bit of syntax that I came across – consider the diff generated by this script:

#!/bin/bash

pijul init
echo -e "a\nb\nc" >foo.txt
pijul rec -m abc foo.txt --author jdoe

pijul fork dev
pijul channel switch dev
echo d >>foo.txt
pijul rec -m d --author jdoe
echo -e "e\na\nb\nc\nd" >foo.txt
pijul rec -m e --author jdoe

pijul channel switch main
echo -e "a\nb\nf\nc" >foo.txt
pijul rec -m f --author jdoe

pijul diff --channel dev

The diff looks like this:

timestamp = '2020-12-07T13:08:47.206748540Z'
authors = []

# Dependencies
[2] JJDISJAESXKX7IPXPZ4LA3G3TUYNA32XHMIH7EL7KLHFESJMBEJQC
[3] 5C7CU3NUQ6R5LGPDX67YH6HL2Q7DPHITDXESAEJMLLVVUYTYFW6AC
[4]+FJYDUCF4X4O3L6H42BIUBN3LDYFDEYS5MD35VBXGRSUJJBGCRXCAC
[*] FJYDUCF4X4O3L6H42BIUBN3LDYFDEYS5MD35VBXGRSUJJBGCRXCAC

# Changes

1. Edit in foo.txt:1 4.10
B:BD 4.10 -> 3.0:2/3
- e

2. Edit in foo.txt:3 4.10
  up 4.15, new 0:2, down 4.15
+ f

3. Edit in foo.txt:5 4.10
B:BD 4.17 -> 2.0:2/2
- d

Why is the hash for dependency 4 repeated twice, once with a leading +, the second time with a * in the square brackets? What is that telling me?

+ means “transitive dependencies required to write this diff, because [4] is used”. In other words, [4] is a dependency of [2] or [3].

* means “known change”, an internal thing to detect one type of conflicts.

1 Like