From 3af9ae43b87bdd4e50bcae5c87a2c5e56c8d8cea Mon Sep 17 00:00:00 2001 From: Austin Ziegler Date: Mon, 28 Aug 2023 20:34:11 -0400 Subject: [PATCH] docs: Minor expansion of application order docs The discussion in #3198 suggests some confusion about the order of application. This adds a little more context. --- .../chezmoi.io/docs/reference/application-order.md | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/assets/chezmoi.io/docs/reference/application-order.md b/assets/chezmoi.io/docs/reference/application-order.md index 87b5778321f..555f0dff531 100644 --- a/assets/chezmoi.io/docs/reference/application-order.md +++ b/assets/chezmoi.io/docs/reference/application-order.md @@ -6,8 +6,10 @@ chezmoi is deterministic in its order of application. The order is: 2. Read the destination state. 3. Compute the target state. 4. Run `run_before_` scripts in alphabetical order. -5. Update entries in the target state (files, directories, scripts, symlinks, - etc.) in alphabetical order of their target name. +5. Update entries in the target state (files, directories, externals, scripts, + symlinks, etc.) in alphabetical order of their target name. Directories + (including those created by externals) are updated before the files they + contain. 6. Run `run_after_` scripts in alphabetical order. Target names are considered after all attributes are stripped. @@ -26,3 +28,9 @@ chezmoi's behavior when the above assumptions are violated is undefined. For example, using a `run_before_` script to update files in the source or destination states violates the assumption that the source and destination states do not change while chezmoi is running. + +!!! note + + External sources are updated during the update phase; it is inadvisable for + a `run_before_` script to depend on an external applied *during* the update + phase. `run_after_` scripts may freely depend on externals.