You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If a directory contains an external that's already been populated via apply, running add on the directory (the parent of the external, I mean) fails with:
chezmoi: /root/normal-dir/repro-submodule/.git: cannot add entry in external_ directory
(...or any file name in place of .git depending upon what's in there.)
To reproduce
create a submodule within Chezmoi's source directory, prefixed with external_
run chezmoi apply
run chezmoi add <target directory housing the submodule>
Expected behavior
No change in source state. Specifically, the existence of files underneath the "external" directory shouldn't be an error when operating on a parent directory recursively.
RESULT CHECK MESSAGEwarning version v2.47.1, built at 2024-03-11T12:05:48Z, built by Alpine Linuxok latest-version v2.47.1ok os-arch linux/amd64 (Alpine Linux)ok uname Linux runner-ns46nmmj-project-54387395-concurrent-0 5.4.109+ #1 SMP Wed Jun 16 20:00:10 PDT 2021 x86_64 Linuxok go-version go1.22.1 (gc)ok executable /usr/bin/chezmoiok upgrade-method upgrade-packageok config-file no config file foundok source-dir /builds/detly/chezmoi-externals-repro is a git working tree (clean)ok suspicious-entries no suspicious entriesok working-tree /builds/detly/chezmoi-externals-repro is a git working tree (clean)ok dest-dir ~ is a directoryok umask 022ok cd-command found /bin/shok cd-args /bin/shinfo diff-command not setok edit-command found /usr/bin/viok edit-args /usr/bin/viok git-command found /usr/bin/git, version 2.44.0warning merge-command vimdiff not found in $PATHok shell-command found /bin/shok shell-args /bin/shinfo age-command age not found in $PATHinfo gpg-command gpg not found in $PATHinfo pinentry-command not setinfo 1password-command op not found in $PATHinfo bitwarden-command bw not found in $PATHinfo bitwarden-secrets-command bws not found in $PATHinfo dashlane-command dcli not found in $PATHinfo doppler-command doppler not found in $PATHinfo gopass-command gopass not found in $PATHinfo keepassxc-command keepassxc-cli not found in $PATHinfo keepassxc-db not setinfo keeper-command keeper not found in $PATHinfo lastpass-command lpass not found in $PATHinfo pass-command pass not found in $PATHinfo passhole-command ph not found in $PATHinfo rbw-command rbw not found in $PATHinfo vault-command vault not found in $PATHinfo vlt-command vlt not found in $PATHinfo secret-command not set
Additional context
There's a git repo that reproduces the issue here, with a CI job showing the output. If this seems familiar it's because it's basically my report for #3525 but run against 2.47.1 in Alpine Edge.
I'll also mention that adding an ignore entry for the subdirectory (ie. the "external" directory but without the external_ prefix) does not help here. In fact, doing this perfectly reproduces the effects of the pre-#3525 behaviour.
(How good are externals, hey? You must love them.)
The text was updated successfully, but these errors were encountered:
Describe the bug
If a directory contains an external that's already been populated via
apply
, runningadd
on the directory (the parent of the external, I mean) fails with:(...or any file name in place of
.git
depending upon what's in there.)To reproduce
external_
chezmoi apply
chezmoi add <target directory housing the submodule>
Expected behavior
No change in source state. Specifically, the existence of files underneath the "external" directory shouldn't be an error when operating on a parent directory recursively.
Output of command with the
--verbose
flagOutput of
chezmoi doctor
Additional context
There's a git repo that reproduces the issue here, with a CI job showing the output. If this seems familiar it's because it's basically my report for #3525 but run against 2.47.1 in Alpine Edge.
I'll also mention that adding an ignore entry for the subdirectory (ie. the "external" directory but without the
external_
prefix) does not help here. In fact, doing this perfectly reproduces the effects of the pre-#3525 behaviour.(How good are externals, hey? You must love them.)
The text was updated successfully, but these errors were encountered: