Pijul

Merge conflict markers for easy merge?

Why does Pijul mark a merge conflict for a small change?
Using Pijul 1.0.0-alph.48, I pulled the recent changes.

working/contrib/pijul$ pijul pull
  Downloading changes [==================================================] 3/3                     
             Applying [==================================================] 3/3                     
   Completing changes [                                                  ] 0/0                     
Outputting repository ↓                                                                             
working/contrib/pijul$ cargo update
error: failed to parse lock file at: working/contrib/pijul/Cargo.lock

Caused by:
  could not parse input as TOML

Caused by:
  unexpected character found: `>` at line 1659 column 1

The Cargo.lock file at line 1657 has

[[package]]
name = "sanakirja"
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
version = "1.2.0"
================================
version = "1.2.0"
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
source = "registry+https://github.com/rust-lang/crates.io-index"
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
checksum = "d822992da34989ceda221b7cc3f99381da3130c8e90f393054b0ea4e80617265"
================================
checksum = "d822992da34989ceda221b7cc3f99381da3130c8e90f393054b0ea4e80617265"
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

Why?

The size of the change has nothing to do with this. Since I know Pijul may be a bit confusing at first, here is a major difference between Pijul (or Darcs) and Git (or SVN, Mercurial, Fossil, CVS, RCS…):

  • Git operates on versions (aka commits), i.e. full states of the repository. When you want to merge two versions, it looks at the youngest common ancestor (another version), and runs a heuristic algorithm to try and guess what should be done to get yet another version (a fourth one) that could be more or less “consistent” (for some definition of consistent) with the other versions.

  • Pijul operates on changes (aka diffs, deltas, patches), which are operations on the versions. It doesn’t care use the contents of the changes while merging, because it doesn’t try to guess anything. The rule is: if two patches edit the same line, there’s a conflict, even if they do the same thing. There is only a minimal amount of opinion here, in the sense that we could choose not to show the conflict to the user. But (1) it would violate our rule of not trying to guess anything and (2) there may be cases where two authors make the same change for different reasons, and the combination of these changes is something other than ignoring one of them.

I don’t understand two things.

  1. Why is this a conflict at all? I didn’t make any local changes. I just pulled from the repository.

  2. Why isn’t it more clear what I should do with a conflict? I guess when it throws me into an editor (that I never use, so I don’t know what I’m doing in there), I should do something beside exit, but I’m not getting the “how to use Pijul” vibe from anything I’ve read.

Edit: Maybe I should add a third thing, which is what do I do with a repo that I inadvertently left merge conflict markers in? Are there commands to manage that?

On a related note, one of the changes that I pulled was to make a subfolder named pijul inside the pijul folder. This is quite confusing. Was that a mistake, or could you rename the folder to something more descriptive?

This is because it’s on a file edited automatically by Rust on your end, and also edited (with the same changes) in the repository.

That’s an easy one: usually, people want to solve their conflicts, even though Pijul allows you to keep them for a while and work on other stuff. In this particular case, you probably want to pijul reset Cargo.lock.

I guess it’s not clear enough to me that there was a conflict. I didn’t know I had to do anything.

I did the pijul reset Cargo.lock and that seemed to work.
But building pijul gave me errors.

working/contrib/pijul$ pijul reset Cargo.lock
Outputting repository ↖                                                                             
working/contrib/pijul$ cargo update
    Updating crates.io index
    Updating anyhow v1.0.38 -> v1.0.40
    Updating backtrace v0.3.56 -> v0.3.57
    Updating bincode v1.3.2 -> v1.3.3
    Updating byteorder v1.3.4 -> v1.4.3
    Updating ctrlc v3.1.8 -> v3.1.9
    Updating curve25519-dalek v3.0.2 -> v3.1.0
      Adding either v1.6.1
    Updating futures v0.3.13 -> v0.3.14
    Updating futures-channel v0.3.13 -> v0.3.14
    Updating futures-core v0.3.13 -> v0.3.14
    Updating futures-executor v0.3.13 -> v0.3.14
    Updating futures-io v0.3.13 -> v0.3.14
    Updating futures-macro v0.3.13 -> v0.3.14
    Updating futures-sink v0.3.13 -> v0.3.14
    Updating futures-task v0.3.13 -> v0.3.14
    Updating futures-util v0.3.13 -> v0.3.14
    Updating git2 v0.13.17 -> v0.13.18
    Updating h2 v0.3.1 -> v0.3.2
    Updating http v0.2.3 -> v0.2.4
    Updating http-body v0.4.0 -> v0.4.1
    Updating httparse v1.3.5 -> v1.4.0
    Updating httpdate v0.3.2 -> v1.0.0
    Updating hyper v0.14.4 -> v0.14.7
    Updating idna v0.2.2 -> v0.2.3
    Updating indexmap v1.6.1 -> v1.6.2
    Updating jobserver v0.1.21 -> v0.1.22
    Updating js-sys v0.3.48 -> v0.3.50
    Updating libc v0.2.86 -> v0.2.93
    Updating libgit2-sys v0.12.18+1.1.0 -> v0.12.19+1.1.0
    Updating lock_api v0.4.2 -> v0.4.3
    Updating memoffset v0.6.1 -> v0.6.3
    Updating mio v0.7.9 -> v0.7.11
    Updating miow v0.3.6 -> v0.3.7
    Updating once_cell v1.7.0 -> v1.7.2
    Updating openssl v0.10.32 -> v0.10.33
    Updating openssl-sys v0.9.60 -> v0.9.61
    Updating pin-project v1.0.5 -> v1.0.7
    Updating pin-project-internal v1.0.5 -> v1.0.7
    Updating pin-project-lite v0.2.4 -> v0.2.6
    Updating proc-macro2 v1.0.24 -> v1.0.26
    Updating redox_syscall v0.2.5 -> v0.2.6
    Updating regex v1.4.3 -> v1.4.6
    Updating regex-syntax v0.6.22 -> v0.6.23
    Updating reqwest v0.11.1 -> v0.11.3
    Updating security-framework v2.1.1 -> v2.2.0
    Updating security-framework-sys v2.1.1 -> v2.2.0
    Updating serde v1.0.123 -> v1.0.125
    Updating serde_derive v1.0.123 -> v1.0.125
    Updating slab v0.4.2 -> v0.4.3
    Updating socket2 v0.3.19 -> v0.4.0
    Updating syn v1.0.60 -> v1.0.70
    Updating thrussh v0.32.7 -> v0.32.8
    Updating tinyvec v1.1.1 -> v1.2.0
    Updating tokio v1.2.0 -> v1.5.0
    Updating tokio-util v0.6.3 -> v0.6.6
    Updating typenum v1.12.0 -> v1.13.0
    Updating unicode-bidi v0.3.4 -> v0.3.5
    Updating vcpkg v0.2.11 -> v0.2.12
    Updating version_check v0.9.2 -> v0.9.3
    Updating walkdir v2.3.1 -> v2.3.2
    Updating wasm-bindgen v0.2.71 -> v0.2.73
    Updating wasm-bindgen-backend v0.2.71 -> v0.2.73
    Updating wasm-bindgen-futures v0.4.21 -> v0.4.23
    Updating wasm-bindgen-macro v0.2.71 -> v0.2.73
    Updating wasm-bindgen-macro-support v0.2.71 -> v0.2.73
    Updating wasm-bindgen-shared v0.2.71 -> v0.2.73
    Updating web-sys v0.3.48 -> v0.3.50
    Updating which v4.0.2 -> v4.1.0
    Updating whoami v1.1.0 -> v1.1.2
    Updating zeroize v1.2.0 -> v1.3.0
working/contrib/pijul$ cargo build
  Downloaded futures-channel v0.3.14
  Downloaded byteorder v1.4.3
  Downloaded futures-core v0.3.14
  Downloaded futures-macro v0.3.14
  Downloaded bincode v1.3.3
  Downloaded tokio-util v0.6.6
  Downloaded zeroize v1.3.0
  Downloaded futures-executor v0.3.14
  Downloaded crossbeam-deque v0.8.0
  Downloaded ctrlc v3.1.9
  Downloaded syn v1.0.70
  Downloaded backtrace v0.3.57
  Downloaded curve25519-dalek v3.1.0
  Downloaded tokio v1.5.0
  Downloaded futures-util v0.3.14
  Downloaded futures-task v0.3.14
  Downloaded futures v0.3.14
  Downloaded httpdate v1.0.0
  Downloaded slab v0.4.3
  Downloaded httparse v1.4.0
  Downloaded futures-io v0.3.14
  Downloaded vcpkg v0.2.12
  Downloaded pin-project v1.0.7
  Downloaded reqwest v0.11.3
  Downloaded pin-project-internal v1.0.7
  Downloaded idna v0.2.3
  Downloaded hyper v0.14.7
  Downloaded regex v1.4.6
  Downloaded twox-hash v1.6.0
  Downloaded memoffset v0.6.3
  Downloaded futures-sink v0.3.14
  Downloaded crossbeam-epoch v0.9.3
  Downloaded 32 crates (2.8 MB) in 19.91s
   Compiling syn v1.0.70
   Compiling futures-core v0.3.14
   Compiling futures-sink v0.3.14
   Compiling slab v0.4.3
   Compiling futures-task v0.3.14
   Compiling futures-io v0.3.14
   Compiling httparse v1.4.0
   Compiling byteorder v1.4.3
   Compiling httpdate v1.0.0
   Compiling zeroize v1.3.0
   Compiling static_assertions v1.1.0
   Compiling tokio v1.5.0
   Compiling memoffset v0.6.3
   Compiling futures-channel v0.3.14
   Compiling idna v0.2.3
   Compiling regex v1.4.6
   Compiling backtrace v0.3.57
   Compiling ctrlc v3.1.9
   Compiling rand_chacha v0.2.2
   Compiling crossbeam-epoch v0.9.3
   Compiling url v2.2.1
   Compiling rand v0.7.3
   Compiling crossbeam-deque v0.8.0
   Compiling globset v0.4.6
   Compiling os_type v2.2.0
   Compiling env_logger v0.8.3
   Compiling ignore v0.4.17
   Compiling twox-hash v1.6.0
   Compiling proc-macro-error v1.0.4
   Compiling serde_derive v1.0.125
   Compiling tokio-macros v1.1.0
   Compiling futures-macro v0.3.14
   Compiling thiserror-impl v1.0.24
   Compiling pin-project-internal v1.0.7
   Compiling pijul-macros v0.4.0 (working/contrib/pijul/pijul-macros)
   Compiling clap_derive v3.0.0-beta.2
   Compiling futures-util v0.3.14
   Compiling pin-project v1.0.7
   Compiling thiserror v1.0.24
   Compiling sanakirja v1.2.0
   Compiling zstd-seekable v0.1.7
   Compiling clap v3.0.0-beta.2
   Compiling futures-executor v0.3.14
   Compiling serde v1.0.125
   Compiling futures v0.3.14
   Compiling tokio-util v0.6.6
   Compiling tokio-native-tls v0.3.0
   Compiling thrussh-config v0.5.0
   Compiling h2 v0.3.2
   Compiling toml v0.5.8
   Compiling thrussh-keys v0.20.3
   Compiling serde_urlencoded v0.7.0
   Compiling bincode v1.3.3
   Compiling chrono v0.4.19
   Compiling curve25519-dalek v3.1.0
   Compiling serde_json v1.0.64
   Compiling human-panic v1.0.3
   Compiling thrussh v0.32.8
   Compiling libpijul v1.0.0-alpha.39 (working/contrib/pijul/libpijul)
   Compiling hyper v0.14.7
   Compiling hyper-tls v0.5.0
   Compiling reqwest v0.11.3
   Compiling pijul v1.0.0-alpha.48 (working/contrib/pijul/pijul)
error[E0432]: unresolved import `libpijul::ChannelMutTxnT`
  --> pijul/src/commands/record.rs:12:13
   |
12 |     Base32, ChannelMutTxnT, ChannelRef, ChannelTxnT, MutTxnT, MutTxnTExt, TxnT, TxnTExt,
   |             ^^^^^^^^^^^^^^
   |             |
   |             no `ChannelMutTxnT` in the root
   |             help: a similar name exists in the module: `ChannelTxnT`

error[E0599]: no method named `touch_channel` found for struct `GenericTxn<sanakirja::MutTxn<Arc<sanakirja::Env>, ()>>` in the current scope
   --> pijul/src/commands/record.rs:180:21
    |
180 |                 txn.touch_channel(&mut *channel.write()?, Some(oldest));
    |                     ^^^^^^^^^^^^^ method not found in `GenericTxn<sanakirja::MutTxn<Arc<sanakirja::Env>, ()>>`
    |
    = help: items from traits can only be used if the trait is in scope
    = note: the following trait is implemented but not in scope; perhaps add a `use` for it:
            `use libpijul::pristine::ChannelMutTxnT;`

error: aborting due to 2 previous errors

Some errors have detailed explanations: E0432, E0599.
For more information about an error, try `rustc --explain E0432`.
error: could not compile `pijul`