Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Use textconv with external diff commands #4136

Merged
merged 1 commit into from
Dec 14, 2024
Merged

feat: Use textconv with external diff commands #4136

merged 1 commit into from
Dec 14, 2024

Conversation

twpayne
Copy link
Owner

@twpayne twpayne commented Dec 11, 2024

Fixes #4134.

@twpayne twpayne force-pushed the fix-4134 branch 2 times, most recently from 2359e38 to 2fd6dc3 Compare December 11, 2024 22:12
@twpayne
Copy link
Owner Author

twpayne commented Dec 11, 2024

@franzudev this is now ready for testing. Would you be able to test this?

@franzudev
Copy link

thanks for the help, still work like before. Here's the chezmoi doctor output:

RESULT CHECK MESSAGE warning version dev, commit 3da4970, built at 2024-12-12T01:46:20Z warning latest-version v2.55.0 ok os-arch darwin/arm64 ok uname Darwin Mac.station 24.0.0 Darwin Kernel Version 24.0.0: Tue Sep 24 23:37:25 PDT 2024; root:xnu-11215.1.12~1/RELEASE_ARM64_T6030 arm64 ok go-version go1.23.3 (gc) ok executable ~/chezmoi/chezmoi ok upgrade-method replace-executable ok config-file ~/.config/chezmoi/chezmoi.toml, last modified 2024-12-10T18:10:57+01:00 ok source-dir ~/.local/share/chezmoi is a git working tree (clean) ok suspicious-entries no suspicious entries ok working-tree ~/.local/share/chezmoi is a git working tree (clean) ok dest-dir ~ is a directory ok umask 022 ok cd-command found /bin/zsh ok cd-args /bin/zsh ok diff-command found /opt/homebrew/bin/difft ok edit-command found /opt/homebrew/bin/hx ok edit-args /opt/homebrew/bin/hx ok git-command found /usr/bin/git, version 2.39.5 ok merge-command found /usr/bin/vimdiff ok shell-command found /bin/zsh ok shell-args /bin/zsh info age-command age not found in $PATH ok gpg-command found /opt/homebrew/bin/gpg, version 2.4.6 ok pinentry-command found /opt/homebrew/bin/pinentry-mac, version 1.1.1 info 1password-command op not found in $PATH ok bitwarden-command found ~/.local/bin/bw, version 2024.8.2 info bitwarden-secrets-command bws not found in $PATH info dashlane-command dcli not found in $PATH info doppler-command doppler not found in $PATH info gopass-command gopass not found in $PATH info keepassxc-command keepassxc-cli not found in $PATH info keepassxc-db not set info keeper-command keeper not found in $PATH info lastpass-command lpass not found in $PATH info pass-command pass not found in $PATH info passhole-command ph not found in $PATH info rbw-command rbw not found in $PATH info vault-command vault not found in $PATH info vlt-command vlt not found in $PATH info secret-command not set

Let me know if you need anything else.

@twpayne
Copy link
Owner Author

twpayne commented Dec 12, 2024

Please share at least your config file so that other can reproduce what you see.

@franzudev
Copy link

Please share at least your config file so that other can reproduce what you see.

here it goes:

encryption = "gpg"

[data]
    git_email = "user@gitserver.com"

[diff]
    command = "difft"

[edit]
    # https://github.com/twpayne/chezmoi/issues/3971#issuecomment-2393508601
    # workaround until the helix is capable of edit hardlinks
    hardlink = false

[git]
    autoCommit = true
    autoPush = true

[[textconv]]
    pattern = "**/*.plist"
    command = "plutil"
    args = ["-convert", "xml1", "-o", "-", "-"]

[gpg]
    recipient = "xxxxxxxxxxxxxxxx"
    args = ["--quiet"]
    
[pinentry]
    command = "pinentry-mac"

[scriptEnv]
    PYTHON_REQUIRED_VERSION = "3.12"
    VENV_NAME = "pyhome"

@franzudev
Copy link

After a couple of hours spent debugging, I've realized that maybe I've built it wrong or got confused with the system's one 😄

Apart from this the fix was perfect, thank you 🙏

./chezmoi diff
Library/Preferences/com.googlecode.iterm2.plist --- 1/3 --- XML
526         <integer>1</integer>                                                    526         <integer>1</integer>
527     </dict>                                                                     527     </dict>
528     <key>NSWindow Frame NSColorPanel</key>                                      528     <key>NSWindow Frame NSColorPanel</key>
529     <string>0 261 224 278 0 0 3360 1865 </string>                               529     <string>0 164 224 278 0 0 1920 1055 </string>
530     <key>NSWindow Frame NSNavPanelAutosaveName</key>                            530     <key>NSWindow Frame NSNavPanelAutosaveName</key>
531     <string>935 425 800 448 0 0 1920 1055 </string>                             531     <string>935 425 800 448 0 0 1920 1055 </string>
532     <key>NSWindow Frame SUStatusFrame</key>                                     532     <key>NSWindow Frame SUStatusFrame</key>

Library/Preferences/com.googlecode.iterm2.plist --- 2/3 --- XML
3007     </array>                                                                   3007     </array>
3008     <key>NoSyncBFPRecents</key>                                                3008     <key>NoSyncBFPRecents</key>
3009     <array>                                                                    3009     <array>
3010         <string>CommitMono Nerd Font Mono</string>                             3010         <string>CommitMono Nerd Font</string>
3011         <string>CommitMono Nerd Font</string>                                  3011         <string>FiraCode Nerd Font Mono</string>
3012         <string>MesloLGS NF</string>                                           3012         <string>MesloLGS NF</string>
3013     </array>                                                                   3013     </array>
3014     <key>NoSyncCommandHistoryHasEverBeenUsed</key>                             3014     <key>NoSyncCommandHistoryHasEverBeenUsed</key>

Library/Preferences/com.googlecode.iterm2.plist --- 3/3 --- XML
3023     <key>NoSyncFrame_SharedPreferences</key>                                   3023     <key>NoSyncFrame_SharedPreferences</key>
3024     <dict>                                                                     3024     <dict>
3025         <key>screenFrame</key>                                                 3025         <key>screenFrame</key>
3026         <string>{{0, 0}, {3360, 1890}}</string>                                3026         <string>{{0, 0}, {1920, 1080}}</string>
3027         <key>topLeft</key>                                                     3027         <key>topLeft</key>
3028         <string>{1448, 978}</string>                                           3028         <string>{862, 953}</string>
3029     </dict>                                                                    3029     </dict>
3030     <key>NoSyncHaveUsedCopyMode</key>                                          3030     <key>NoSyncHaveUsedCopyMode</key>
3031     <true/>                                                                    3031     <true/>

@twpayne twpayne marked this pull request as ready for review December 12, 2024 23:50
@twpayne twpayne merged commit 3558b71 into master Dec 14, 2024
30 checks passed
@twpayne twpayne deleted the fix-4134 branch December 14, 2024 06:39
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.

Binary diff doesn't work with textconv and custom diff command
2 participants