Yes indeed. Not sure how to do that though. What happens if you introduce a file in change A
, and then edit it in B
, but then amend A
to say you never introduced the file in the first place?
By that you mean A
has added file asdf
, and B
has changed lines in file asdf
, and you --amend
A
to remove the added file
change? A very good question.
We should probably just disallow that (Dependent B modifies file introduced in A, but file is no longer introduced in A
) altogether. Another option would be to remove that change from B
(with a warning) but keep it on the user’s FS as an unrecorded change (e.g. shows up in pijul diff
).
As a user, I sometimes actually want to remove a file that was edited in (potentially many) dependent changes. Having to manually amend each dependent change before being able to remove the file would be unpleasant.
You’ve the patches A and B, and B depend on A because all of B’s hunks modifies one or more lines introduced in a subset of A’s hunks.
If you amend A and call the new patch A’, and none of B’s hunks depend on A’, Pijul should warn you when it begins to “replay”. It should when ask the user if the user wants
Note that I don’t know how Pijul’s data structure works, so there could be technical reasons why my suggestion doesn’t work in reality.
It would be nice if we could amend a change that has dependents and just replay the dependent changes on top of it.