Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Paste multiline commit message in reword is dangerous #4066

Open
koliyo opened this issue Nov 20, 2024 · 1 comment
Open

Paste multiline commit message in reword is dangerous #4066

koliyo opened this issue Nov 20, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@koliyo
Copy link

koliyo commented Nov 20, 2024

Describe the bug
I had a prewritten commit message that I wanted to update an existing commit. I launched lazygit and used the reword command, and assumed/hoped it would correctly handle a multiline paste and put the first line in the title, and the remaining lines in the description. Ie, so the result would be identical to if this multiline string was originally placed in the commit message.

Instead, lazygit used the first line as the commit title, and started interpreting the remaining lines as lazygit keyboard actions, which could potentially have very serious implications for the state of my local repository.

To Reproduce
Steps to reproduce the behavior:

  1. Copy a multiline commit message from any text buffer/editor.
  2. Open lazygit and select a commit and press 'r' for reword action
  3. Paste the string into the reword form

Expected behavior
First line in the message title
Remaining lines in the description

Screenshots
If applicable, add screenshots to help explain your problem.

Version info:

[14:03:49] ❯ lazygit --version
commit=, build date=, build source=homebrew, version=0.44.1, os=darwin, arch=arm64, git version=2.47.0
[14:03:55] ❯ git --version
git version 2.47.0

Additional context

Add any other context about the problem here.

Note: please try updating to the latest version or manually building the latest master to see if the issue still occurs.

@koliyo koliyo added the bug Something isn't working label Nov 20, 2024
@stefanhaller
Copy link
Collaborator

Duplicate of #3151, and there's some discussion there.

One workaround is the "Paste commit message from clipboard" command that is accessible from the ctrl-o menu. Of course you have to remember to use it instead of hitting Command-V, so it's not an ideal solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants