pijul_org / pijul

#209 pijul pull moves files

Opened by lthms, on October 12, 2017
lthms commented on October 12, 2017

After a pijul pull to fetch the patches of this morning, my pijul status (from pijul/) is not empty:\r + \r +

Changes not yet recorded:\r                                                                                                                                                               +
  (use "pijul record ..." to record a new patch)\r                                                                                                                                        +
\r                                                                                                                                                                                        +
        moved:     ../.ignore\r                                                                                                                                                           +
        moved:     ../CHANGELOG.md\r                                                                                                                                                      +
        moved:     ../CONTRIBUTORS.md\r                                                                                                                                                   +
        moved:     ../README.md\r                                                                                                                                                         +
        moved:     ../default.nix\r                                                                                                                                                       +
        moved:     ../libpijul\r                                                                                                                                                          +
        moved:     ../libpijul/COPYING\r                                                                                                                                                  +
        moved:     ../libpijul/Cargo.toml\r                                                                                                                                               +
        moved:     ../libpijul/src\r                                                                                                                                                      +
        moved:     ../libpijul/src/apply.rs\r                                                                                                                                             +
        moved:     ../libpijul/src/backend\r                                                                                                                                              +
        moved:     ../libpijul/src/backend/edge.rs\r                                                                                                                                      +
        moved:     ../libpijul/src/backend/file_header.rs\r                                                                                                                               +
        moved:     ../libpijul/src/backend/file_id.rs\r                                                                                                                                   +
        moved:     ../libpijul/src/backend/hash.rs\r                                                                                                                                      +
        moved:     ../libpijul/src/backend/inode.rs\r                                                                                                                                     +
        moved:     ../libpijul/src/backend/key.rs\r                                                                                                                                       +
        moved:     ../libpijul/src/backend/mod.rs\r                                                                                                                                       +
        moved:     ../libpijul/src/backend/patch_id.rs\r                                                                                                                                  +
        moved:     ../libpijul/src/backend/small_string.rs\r                                                                                                                              +
        moved:     ../libpijul/src/conflict.rs\r                                                                                                                                          +
        moved:     ../libpijul/src/error.rs\r                                                                                                                                             +
        moved:     ../libpijul/src/file_operations.rs\r                                                                                                                                   +
        moved:     ../libpijul/src/fs_representation.rs\r                                                                                                                                 +
        moved:     ../libpijul/src/graph.rs\r                                                                                                                                             +
        moved:     ../libpijul/src/lib.rs\r                                                                                                                                               +
        moved:     ../libpijul/src/optimal_diff.rs\r                                                                                                                                      +
        moved:     ../libpijul/src/output.rs\r                                                                                                                                            +
        moved:     ../libpijul/src/patch.rs\r                                                                                                                                             +
        moved:     ../libpijul/src/record.rs\r                                                                                                                                            +
        moved:     ../libpijul/src/signature.rs\r                                                                                                                                         +
        moved:     ../libpijul/src/unrecord\r                                                                                                                                             +
        moved:     ../libpijul/src/unrecord/context_repair.rs\r                                                                                                                           +
        moved:     ../libpijul/src/unrecord/edges.rs\r                                                                                                                                    +
        moved:     ../libpijul/src/unrecord/mod.rs\r                                                                                                                                      +
        moved:     ../libpijul/src/unrecord/nodes.rs\r                                                                                                                                    +
        moved:     ../pijul\r                                                                                                                                                             +
        moved:     COPYING\r                                                                                                                                                              +
        moved:     Cargo.lock\r                                                                                                                                                           +
        moved:     Cargo.toml\r                                                                                                                                                           +
        moved:     src\r                                                                                                                                                                  +
        moved:     src/commands\r                                                                                                                                                         +
        moved:     src/commands/add.rs\r                                                                                                                                                  +
        moved:     src/commands/apply.rs\r                                                                                                                                                +
        moved:     src/commands/ask.rs\r                                                                                                                                                  +
        moved:     src/commands/blame.rs\r                                                                                                                                                +
        moved:     src/commands/branches.rs\r                                                                                                                                             +
        moved:     src/commands/checkout.rs\r                                                                                                                                             +
        moved:     src/commands/clone.rs\r                                                                                                                                                +
        moved:     src/commands/delete_branch.rs\r                                                                                                                                        +
        moved:     src/commands/diff.rs\r                                                                                                                                                 +
        moved:     src/commands/dist.rs\r                                                                                                                                                 +
        moved:     src/commands/fork.rs\r                                                                                                                                                 +
        moved:     src/commands/fs_operation.rs\r                                                                                                                                         +
        moved:     src/commands/hooks.rs\r                                                                                                                                                +
        moved:     src/commands/info.rs\r                                                                                                                                                 +
        moved:     src/commands/init.rs\r                                                                                                                                                 +
        moved:     src/commands/keys.rs\r                                                                                                                                                 +
        moved:     src/commands/log.rs\r                                                                                                                                                  +
        moved:     src/commands/ls.rs\r                                                                                                                                                   +
        moved:     src/commands/mod.rs\r                                                                                                                                                  +
        moved:     src/commands/mv.rs\r                                                                                                                                                   +
        moved:     src/commands/patch.rs\r                                                                                                                                                +
        moved:     src/commands/pull.rs\r                                                                                                                                                 +
        moved:     src/commands/push.rs\r                                                                                                                                                 +
        moved:     src/commands/record.rs\r                                                                                                                                               +
        moved:     src/commands/remote.rs\r                                                                                                                                               +
        moved:     src/commands/remove.rs\r                                                                                                                                               +
        moved:     src/commands/revert.rs\r                                                                                                                                               +
        moved:     src/commands/show_dependencies.rs\r                                                                                                                                    +
        moved:     src/commands/status.rs\r                                                                                                                                               +
        moved:     src/commands/tag.rs\r                                                                                                                                                  +
        moved:     src/commands/test.rs\r                                                                                                                                                 +
        moved:     src/commands/unrecord.rs\r                                                                                                                                             +
        moved:     src/error.rs\r                                                                                                                                                         +
        moved:     src/main.rs\r                                                                                                                                                          +
        moved:     src/meta.rs\r                                                                                                                                                          +
        moved:     tests\r                                                                                                                                                                +
        moved:     tests/bats\r                                                                                                                                                           +
        moved:     tests/bats/bats\r                                                                                                                                                      +
        moved:     tests/bats/bats-exec-suite\r                                                                                                                                           +
        moved:     tests/bats/bats-exec-test\r                                                                                                                                            +
        moved:     tests/bats/bats-format-tap-stream\r                                                                                                                                    +
        moved:     tests/bats/bats-preprocess\r                                                                                                                                           +
        moved:     tests/cases\r                                                                                                                                                          +
        moved:     tests/cases/add_from_outside_repo.bats\r                                                                                                                               +
        moved:     tests/cases/add_grandchild.bats\r                                                                                                                                      +
        moved:     tests/cases/add_only_in_repo.bats\r                                                                                                                                    +
        moved:     tests/cases/add_outside_repo.bats\r                                                                                                                                    +
        moved:     tests/cases/add_record_pull_delete_record_pull.bats\r                                                                                                                  +
        moved:     tests/cases/add_record_pull_edit_record_pull.bats\r                                                                                                                    +
        moved:     tests/cases/add_remove_file_unknown.bats\r                                                                                                                             +
        moved:     tests/cases/add_remove_nothing_to_record.bats\r                                                                                                                        +
        moved:     tests/cases/add_same_file_twice.bats\r                                                                                                                                 +
        moved:     tests/cases/blame.bats\r                                                                                                                                               +
        moved:     tests/cases/dist_works.bats\r                                                                                                                                          +
        moved:     tests/cases/info_out_of_repo.bats\r                                                                                                                                    +
        moved:     tests/cases/init_allows_nesting.bats\r                                                                                                                                 +
        moved:     tests/cases/init_another_directory.bats\r                                                                                                                              +
        moved:     tests/cases/init_forbid_nesting.bats\r                                                                                                                                 +
        moved:     tests/cases/interactive_pull.bats\r                                                                                                                                    +
        moved:     tests/cases/interactive_record.bats\r                                                                                                                                  +
        moved:     tests/cases/move_dir_merge.bats\r                                                                                                                                      +
        moved:     tests/cases/move_edit_file.bats\r                                                                                                                                      +
        moved:     tests/cases/move_file.bats\r                                                                                                                                           +
        moved:     tests/cases/move_merge.bats\r                                                                                                                                          +
        moved:     tests/cases/move_to_dir.bats\r                                                                                                                                         +
        moved:     tests/cases/move_to_unrecorded.bats\r                                                                                                                                  +
        moved:     tests/cases/move_unadded.bats\r                                                                                                                                        +
        moved:     tests/cases/no_remove_without_add.bats\r                                                                                                                               +
        moved:     tests/cases/nothing_to_record.bats\r                                                                                                                                   +
        moved:     tests/cases/pull_30_patches.bats\r                                                                                                                                     +
        moved:     tests/cases/pull_empty_file.bats\r                                                                                                                                     +
        moved:     tests/cases/pull_push.bats\r                                                                                                                                           +
        moved:     tests/cases/pull_symmetric.bats\r                                                                                                                                      +
        moved:     tests/cases/pull_symmetric_add_add_conflict.bats\r                                                                                                                     +
        moved:     tests/cases/pull_symmetric_edit_edit_conflict.bats\r                                                                                                                   +
        moved:     tests/cases/pull_symmetric_edit_edit_conflict_context.bats\r                                                                                                           +
        moved:     tests/cases/pull_zombie_lines.bats\r                                                                                                                                   +
        moved:     tests/cases/revert.bats\r                                                                                                                                              +
        moved:     tests/cases/revert_move.bats\r                                                                                                                                         +
        moved:     tests/cases/short_status.bats\r                                                                                                                                        +
        moved:     tests/cases/show_dependencies.bats\r                                                                                                                                   +
        moved:     tests/cases/something_to_record.bats\r                                                                                                                                 +
        moved:     tests/cases/three_way_zombie.bats\r                                                                                                                                    +
        moved:     tests/cases/unrecord_does_not_touch_working_dir.bats\r                                                                                                                 +
        moved:     tests/cases/unrecord_file_moves.bats\r                                                                                                                                 +
        moved:     tests/expected\r                                                                                                                                                       +
        moved:     tests/expected/add_remove_file_unknown\r                                                                                                                               +
        moved:     tests/expected/move_to_unrecorded\r                                                                                                                                    +
        moved:     tests/expected/revert_move\r                                                                                                                                           +
        moved:     tests/expected/short_status\r                                                                                                                                          +
        moved:     tests/run_tests.sh\r                                                                                                                                                   +
        moved:     tests/test_helper.bash\r                                                                                                                                               +
        moved:     ../shell.nix\r                                                                                                                                                         +
```\r                                                                                                                                                                                     +
\r                                                                                                                                                                                        +
It looks like a bug @pointfree encounters with the Nestling, so we should investigate. I haven’t tried yet, but I am pretty sure `pijul revert` “fixes” this issue. It is just annoying.\r+
\r                                                                                                                                                                                        +
**Edit:** `pijul revert` does not fix it
lthms added tag
on October 12, 2017
lthms commented on October 12, 2017

How To Reproduce\r +

\r +

pijul clone https://nest.pijul.com/lthms/pijul pijul-mv-bug\r+
cd pijul-mv-bug\r                                            +
pijul pull https://nest.pijul.com/pijul_org/pijul -a\r       +
pijul status\r                                               +
pmeunier commented on October 12, 2017

I cannot reproduce, so I bet this is a permission problem.

pmeunier commented on October 12, 2017

Can you try again with RUST_LOG="libpijul::output=debug?

lthms commented on October 12, 2017

For the second command (pijul pull) or also for the clone?

pmeunier commented on October 12, 2017

If pijul status is fine after the clone, I just need it for the pull.

lthms commented on October 12, 2017

Well, that is strange. I can’t reproduce either in my laptop. I will have to try tomorrow.

lthms commented on October 13, 2017

For another (smaller) project that triggers the same behaviour: https://framabin.org/?1b8fc5936b9e1a83#Z8iShY+K+39xbMYDF2JlgI26s/wQmD3bgOtYvsS727g=

pmeunier commented on October 15, 2017

Hi @pointfree, thanks for your patch. Since I can't reproduce this bug, does this solve the problem?\r + I don't understand how Record::NoChange gets produced. libpijul::record returns all other constructors, but this doesn't seem to be the case for Record::NoChange.

pointfree commented on October 15, 2017
 # pijul_org/pijul\r                                                                                                                                                                         +
 rustup run stable cargo install --force; pijul diff; pijul status # no problem here\r                                                                                                       +
 rustup run nightly cargo install --force; pijul diff; pijul status # the problems is here\r                                                                                                 +

\r + # lthms/nestling\r + rustup run stable cargo install --force; pijul diff; pijul status # the problems is here\r + rustup run nightly cargo install --force; pijul diff; pijul status # the problems is here\r + \r + So the problem appears in nightly but not stable. Using stable appears to fix the problem, but only in pijul_org/pijul. The problem appears in nightly or stable with the repo lthms/nestling.\r+ \r + I tried with and without the above patch and it seems to have no effect which I guess is not surprising. Time to dig deeper.

lthms commented on October 15, 2017

Nice finding @pointfree! Unfortunately, I think we will have quite a lot of trouble to fix this one…

pointfree commented on October 15, 2017

I built pijul with --debug and I'm running it like so cd nestling; RUST_LOG=debug pijul status 2>&1 | grep Moved (You will get PatchId's of patches introducing file moves)\r+ \r + I can see that it only seems to effect files that were added by previous patches. (I tried adding a new file to nestling and did not see a problem there)\r + \r + I'm using ext4 on my laptop. What filesystems are @lthms and @pmeunier using?

pmeunier commented on October 15, 2017

Oops, I just realised I said something on IRC but forgot to copy it here: I'd love to help solve this bug, I just need:\r +

  • the output of libpijul::output=debug (when doing the clone and pull)\r +
  • the output libpijul::record=debug when doing the status\r +
  • maybe the contents of the inodes table at each step (after the clone and after the pull). This is slightly harder to get, you need to run RUST_LOG=libpijul::backend::dump=debug pijul info --debug.
lthms commented on October 16, 2017

So you can’t reproduce even with a nightly build?

pmeunier commented on October 16, 2017

I could indeed reproduce with nightly, I've not found any documentation for what changed in Rust.\r + I think this is fixed by #8sj92aFF5Y5SmGddr513Sv2UWwy3wfcC3fkH4tap4fidwRBd2qefQSym6wVxLSmkrxz1Ua8vwCm8xCDKckCTq7b8

lthms commented on October 16, 2017

Pulled it, built it, checked it. It works! thanks.

lthms closed this discussion on October 16, 2017