pijul_org / pijul

#229 pijul checkout: stuck with error: There are pending changes in the repository.

Opened by boxofrox, on November 21, 2017
Closed
boxofrox commented on November 21, 2017

Normally, I use git in a linux shell daily. I'm new to pijul, and I'm stuck on\r + this error. Below is roughly the steps I took before the error occurred.\r + \r + I expect pijul status or pijul diff to show me these "pending changes" or I\r + expect pijul checkout master to checkout the master branch. Instead one set\r + of commands tells me there are no changes while the other says there are.\r + \r + I've tried running pijul revert and pijul revert -a to no effect.\r + \r + Am I running the wrong command, or missing a flag?\r + \r +

$ pijul clone https://nest.pijul.org/pmeunier/nix-rust\r                                                              +
$ cd nix-rust\r                                                                                                       +
$ # edit files.  this example just edits Cargo.toml\r                                                                 +
$ pijul fork feature/test\r                                                                                           +
$ pijul log\r                                                                                                         +
Hash: 6TiMBz7VVubPHy7v8rf8dgikrj4nRzKsZtJWR9jYuV4CTKHPsnS3U8UPci4PatdYHoo54dy6Qgr5XjWjegjjhu7V\r                      +
Internal id: 3s6czQnurS7\r                                                                                            +
Authors: [-snip-]\r                                                                                                   +
Timestamp: 2017-11-20 14:17:28.772214158 UTC\r                                                                        +
\r                                                                                                                    +
    Add CARGO_PKG_VERSION_*\r                                                                                         +
\r                                                                                                                    +
...\r                                                                                                                 +
$ pijul branches\r                                                                                                    +
* feature/authors\r                                                                                                   +
  master\r                                                                                                            +
$ pijul record -m "test test"\r                                                                                       +
In file "/home/boxofrox/files/development/rust/crates/carnix/carnix/Cargo.toml"\r                                     +
\r                                                                                                                    +
- description = "Generate Nix expressions from Cargo.lock files (in order to use Nix as a build system for crates)."\r+
+ description = "Test test"\r                                                                                         +
\r                                                                                                                    +
Shall I record this change? (1/1) [ynkad] y\r                                                                         +
\r                                                                                                                    +
Recorded patch A9sBHSpJDpPqEmNHoHd6ytjG2dB7eUegbCnuy556xWmrHfLQhTgSw4U5wCmW7ccCDDVyHsAsGv9M8yNEv3UKpdZC\r             +
$ pijul log\r                                                                                                         +
Hash: A9sBHSpJDpPqEmNHoHd6ytjG2dB7eUegbCnuy556xWmrHfLQhTgSw4U5wCmW7ccCDDVyHsAsGv9M8yNEv3UKpdZC\r                      +
Internal id: akhBNQLhSWZ\r                                                                                            +
Authors: [-snip-]\r                                                                                                   +
Timestamp: 2017-11-21 02:08:57.667151363 UTC\r                                                                        +
\r                                                                                                                    +
    test test\r                                                                                                       +
\r                                                                                                                    +
...\r                                                                                                                 +
$ pijul checkout master\r                                                                                             +
error: There are pending changes in the repository. You need to revert or record them if you want to continue.\r      +
$ pijul diff\r                                                                                                        +
$ pijul status\r                                                                                                      +
\r                                                                                                                    +
Untracked files:\r                                                                                                    +
  (use "pijul add <file>..." to track them)\r                                                                         +
\r                                                                                                                    +
        target\r                                                                                                      +
        target/debug\r                                                                                                +
        target/debug/carnix.d\r                                                                                       +
        target/debug/native\r                                                                                         +
        target/debug/deps\r                                                                                           +
        ...\r                                                                                                         +
$ cargo clean\r                                                                                                       +
$ pijul status\r                                                                                                      +
Nothing to record, working tree clean\r                                                                               +
$ pijul checkout master\r                                                                                             +
error: There are pending changes in the repository. You need to revert or record them if you want to continue.\r      +
$ pijul diff\r                                                                                                        +
$ pijul log\r                                                                                                         +
Hash: A9sBHSpJDpPqEmNHoHd6ytjG2dB7eUegbCnuy556xWmrHfLQhTgSw4U5wCmW7ccCDDVyHsAsGv9M8yNEv3UKpdZC\r                      +
Internal id: akhBNQLhSWZ\r                                                                                            +
Authors: [-snip-]\r                                                                                                   +
Timestamp: 2017-11-21 02:08:57.667151363 UTC\r                                                                        +
\r                                                                                                                    +
    test test\r                                                                                                       +
\r                                                                                                                    +
...\r                                                                                                                 +
$ pijul status\r                                                                                                      +
Nothing to record, working tree clean\r                                                                               +
$ pijul revert\r                                                                                                      +
$ pijul checkout master\r                                                                                             +
error: There are pending changes in the repository. You need to revert or record them if you want to continue.\r      +
$ pijul revert -a\r                                                                                                   +
$ pijul checkout master\r                                                                                             +
error: There are pending changes in the repository. You need to revert or record them if you want to continue.\r      +
boxofrox commented on November 21, 2017

Nevermind. Looks like I ran into #225.

boxofrox commented on November 21, 2017

Tested patch in master branch and fix confirmed.

lthms commented on November 21, 2017

Glad to see my patch fixes your issue! Thanks for trying pijul and reporting your observations. If you need anything, feel free to ask on #pijul on freenode (I try my best to answer questions there when I can) or to report another issue there.

pmeunier commented on November 21, 2017

@boxofrox: branches are a gadget in Pijul, you don't really need them. Git uses branches to separate patches, which Pijul already does by default: if you have independent patches on the same branch, you can always push one of them and not the other.\r+ \r + Similarly, when you pull, you get to choose which patches you want, which Git would do using dirty rebases and cherry-picks.

lthms commented on November 21, 2017

> branches are a gadget in Pijul, you don't really need them\r + \r + I won’t be that affirmative myself. I can see some use case where branches are a great addition (for instance, if you support more than one version of your software and need to have specific patches for each versions) and they are a reason to use pijul instead of darcs!

boxofrox commented on November 22, 2017

Branches may be a gadget, but I have a hard time remembering which patches are related when they're mixed all mixed together. I rely on branches to group related patches until I no longer care when they're mixed.\r + \r + > ...when you pull, you get to choose which patches you want...\r + \r + I tried earlier to pull the "Add CARGO_PKG_VERSION_*" patch [1] for pmeunier/nix-rust, but when I declined to pull an earlier patch for "Carnix 0.4.2", pijul quit without asking about subsequent patches.\r + \r + This behavior suggests that picking patches is more complicated than simply stated. I can pick which patches I want, but only when pijul decides that I can, however, it's not obvious to me how pijul decides this. Instead I rely on trial and error. Try to decline the patch I don't care about. If declining keeps me from the patch I do want, then try again and accept. Repeat ad nauseum or just pull all the patches to avoid the frustration.\r+ \r + There is also an inconvenience with choosing which patches I want during a pull, and that is repetition. Every time I pull, I will be asked to decline each patch I declined once already. The all-or-nothing approach of git's branches may seem inflexible, but I have options:\r + \r +

  • I can construct a separate branch by cherry-picking those commits I want, and not be bothered again about the commits I left behind. Should the original branch grow with commits I'm interested in, I can cherry-pick only those new commits.\r +
  • I can fork the branch and git revert the commits I don't want. New commits on the original branch can be rebased or cherry-picked with fewer problems than in the first option, I imagine.\r + \r + Thanks for the info.\r + \r + [1]: https://nest.pijul.com/pmeunier/nix-rust/patches
d3xter commented on December 18, 2017

Another interesting use-case for branches are "workspaces".\r + \r + Github and others have adopted the workflow of Fork -> Commit Changes -> send PR.\r + \r + So you end up with 2 repositories for the same project (+ Issues, Wiki, Git-Remotes).\r + It seems like pijul-nest does the same thing (patches reside at "[user-name]/pijul/patches/").\r + \r + It would be nice for users to be able to create a workspace/branch inside the original project (maybe use a namespace like "workspace/[user-name]/[workspace-name]" so they don't clutter up the branch-list) and collaborate with other people to create a new feature/bug-fix/etc.

pmeunier commented on December 18, 2017

@d3xter: we might have read the same article (https://gregoryszorc.com/blog/2017/12/11/high-level-problems-with-git-and-how-to-fix-them/), haven't we?\r + \r + When you "fork" a repository on this website, the Nest creates a branch in original repository, and the only way to collaborate with other branches is to attach patches to their discussions. The main reason why it is currently called "fork" is that anyone wanting to inspect a patch can see it in the context intended by the author, which might sometimes matter.\r+ \r + This means that our system is already implementing something along these lines, the main missing features being:\r + \r +

  • the ability to see discussions as branches.\r +
  • the ability to push patches directly to discussions.\r +
  • the ability to get patches from other branches without attaching them to discussions.\r + \r + The first two of these features are obviously related, and the development team behind the Nest tells me this is coming really soon, and will probably come in addition to the current "fork" system (which might be renamed).\r +
d3xter commented on December 20, 2017

@pmeunier Indeed :D