The sound distributed version control system

#252 appling collision

Closed on August 3, 2021
tankf33der on January 11, 2021

Short: it adds collision to tracked fails after my illegal steps.

Preparing sandbox:

$ pijul init pp
$ cd pp
$ mkdir a
$ pijul add a
$ pijul record -am"."
Hash: 3DM3RP76IMGNGJXT3VDSWPWYSNK7XIPKFXCACGW4AK6JDCVBMLUAC
$ touch a/b
$ cat a/b
1
2
3
$ pijul add a/b
$ pijul record -am"."
Hash: PLS7FP6CP4PUYQO5GC5AEH2PLGJU27DX26WIF557V6MXRSXKNCPAC
$ pijul ls
a
a/b
$ pijul fork m
$ pijul unrec PLS
$pijul unrec 3DM
$ vim a/b
$ cat a/b
1
2
3
444
$ pijul diff --short
A   a
A   a/b
$ pijul record -am"."
Hash: DHTFJT4A4EPZPH6FO3JIAJIS3NX32SYN22VZESTLFPD26QHTBZUQC
$ pijul apply --channel m DHT
$ pijul channel switch m
$ ls -l
rwxr-xr-x 2 mpech mpech 4096 jan 11 20:39 a
drwxr-xr-x 2 mpech mpech 4096 jan 11 20:39 a.DHTFJT4A4EPZP
$ pijul ls
$ pi ls
a
a/b
a.DHTFJT4A4EPZP
a.DHTFJT4A4EPZP/b
$ pijul diff --short
MV a.MAPZAJQQ3PL5S
$

I seen situations when collision was added to tracked files on both channels - main and m.

I repeated this several times, but failed to create 100% repeatable scenario here in report.

pmeunier on January 11, 2021

Once again, thanks for the report. In this case, this is expected behaviour, because you’re essentially simulating the situation where Alice and Bob both create a file with the same name, which is a conflict.

But maybe there is a more reasonable behaviour, what were you expecting? Would it be more intuitive if we refused to apply the conflicting patch, rather than outputting the conflict?

tankf33der on January 11, 2021

My standard expectations from any software no matter what I did wrong:

  • always warn me If I will find in the future I did something wrong (no silence);
  • dont run commands and modify state for me (new tracked files).
pmeunier on January 11, 2021

I’m planning on adding a whole lot of feedback about conflicts, so that should solve your first point. In the theory, conflicting states are not treated as errors in Pijul, they’re the normal thing, and I understand this can be confusing in practice, especially without feedback.

About your second point, how do you think we should represent the situation to the user? Would you find it more reasonable to receive an error message, and have an option to force the output?

Also, Libpijul has an option to avoid outputting that sort of conflict (file name conflict), so the fix for that particular bit will probably take one or two lines of code.

tankf33der on January 11, 2021

About second point - this is also silence rule:

`Info:` new tracked file(s) have been added on destination channel.
tankf33der closed this discussion on January 11, 2021
pmeunier reopened this discussion on January 11, 2021
pmeunier on January 11, 2021

I’m reopening in order to remind myself to implement the verbose commands.

pmeunier added tag Beta on January 12, 2021
pmeunier added a change on August 3, 2021
C4MJ7D7QCOFGIHQSDV3UC76DTSE5M7JSLGN5MROMSVKFVQRFSP5QC
main
pmeunier on August 3, 2021

This was actually super easy, but I’m glad it’s done.

pmeunier closed this discussion on August 3, 2021