gitui icon indicating copy to clipboard operation
gitui copied to clipboard

fix external editor for cmd and bat on windows

Open pm100 opened this issue 2 years ago • 3 comments

fix for https://github.com/extrawurst/gitui/issues/1316

resubmitting after commit cleanup

the actual fix is

  • if execution fails on windows
  • attempt to rerun as cmd /c <cmd> <args> <file name>
  • if that fails then report error

verified with both vim (which is installed a bat file) from the original report and code (which is installed as a cmd file) which was mentioned in a further comment

It is arguable that rust's program exec function should do this itself. But is also arguable that it shouldnt. I will file an issue there

Then I added a bunch of tests. One is generic, the other test this specific fix. I could maybe add more later.

In order to make the tests work I need code from the test plumbing in the asyncgit sub crate. There are 2 choices to do that, given that code flagged as test on one sub crate is not available to other crates in the project.

  • duplicate the test infrastructure code
  • move it to a 'pseudo' feature for test only - see https://github.com/rust-lang/cargo/issues/8379

I chose the second.

Sadly this makes clippy and cargo check see that plumbing code (that is only compiled into tests) as part of the main project. They complain big time about that code. I fixed some complaints, I told clippy to ignore some, but the main (not real issue) is that they see duplicated packages. It is almost impossible to disentangle them. And its not possible to tell clippy and check to skip that fake feature. So i added a skip duplicates check (the same as the main project) and modified deny.toml

I followed the checklist:

  • [ x] I added unittests
  • [ x] I ran make check without errors
  • [ x] I tested the overall application
  • [ ] I added an appropriate item to the changelog

pm100 avatar May 04 '23 15:05 pm100

I have resolved this by getting everybody onto syn v1. Once all the dependencies move to v2 then gitui can move.

I also had to fix a new clippy failure due to a new rule added in 1.71

pm100 avatar Jun 22 '23 00:06 pm100

depends on #1781

extrawurst avatar Aug 26 '23 12:08 extrawurst

since #1781 is closed now, can we update this to current master and move it forward?

extrawurst avatar Feb 12 '24 19:02 extrawurst