forgit: diff preview not working on MacOS
Check list
- I have read through the README
- I have the latest version of forgit
- I have searched through the existing issues
Environment info
- OS
- Linux
- Mac OS X
- Windows
- Others:
- Shell
- bash
- zsh
- fish
Problem / Steps to reproduce
Hello,
I’ve recently ported my forgit configuration from a Linux machine to my MacOS laptop. I’ve noticed previews are not working for the gd command. For example, using the default configuration:
Other commands using the same pager, such as ga, seem to work as expected:
Did anyone else encounter the same issue?
Cheers
About this issue
- Original URL
- State: closed
- Created 4 months ago
- Comments: 16
Commits related to this issue
- Fix issue where diff preview was broken on mac (#365) Closes #362 — committed to wfxr/forgit by cjappl 4 months ago
From my limited testing, this seems to occur for every file on MacOS. I was unable to reproduce the issue on Linux as well.
Awesome! Thanks for filing this @giovannilupi and thank you both (@maelp) for testing and reporting back. We appreciate it.
Also works for me, thanks a lot @cjappl
working now, thanks!
@cjappl Thanks for the patch, can confirm this works on Linux too.
I think this should be a separate PR and I see two options here. We could either backport your fix to master now (which I guess should be rather easy, given that it isn’t a big change) and I apply the patch to #326 once I rebase on master or we create a new PR once #326 is merged. I think I would prefer the first option. WDYT?
Pretty close I think. All the big changes have been reviewed and we should be able to push through the rest quickly. Btw. could you review #361, then I can follow up with the next PR shortly.
Awesome, glad to hear 🙂
@cjappl I can not reproduce this on Linux on the current master branch. Does this happen with every preview for
gdor just specific files? I think this would be worth fixing this now, as we’d need a similar fix for #326 anyway. My guess would be that we’re using something that GNU sed supports, but the one on macOS does not. Since I don’t have any device running macOS, I guess you’d have to go after this. Doing the fix in #326 is probably easier, since you don’t have to worry about all the issues around escaping characters. For #354 I’ve done the work in #326 first and then backported it to the current master. You’d have to modify the sed commands in_forgit_get_files_from_diff_lineand_forgit_get_single_file_from_diff_line. I found this an easier workflow then working in the current master branch directly. I’m attaching a patch to apply #354 to #326 in case you want to go that route.354.txt