darcs

Patch 2222 rename addPendingDiffToPending to unsafe... (and 1 more)

Title rename addPendingDiffToPending to unsafe... (and 1 more)
Superseder Nosy List bfrk
Related Issues
Status accepted Assigned To
Milestone

Created on 2021-11-06.00:52:56 by bfrk, last changed 2023-06-24.00:38:03 by ganesh.

Files
File name Status Uploaded Type Edit Remove
patch-preview.txt bfrk, 2021-11-06.00:52:54 text/x-darcs-patch
rename-addpendingdifftopending-to-unsafeaddtopending.dpatch bfrk, 2021-11-06.00:52:54 application/x-darcs-patch
See mailing list archives for discussion on individual patches.
Messages
msg22925 (view) Author: bfrk Date: 2021-11-06.00:52:54
2 patches for repository http://darcs.net/screened:

patch 2831f357496865c76860dc9438f195dcb8b13fec
Author: Ben Franksen <ben.franksen@online.de>
Date:   Tue Mar  2 14:26:11 CET 2021
  * rename addPendingDiffToPending to unsafeAddToPending

patch 8237940978023934f829ef3d5d449007b867d55f
Author: Ben Franksen <ben.franksen@online.de>
Date:   Tue Mar  2 16:06:25 CET 2021
  * remove the unsafe tentativelyAddToPending, replace with addToPending

  The fact that this type checks witnesses the fact that indeed using
  tentativelyAddToPending was wrong: the patches we pass all start at the
  unrecorded state and thus should be commuted past the difference between
  pending and working before appending them to pending. This is what
  addToPending does which is why it is the safer choice here.
Attachments
msg23238 (view) Author: ganesh Date: 2023-04-01.07:50:01
Looks ok. Was there a user-visible bug here? For many things we put
in pending, we could reorder them without commuting and get away with
it, but not for renames. Given it was only used in rebase unsuspend,
rollback and revert I could imagine we might not have noticed before.
msg23244 (view) Author: bfrk Date: 2023-04-01.14:24:14
> Was there a user-visible bug here? For many things we put
> in pending, we could reorder them without commuting and get away with
> it, but not for renames.

We are talking about commuting changes we want to add to pending with 
unrecorded changes that are /not/ in pending (typically just hunks or 
file removes). While commuting a rename with a hunk can modify the 
latter, this is not problematic here, since we don't store the result as 
patches (unless we record them). Of course this is just hand-waving and 
not a proof. But it may help explain why failures (if they were actually 
possible) have been rare and perhaps obscure enough to slip by.

> Given it was only used in rebase unsuspend,
> rollback and revert I could imagine we might not have noticed before.

I agree that this is possible, though I never instestigated it. It would 
be yet another reason why handling the pending patch was always very 
defensive.
History
Date User Action Args
2021-11-06 00:52:56bfrkcreate
2021-11-06 00:53:17bfrksetstatus: needs-screening -> needs-review
2023-04-01 07:50:01ganeshsetstatus: needs-review -> accepted-pending-tests
messages: + msg23238
2023-04-01 14:24:15bfrksetmessages: + msg23244
2023-06-24 00:38:03ganeshsetstatus: accepted-pending-tests -> accepted