Skip to content

Commit

Permalink
Fix go generate on windows (#3706)
Browse files Browse the repository at this point in the history
Fix two problems with running `go generate ./...` on Windows:
- the command would error out with `panic: Default config starting
comment not found` (depending on the setup of the local git client)
- after running the command, all files would show up as modified in git,
but without a diff. Staging the files would make them disappear again,
except for those that actually had changes.

Fix both of these by configuring git to check out the generated text
files with Unix line endings.
  • Loading branch information
stefanhaller authored Jul 1, 2024
2 parents 6da4f9a + 71a62b7 commit f3c9443
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 11 deletions.
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*.go text
*.md text eol=lf
*.json text eol=lf
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ lazygit.exe

# Exceptions
!.gitignore
!.gitattributes
!.goreleaser.yml
!.golangci.yml
!.circleci/
Expand Down
22 changes: 11 additions & 11 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Documentation Overview

* [Configuration](./Config.md).
* [Custom Commands](./Custom_Command_Keybindings.md)
* [Custom Pagers](./Custom_Pagers.md)
* [Dev docs](./dev)
* [Keybindings](./keybindings)
* [Undo/Redo](./Undoing.md)
* [Range Select](./Range_Select.md)
* [Searching/Filtering](./Searching.md)
* [Stacked Branches](./Stacked_Branches.md)
# Documentation Overview

* [Configuration](./Config.md).
* [Custom Commands](./Custom_Command_Keybindings.md)
* [Custom Pagers](./Custom_Pagers.md)
* [Dev docs](./dev)
* [Keybindings](./keybindings)
* [Undo/Redo](./Undoing.md)
* [Range Select](./Range_Select.md)
* [Searching/Filtering](./Searching.md)
* [Stacked Branches](./Stacked_Branches.md)
1 change: 1 addition & 0 deletions vendor/github.com/kevinburke/ssh_config/.gitattributes

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f3c9443

Please sign in to comment.