pijul_org / pijul

#191 Information about insertions is lost when unrecording and re-recording patches multiple times

Opened by pointfree, on September 18, 2017
pijul-0.9
Bug
Closed
pointfree commented on September 18, 2017

I wrote a simple bash script to view the contents patches after they have been recorded:

https://nest.pijul.com/pointfree/view-patches

It just unrecords the selected patches in a temporary branch, does a pijul diff, then returns to the previous branch and deletes the temporary branch.

If you run the script more than once on the same patch, you can see that pijul loses information about insertions. This indicates that the patches are presently not reversible. Furthermore, the script returns to previous branch after doing the diff which means the problem effects the other branches too, not just the temporary branch that got deleted.

andreas@carbon ~/r/p/pijul_org-pijul.10> view-patches AeqjT1pLHp7tGVIBTfSxi8tJfX9CLvnN8F_rYXNLhnnYznWVfl5YXmoOnyMj5N0eJyk8iWH_8k99Nl7JZBeVODg
In file "/home/andreas/repo/pijul/pijul_org-pijul.10/libpijul/src/apply.rs"

-                         self.get_patch(&branch.patches, dep_internal).is_none()
+                         self.get_patch(&branch.patches, dep_internal).is_some()

andreas@carbon ~/r/p/pijul_org-pijul.10> view-patches AeqjT1pLHp7tGVIBTfSxi8tJfX9CLvnN8F_rYXNLhnnYznWVfl5YXmoOnyMj5N0eJyk8iWH_8k99Nl7JZBeVODg
In file "/home/andreas/repo/pijul/pijul_org-pijul.10/libpijul/src/apply.rs"

-                         self.get_patch(&branch.patches, dep_internal).is_none()
pointfree commented on September 19, 2017

@lthms can't log in right now so I'm posting his comment on his behalf:

I believe this is an issue with unrecord when working with branch. I tried the following:

mkdir test
cd test
pijul init

Then I created a file test with the following content:

this
is
a
test

I’ve recorded it, then add a line beautiful:

this
is
a
beautiful
test

Recorded it, then output the graph of lines:

master before

Then, I did the following:

pijul fork test
pijul unrecord # unrecord last patch

After that, the graph of master has changed!

master after

The word “beautiful” has disappeared. But if I do

pijul pull . --from-branch master

It fixes the graph.

lthms added tag
Bug
on September 20, 2017
pmeunier commented on September 20, 2017

I believe #AUdA2YYY2JXfPsquErM68sjq8GP-xlMLiSUBlmLlRZtbdTP56Ik7_dQuxB6CBvgDbIE0tewpbSfw26_2uxfk5i8 fixes this.

pointfree commented on September 20, 2017

It doesn't seem to have fixed it. I still need this line:

pijul pull -a . --from-branch ${PREV_BRANCH} 2>&1 > /dev/null

in view-patches

https://nest.pijul.com/pointfree/view-patches:master/13bf39f9ca41c02802

lthms commented on September 22, 2017

This is strange.

If I apply the patch to prevent checkout to work if there are pending changes, I get the following behaviour.

Recorded patch AUD7Iy3F_aRfsdrKe6oxhcHP5ILMO9x5HgQwf-RoNXqJKLzuMCeQaqz9UNWjv_m6bLKm8hv6UjNR9qu-BjWIGkk
λ pijul fork test
λ pijul unrecord AUD7Iy3F_aRfsdrKe6oxhcHP5ILMO9x5HgQwf-RoNXqJKLzuMCeQaqz9UNWjv_m6bLKm8hv6UjNR9qu-BjWIGkk
λ pijul revert -a
λ pijul checkout master
error: There are pending changes in the repository. You need to revert or record them if you want to continue.

Therefore, I believe @pointfree is right. The bug is still there.

lthms commented on October 4, 2017

Okay, so with the upstream pijul, it looks like it is actually fixed!

lthms closed this discussion on October 4, 2017