How to move through history?

This is exactly where you are misunderstanding what changes (the Pijul term) are and what commits (the GIT term) are.

A change is not a point in history, at least not only. It is definitely not a point in history regarding the whole state of the working tree. You said, you haven’t read the earlier thread in detail. So, I’m hesitant to elaborate on this point, because you might not want to read about it…

A short example, though:

# create repo 'a' and record two changes
$ pijul init a; cd a; echo a>a; pijul record a -m a; echo b>b; pijul record b -m b; pjiul log --state

Change 3DXPVOZHTLM7BIYCTGXX3K4F2BDDOGJ2HIOZWMXGU26PLTTX44QQC
Author: spacefrogg
Date: 2022-01-26 14:51:15.756437822 UTC
State: JJB46NHV4MMXUHA3IWKYSQOBFEUM4VSH3SP3YKVO67OO3USRQS7AC

    b

Change BZFCUGORTCHPONN47D5AVS53DJ3PQA3UH3BAKN6XC6XZVG3ACMHAC
Author: spacefrogg
Date: 2022-01-26 14:51:01.428570226 UTC
State: GLSE5Y6RYOUO7CKZG7FC53T3GQL32NGVBMTBFTT3HC7X4MB2B7JQC

    a

Change NELXJKXLXLESBHFZGRFQHKKEULVWEUIAHFUDXVUTO2LJD3TV66JQC
Author:
Date: 2022-01-26 14:51:04.403293549 UTC
State: AZ2YWX57RU7YAAQHNLPW42BDTGWTTSSED73EXFFMIDWOZPYMPBVQC

Now we create a second repo and pull the patches in reverse, because they are independent of each other, this will result in the same repository, BUT:

# create repo 'b' and pull changes in reverse order (need to also specify the root change!)
$ cd ..; pijul init b; cd b; pijul pull ../a -- 3DXPV NELXJK
$ pijul pull ../a -- BZFCU; pijul log --state 

Change BZFCUGORTCHPONN47D5AVS53DJ3PQA3UH3BAKN6XC6XZVG3ACMHAC
Author: spacefrogg
Date: 2022-01-26 14:51:01.428570226 UTC
State: JJB46NHV4MMXUHA3IWKYSQOBFEUM4VSH3SP3YKVO67OO3USRQS7AC

    a

Change 3DXPVOZHTLM7BIYCTGXX3K4F2BDDOGJ2HIOZWMXGU26PLTTX44QQC
Author: spacefrogg
Date: 2022-01-26 14:51:15.756437822 UTC
State: USANBAQ4NXDHG3NBGPQUGWWRICQC2MGVEABX5JV5AGMEWMAPXUBAC

    b

Change NELXJKXLXLESBHFZGRFQHKKEULVWEUIAHFUDXVUTO2LJD3TV66JQC
Author:
Date: 2022-01-26 14:51:04.403293549 UTC
State: AZ2YWX57RU7YAAQHNLPW42BDTGWTTSSED73EXFFMIDWOZPYMPBVQC

As you can see, the root change NELX represents the same state AZ2Y in both repositories. Also, the newest changes represents the same state in both repositories, namely JJB4, although the changes themselves are different. Also notice that the developer in repository a can only go back to the state GLSE while the developer repository b can only go back to state USAN. Developer a will revert the change to file b and developer b will revert the change to file a.

The cause for this is that the history is linearised arbitrarily (well, not totally arbitrary) by Pijul to give you an impression of something that just doesn’t exist in its system, which is a single linear history.

1 Like