Skip to content

Conversation

@kyu08
Copy link
Owner

@kyu08 kyu08 commented Sep 22, 2025

Important

After merging jesseduffield#4844, base branch should be changed to jesseduffield/lazygit:master.

Overview

I have added 4 changes due to updating gofumpt to remove git ls-files workaround.

Please take a look at each commit messages for details.

Please check if the PR fulfills these requirements

  • Cheatsheets are up-to-date (run go generate ./...)
  • Code has been formatted (see here)
  • Tests have been added/updated (see here for the integration test guide)
  • Text is internationalised (see here)
  • If a new UserConfig entry was added, make sure it can be hot-reloaded (see here)
  • Docs have been updated if necessary
  • You've read through your own file changes for silly mistakes etc

@kyu08 kyu08 force-pushed the update-gofumpt-workaround branch 8 times, most recently from ff33279 to a1fa700 Compare September 22, 2025 14:50
@kyu08 kyu08 force-pushed the update-gofumpt-workaround branch from a1fa700 to b31c53a Compare October 5, 2025 08:54
@kyu08 kyu08 changed the base branch from bump-go-1.25 to master October 5, 2025 08:55
@kyu08 kyu08 force-pushed the update-gofumpt-workaround branch from b31c53a to 3665734 Compare October 10, 2025 13:29
kyu08 and others added 2 commits October 19, 2025 22:12
…eduffield#4974)

I found that PR status becomes green even if no label added when we use
`Update branch` on GitHub PR page.

So I added `synchronize` event to the hooks of `Check Required Labels`.
@kyu08 kyu08 force-pushed the update-gofumpt-workaround branch from 3665734 to 5412792 Compare October 19, 2025 15:32
@stefanhaller stefanhaller force-pushed the update-gofumpt-workaround branch from 5412792 to abae2e0 Compare October 19, 2025 17:37
stefanhaller and others added 9 commits October 19, 2025 21:24
- Squash and FastForwardOnly are mutually exclusive, and instead of asserting
  this at runtime, model the API so that they can't be passed together.
- FastForwardOnly is unused, so remove it; however, we are going to need --ff
  and --no-ff in the next commit, so add those instead.
- Instead of putting the enum into the MergeOpts struct, replace the struct by
  the enum. We can reintroduce the struct when we add more arguments, but for
  now it's an unnecessary indirection.
This will put whatever git's default merge variant is as the first menu item,
and add a second item which is the opposite (no-ff if the default is ff, and
vice versa).

If users prefer to always have the same option first no matter whether it's
applicable, they can make ff always appear first by setting git's "merge.ff"
config to "true" or "only", or by setting lazygit's "git.merging.args" config to
"--ff" or "--ff-only"; if they want no-ff to appear first, they can do that by
setting git's "merge.ff" config to "false", or by setting lazygit's
"git.merging.args" config to "--no-ff". Which of these they choose depends on
whether they want the config to also apply to other git clients including the
cli, or only to lazygit.
This will put whatever git's default merge variant is as the first menu
item, and add a second item which is the opposite (no-ff if the default
is ff, and vice versa). Which one is the default depends on whether a
fast-forward merge is possible, and whether users have set git's
`merge.ff` config or lazygit's `git.merging.args` config.

If users prefer to always have the same option first no matter whether
it's applicable, they can make ff always appear first by setting git's
`merge.ff` config to "true" or "only", or by setting lazygit's
`git.merging.args` config to "--ff" or "--ff-only"; if they want no-ff
to appear first, they can do that by setting git's `merge.ff` config to
"false", or by setting lazygit's `git.merging.args` config to "--no-ff".
Which of these they choose depends on whether they want the config to
also apply to other git clients including the cli, or only to lazygit.

Closes jesseduffield#4091.
This can be used by go tools such as gofumpt.
When a new enough gofumpt version is used (v0.9.0 or later), it suports the
`ignore` directive that we just added, so the workaround is no longer needed.

Co-authored-by: Stefan Haller <[email protected]>
When replacing the naked return with a `return result`, the linter starts to
complain about "return copies lock value: sync/atomic.Int32 contains
sync/atomic.noCopy". I suspect this is also a problem when using a naked return,
and the linter just doesn't catch it in that case. Either way, it's better to
use a pointer to ensure that the atomic is not copied.

Co-authored-by: Stefan Haller <[email protected]>
After [v0.9.0](https://github.com/mvdan/gofumpt/releases/tag/v0.9.0),
gofumpt prohibits "naked return" for the sake of clarity. This makes
more readable when "named return value" is used.
For more infomation for "prohibition of naked return":
mvdan/gofumpt#285.
@stefanhaller stefanhaller force-pushed the update-gofumpt-workaround branch from abae2e0 to 64bcc72 Compare October 20, 2025 05:57
@kyu08 kyu08 closed this Oct 21, 2025
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.

2 participants