a-shell icon indicating copy to clipboard operation
a-shell copied to clipboard

Diff but no patch

Open alexeyignatiev opened this issue 2 years ago • 7 comments

Hi, @holzschu. I have just noticed that a-shell has a working diff command, which is great, but no patch command, which is not so great since the two usually go hand-in-hand. I am not sure if this is a reasonable request at this stage, but do you think it would be feasible to add it as well?

alexeyignatiev avatar Sep 27 '21 08:09 alexeyignatiev

If you're in a git repo, try lg2 apply to apply a patch.

Thanks. And if I'm not? :)

alexeyignatiev avatar Oct 12 '21 04:10 alexeyignatiev

I'm working on a native implementation of patch (but I still have a few bugs to remove in the current version before I add new things).

There is also a Python version of patch, which could solve some of your issues: https://pypi.org/project/patch/

holzschu avatar Oct 12 '21 05:10 holzschu

Thank you for the pointer!

alexeyignatiev avatar Oct 12 '21 05:10 alexeyignatiev

The next version should have native patch (BSD version). Do you have sample files I could use for testing?

holzschu avatar Apr 13 '22 14:04 holzschu

Hi, FYI, after a but of intensive testing with the native patch, I'm going to stop working on it for now.

  • the source of BSD patch that I could find has fewer features than Python patch
  • it is very difficult to make it robust and re-entrant
  • speed is not a critical feature for patch, robustness and re-entrance are.

I'm sorry it didn't work out.

holzschu avatar Apr 15 '22 09:04 holzschu

Hi @holzschu, thank you for the effort! It is a pity that it is hard to make it work and that it looks like not paying off. However, I do understand that it is troublesome. I will try to use the Python patch as you suggested. Hopefully, it behaves the same way.

alexeyignatiev avatar Apr 15 '22 10:04 alexeyignatiev