pijul_org / pijul

#358 Ask before proceeding when unrecording a patch with dependencies

Opened by tae, on February 4, 2019
Good first bug
Closed
tae commented on February 4, 2019

Playing around I realized that if I unrecord a patch with dependencies the dependencies are unrecorded as well. That's expected but I think it something people won't have in mind while working so it would be nice if

  1. The log tells you if a patch has dependencies (maybe with a "Has dependencies" entry before the patch name) and
  2. Ask before unrecord a patch with dependencies (e.g. ", , ..., depend on this patch. Shall I unrecord it?"
coconut commented on February 4, 2019

I agree. Plus I believe if you are prompted to answer, there should also be a command-line option to assume yes to all prompts and run non-interactively.

tae commented on February 4, 2019

Thinking about it: hashes are not good in this case. Better to show a list of patches names IMHO

coconut commented on February 4, 2019

Oh yes, I was just thinking about that, too. It would not mean much to us. Alternatively, it could show both, perhaps the name and the first 8 characters of the hash.

pmeunier commented on February 27, 2019

Hi! Thanks for reporting this bug. This is not at all expected, and is really a bug. Can you make a small example?

iantownsend commented on March 24, 2019

I'm pretty sure tae means that this happens when you give unrecord a patch hash directly, instead of using the interactive interface. Here's how you can reproduce it:

$ pijul init
$ touch README.md
$ pijul record -n -a -m "Create README.md"
Recorded patch Az2CV3a1JJWznLobH3Eixi2nmsZZawGkHREu9sbRRPmptVTSF6qeHUKewGqpXjiN3xTZkCyonPPpNiv8yFBYzHCs
$ echo "content" > README.md
$ pijul record -n -a -m "Change README.md"
Recorded patch B5PpzDvV45j1hbFQfABkz596s8t6K2sDv2CEKdSQTYRs6Uw9cz4rjw9v9sLR9k2KTdBthSHByTJvPDTu2mbh6sFe
$ pijul unrecord Az2CV3a1JJWznLobH3Eixi2nmsZZawGkHREu9sbRRPmptVTSF6qeHUKewGqpXjiN3xTZkCyonPPpNiv8yFBYzHCs

The unrecord command proceeds without asking for confirmation.

pmeunier commented on March 26, 2019
pmeunier closed this discussion on March 26, 2019