Closed WaterLemons2k closed 5 days ago
Looks good now, except for the discussion about the tests.
It would be good to squash all changes into a single commit (except for adding the tests, which should come in a separate commit if you insist on still adding them).
For your next PR, it would be nice to keep a good commit history in mind from the beginning, this makes things easier to review. Don't just pile changes on top; prefer using fixup commits (see here for some brief description). Thanks!
I added two integration tests, if you want to have a look at those.
Merging now. Thanks again for the contribution!
Whoops, the tests fail on CI (they succeeded for me locally). Pushed a fixup (3ecfe2d2dc7d) to see if that fixes it...
OK, that didn't help for some reason. It's also not a very desirable solution because it increases the time it takes to run a CI job.
The next idea would be to do what we did for copying in #2784: provide a user config to set a custom command for reading from the clipboard. That's probably desirable anyway for people who use lazygit over ssh. We could then use that to configure simple echo and cat commands for writing to and reading from a text file, like we did here.
@WaterLemons2k I'm out of time for today, not sure when I would get around to doing this, but if you feel like giving it a try, feel free!
@WaterLemons2k OK, I did find a bit of time to do this after all. Seems to work fine now, if you want to have a look.
LGTM, thanks for doing this. I saw this when I looked at CopyToClipboard
, but didn't do it.
Resolves #3672
Added an entry to the commit message menu called "Paste commit message from clipboard", which splits the clipboard into subject and description and pastes both into their respective fields.
Also found that the current
SplitCommitMessageAndDescription
function has a problem with lines ending in CRLF, fixed.There should be some more tests here, but I'm not sure where to start. I'll do my best if anyone can tell me.
Please check if the PR fulfills these requirements
[x] Cheatsheets are up-to-date (run
go generate ./...
)[x] Code has been formatted (see here)
[ ] Tests have been added/updated (see here for the integration test guide)
[x] Text is internationalised (see here)
[ ] Docs have been updated if necessary
[x] You've read through your own file changes for silly mistakes etc