Skip to content

Paste multiline commit message in reword is dangerous #4066

@koliyo

Description

@koliyo

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions