Skip to content

allow verbose diff in rebase commit editor#2599

Closed
scallaway wants to merge 1 commit intojesseduffield:masterfrom
scallaway:rebase-commit-verbose
Closed

allow verbose diff in rebase commit editor#2599
scallaway wants to merge 1 commit intojesseduffield:masterfrom
scallaway:rebase-commit-verbose

Conversation

@scallaway
Copy link
Contributor

There currently exists a "verbose" flag in the config that a user can enable in order to show the diff when writing a commit message in the editor of their choice. However, I discovered that this isn't the case when you're rewording an existing commit through a rebase.

I find it's much easier to write meaningful commit messages during a rebase if the diff is right there in front of you, so this commit adds the ability for that verbose flag to affect the rebase commit editing as well.

I thought about adding another flag to the config, but figured that was a bit overkill since this is still to do with commit messages.


I've copied the verboseFlag() method from CommitCommands into LocalCommitsController as there was no relation between the two (and it's a very useful convenience method). This also means that it can be used in RebaseCommands due to their relationship.

@github-actions
Copy link
Contributor

github-actions bot commented May 4, 2023

Uffizzi Ephemeral Environment deployment-24340

☁️ https://app.uffizzi.com/github.com/jesseduffield/lazygit/pull/2599

📄 View Application Logs etc.

What is Uffizzi? Learn more!

There currently exists a "verbose" flag in the config that a user can
enable in order to show the diff when writing a commit message in the
editor of their choice. However, I discovered that this isn't the case
when you're rewording an existing commit through a rebase.

I find it's much easier to write meaningful commit messages during a
rebase if the diff is right there in front of you, so this commit adds
the ability for that verbose flag to affect the rebase commit editing as
well.

I thought about adding another flag to the config, but figured that was
a bit overkill since this is still to do with commit messages.

---

I've copied the `verboseFlag()` method from `CommitCommands` into
`LocalCommitsController` as there was no relation between the two (and
it's a very useful convenience method). This also means that it can be
used in `RebaseCommands` due to their relationship.
@scallaway scallaway force-pushed the rebase-commit-verbose branch from bab81c5 to 7fd664a Compare May 4, 2023 15:41
@stefanhaller
Copy link
Collaborator

Thanks for this. I wonder, though, if we should do the opposite and remove the existing "verbose" option for commit; users who want this can turn it on in git's config by saying git config --global commit.verbose true (that's what I do), and it will apply to both commit and reword.

@jesseduffield
Copy link
Owner

I agree: I think we should just remove the option and depend on the git config

@scallaway
Copy link
Contributor Author

Happy to do that in this PR, just need to find a spare few minutes to get it updated!

@scallaway
Copy link
Contributor Author

Going to close this PR and open one that better reflects the result of the discussion in this PR!

@scallaway scallaway closed this May 23, 2023
scallaway pushed a commit to scallaway/lazygit that referenced this pull request May 23, 2023
As discussed in jesseduffield#2599, it
makes more sense to have the user specify whether they want verbose
commits from their own git config, rather than lazygit config.

This means that we can remove all the code (including test coverage)
associated with the custom verbose flag, and lazygit will just inherit
the .gitconfig settings automatically.
stefanhaller pushed a commit to scallaway/lazygit that referenced this pull request Jul 14, 2023
As discussed in jesseduffield#2599, it
makes more sense to have the user specify whether they want verbose
commits from their own git config, rather than lazygit config.

This means that we can remove all the code (including test coverage)
associated with the custom verbose flag, and lazygit will just inherit
the .gitconfig settings automatically.
stefanhaller added a commit that referenced this pull request Jul 14, 2023
As discussed in #2599, it
makes more sense to have the user specify whether they want verbose
commits from their own git config, rather than lazygit config.

This means that we can remove all the code (including test coverage)
associated with the custom verbose flag, and lazygit will just inherit
the .gitconfig settings automatically.

---

Tested visually locally, as well as running the tests that all pass.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants