Pijul

Is having `replace` a sensible idea?

I think, some time ago, there was a discussion about whether Pijul should have an equivalent to darcs’s replace subcommand, which creates special patches for replacing tokens everywhere they occur. If I remember correctly, it was said that having such replacement patches would impose a performance penalty.

Has a replace subcommand been implemented meanwhile? If not, is it still planned to be implemented?

My personal recommendation would be to not implement it. I found the idea of patch types other than insertions and deletions interesting when reading about them years ago in the context of darcs. However, I never really found darcs replace useful, to the extend that I never ever used it. This was not least because changing a token is often accompanied by layout fixing and adding ordinary patches for fixing layout defeats the whole purpose of replacement patches.

Given that replace might not be very useful and additionally may spoil the performance of other commands, I guess it might be best to just not have it in Pijul. What do others think?

1 Like

Agree. A flat string replacement is almost never the correct approach to take when working with a codebase of any real-world size, and the additional complexity for both Pijul developers and users does not seem justified to me.

2 Likes

It seems to defeat the purpose of “version control”, but then maybe Pijul isn’t version control if it’s simply a way to store patches.
Someone mentioned being able to patch a patch, which replace sounds like.
I don’t have a mental model of what the purpose of such a thing is.