Skip to content

Prevent auto-wrapping for commit trailers #4900

@pbstrein

Description

@pbstrein

Is your feature request related to a problem? Please describe.

Lazygit automatically wraps all lines, include trailers with long URLs. This makes the formatting of trailers unintuitive.

We use git trailers in our commit messages. One common type of trailer is a link to relevant resources to keep the commit message smaller, but still allow linking to other resources in the context of a commit.

Describe the solution you'd like

To not automatically wrap git trailers.

Describe alternatives you've considered

A current workaround is to edit it in an external editor. This gets around the issue, but anytime I open up a commit in lazygit it auto-wrap, requiring me to re-open the editor to fix the trailers.

Another option is to add a command to add / edit trailers separately from the commit message. For example, open a commit -> -> Edit Trailers.

Additional context

I get the same behavior in vim when I use GW to wrap the trailer, so issue may be a larger issue in general, I just get it more acutely with lazygit because it automatically formats everything.

Example (desired solution):

Example message that doesn't automatically wrap trailers

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod                                                                                                                     tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim                                                                                                                        veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea
commodo consequat. Duis aute irure dolor in reprehenderit in voluptate
velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint
occaecat cupidatat non proident, sunt in culpa qui officia deserunt
mollit anim id est laborum. [1] [2]

[1]: https://www.example.com
[2]: https://www.example.com/this-is-a-really-long-url-that-lazy-git-automatically-wraps-and-is-an-issue 

Current behavior

Example message that automatically wraps trailers

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod                                                                                                                     tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim                                                                                                                        veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea
commodo consequat. Duis aute irure dolor in reprehenderit in voluptate
velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint
occaecat cupidatat non proident, sunt in culpa qui officia deserunt
mollit anim id est laborum. [1] [2]

[1]: https://www.example.com
[2]: 
https://www.example.com/this-is-a-really-long-url-that-lazy-git-automatically-wraps-and-is-an-issue 

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions