The sound distributed version control system

#751 What exactly does [*] dependency mean; and why seeing this dep generated for a seeming unrelated change -- is this a bug?

Closed on February 24, 2023
jbthiel on January 3, 2023

I noticed this in a more complicated situation, and have reduced to following test case. Given a test file ‘x’, which will hold these 2 states:

INITIAL x

$ cat x
a
b
c
d
e

EDITED x

$ cat x2
a
b
after b
c
dd
e

I record the initial ‘x’ file:

$ pijul add x
$ pijul rec x
Hash: PSXBU42RBCIMJOGM5GDMBI36TMK3E6FTIXGAXAU3LUXNAH7UYPBQC

Then replace the contents with x2 (cat x2 > x) and Record proposes 2 hunks like this:

$ pijul record x

message = ''
timestamp = '2023-01-03T19:17:58.624165230Z'

[[authors]]
key = '8Sp87yNu8Pd5zrBve5MhULn1cjMN3BEwudwAE4PRrEPy'

# Dependencies
[2] PSXBU42RBCIMJOGM5GDMBI36TMK3E6FTIXGAXAU3LUXNAH7UYPBQC

# Hunks

1. Edit in "x":3 2.26 "UTF-8"
  up 2.31, new 1:9, down 2.31
+ after b

2. Replacement in "x":5 2.26 "UTF-8"
B:BD 2.33 -> 2.33:35/2
  up 2.33, new 10:13, down 2.35
- d
+ dd

Now in the editor I remove hunk 2, and record only hunk 1.

$ pijul rec x
Hash: N2O5JHBT24NLXFXOGVPK4W3KQJXH4BYV2KQEZ3HQJX6DUYYAXJ5QC

$ pijul log
Change N2O5JHBT24NLXFXOGVPK4W3KQJXH4BYV2KQEZ3HQJX6DUYYAXJ5QC
Author: jbthiel
Date: 2023-01-03 19:17:58.624165230 UTC

    x after

Change PSXBU42RBCIMJOGM5GDMBI36TMK3E6FTIXGAXAU3LUXNAH7UYPBQC
Author: jbthiel
Date: 2023-01-03 19:17:34.792497581 UTC

    x initial

Then on subsequent record Pijul proposes the following, where it has added the [*] dependency on N2O5, which is the above hunk 1 change.

message = ''
timestamp = '2023-01-03T19:19:49.244786677Z'

[[authors]]
key = '8Sp87yNu8Pd5zrBve5MhULn1cjMN3BEwudwAE4PRrEPy'

# Dependencies
[2] PSXBU42RBCIMJOGM5GDMBI36TMK3E6FTIXGAXAU3LUXNAH7UYPBQC
[*] N2O5JHBT24NLXFXOGVPK4W3KQJXH4BYV2KQEZ3HQJX6DUYYAXJ5QC

# Hunks

1. Replacement in "x":5 2.26 "UTF-8"
B:BD 2.33 -> 2.33:35/2
  up 2.33, new 1:4, down 2.35
- d
+ dd

QUESTION: What exactly does [*] indicate, and why is the ‘dd’ change now dependent on both PSXB and N2O5? Is it a bug? The changed line ‘dd’ is not touching the prior hunk 1 change, because line ‘c’ is in between, so how is it dependent? Testing even with many lines in between, it still picks up this dep. Also, it relates to ‘dd’ being an edit (or delete), if I just add a line after ‘d’ instead, then there is no [*] dep.

I suggest [*] be explained clearly in the manual or an FAQ, maybe with its own topic so it shows in index/TOC, because it’s difficult to search for [*] since all regexp chars.

(Pijul version = 1.0.0-beta.2)

Sympel on February 7, 2023

As far as I can tell from the source code, the “dependencies” with a [*] are not actual dependencies, but changes that are saved as additional context. It seems pijul needs those in some cases, but I would expect them to not matter to the user.

pmeunier on February 24, 2023

Indeed, they don’t matter to the user, but Pijul needs them in order to guarantee certain properties, in particular to distinguish some cases of conflict with non-conflicts.

pmeunier closed this discussion on February 24, 2023