twpayne
Repos
121
Followers
2380
Following
71

Manage your dotfiles across multiple diverse machines, securely.

8024
375

Package geom implements efficient geometry types for geospatial applications.

641
86

Package kml provides convenience methods for creating and writing KML documents.

66
12

Generate Go structs from multiple JSON objects.

80
11

Package polyline implements a Google Maps Encoding Polyline encoder and decoder.

79
16

My dotfiles, managed with https://chezmoi.io.

156
14

Events

pull request opened
Miscellaneous fixes

Work in progress, still have a few bugs to fix.

Created at 13 hours ago
create branch
twpayne create branch next
Created at 13 hours ago
create tag
twpayne create tag v1.4.4
Created at 14 hours ago
delete branch
twpayne delete branch infrastructure-updates
Created at 14 hours ago
Go version uses unnecessarily slow sort

Let me know if you'd like a PR to fix the Go code, otherwise I'll assume that you don't want to fix this and I'll close this issue.

Created at 15 hours ago
closed issue
`chezmoi add` to allow trivial template updates via patching the diff

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

When editing the config file managed by a template file, usually the changes can be trivially applied to the source state. That is, when I make the following (trivial) changes to my config file .config/zathura/zathurarc, and then run chezmoi add, I am prompted that the source state is a templated file and chezmoi add would remove the template attribute. However, because the change is trivial, I would hope that this change can just be made on the source state as well.

diff --git a/.config/zathura/zathurarc b/.config/zathura/zathurarc
index d443a10fb0dcbdc2b836ed6d3e47030851a361b1..c266b81f7eb685736130f8689f16e6dfe6bc4342 100644
--- a/.config/zathura/zathurarc
+++ b/.config/zathura/zathurarc
@@ -4,6 +4,6 @@ set recolor-lightcolor "#000000"
 set recolor-keephue

 map <C-i> set recolor
-map <f8> set recolor
+map <F8> set recolor

 set first-page-column "1:1"

Describe the solution you'd like

Implement chezmoi add such that, or add a flag like --patch where, trivial changes to templated config files can be applied into the corresponding files in the source state.

If patching fails, I see two possible solutions: (1) ensure the source state is unchanged, and let the user determine how to update the source state; (2) if patch is used as mentioned below, keep the patched file and a reject file in the source state (or a temporary directory), and inform the user of these two files and allow the user to then update the source state manually.

Describe alternatives you've considered

On Unix contexts where patch is available, one could already do:

$ file=.config/zathura/zathurarc
$ chezmoi diff --reverse "$file" | patch "$(chezmoi source-path "$file")"

Additional context

None.

Created at 15 hours ago
issue comment
`chezmoi add` to allow trivial template updates via patching the diff

Thanks for the discussion here. It is provably impossible to implement any such algorithm correctly.

For example, consider the diff

 alpha
+beta
 gamma

and the template

{{ if output "halts" "some-program" -}}
alpha
gamma
{{ else -}}
alpha
gamma
{{ end -}}

where the program halts is a program that returns a non-empty output if some-program always eventually terminates.

Adding beta to the correct place in the template requires halts to return the correct result for some-program, which it provably cannot.

Of course, some heuristics are possible, but these would likely take significantly more human time to implement than they would save

Created at 15 hours ago
Created at 15 hours ago
delete branch
twpayne delete branch update-deps
Created at 15 hours ago

Update dependencies

Merge pull request #222 from twpayne/update-deps

Update dependencies

Created at 15 hours ago
pull request closed
Update dependencies
Created at 15 hours ago
pull request opened
Update dependencies
Created at 15 hours ago
create branch
twpayne create branch update-deps
Created at 15 hours ago
delete branch
twpayne delete branch fix-valid-polygon-test
Created at 15 hours ago

Don't consider coordinates beyond Z when testing for polygon closure

Merge pull request #221 from twpayne/fix-valid-polygon-test

Don't consider coordinates beyond Z when testing for polygon closure

Created at 15 hours ago
pull request closed
Don't consider coordinates beyond Z when testing for polygon closure

From PostGIS:

postgis=# SELECT ST_IsClosed('POLYGON ZM ((0 0 0 0, 1 0 -1 1, 1 1 -2 2, 0 0 0 3))'::geometry);
 st_isclosed
-------------
 t
(1 row)

Note that the polygon is considered closed, even though the M coordinates of the first and last points differ.

Created at 15 hours ago
pull request opened
Don't consider coordinates beyond Z when testing for polygon closure

From PostGIS:

postgis=# SELECT ST_IsClosed('POLYGON ZM ((0 0 0 0, 1 0 -1 1, 1 1 -2 2, 0 0 0 3))'::geometry);
 st_isclosed
-------------
 t
(1 row)

Note that the polygon is considered closed, even though the M coordinates of the first and last points differ.

Created at 15 hours ago
create branch
twpayne create branch fix-valid-polygon-test
Created at 15 hours ago

Refresh GitHub Action

Enable circle test on arm64

Update dependencies

Merge pull request #23 from twpayne/infrastructure-updates

Update infrastructure

Created at 16 hours ago
pull request closed
Update infrastructure
Created at 16 hours ago

Refresh GitHub Action

Enable circle test on arm64

Update dependencies

Created at 16 hours ago

Refresh GitHub Action

Enable circle test on arm64

Update dependencies

Created at 16 hours ago

Refresh GitHub Action

Enable circle test on arm64

Update dependencies

Created at 16 hours ago

Update dependencies

Created at 16 hours ago
pull request opened
Update infrastructure
Created at 16 hours ago
create branch
twpayne create branch infrastructure-updates
Created at 16 hours ago

chore(deps): bump reviewdog/action-misspell from 1.12.2 to 1.12.3

Bumps reviewdog/action-misspell from 1.12.2 to 1.12.3.


updated-dependencies:

  • dependency-name: reviewdog/action-misspell dependency-type: direct:production update-type: version-update:semver-patch ...

Signed-off-by: dependabot[bot] support@github.com

Created at 18 hours ago
delete branch
twpayne delete branch dependabot/github_actions/reviewdog/action-misspell-1.12.3
Created at 18 hours ago
pull request closed
chore(deps): bump reviewdog/action-misspell from 1.12.2 to 1.12.3

Bumps reviewdog/action-misspell from 1.12.2 to 1.12.3.

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Created at 18 hours ago
delete branch
twpayne delete branch dependabot/github_actions/golangci/golangci-lint-action-3.3.1
Created at 1 day ago