Skip to content

Commit b8bdca3

Browse files
committed
lockfile-v8.cc: Clarify comment terminology
Say "takes precedence over" instead of "shadows", and refer to the entries in the recursive `locks` attribute as "nested" entries rather than "inline" ones. Assisted-by: Claude Fable 5 <noreply@anthropic.com>
1 parent 0dc4ec4 commit b8bdca3

1 file changed

Lines changed: 12 additions & 11 deletions

File tree

src/libflake/lockfile-v8.cc

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -207,9 +207,10 @@ struct LockFileV8
207207

208208
/**
209209
* Flatten this lock file into a map from absolute input attribute
210-
* paths to lock entries. Inline locks appear under the path of
211-
* their containing entry. A colliding top-level (override) entry
212-
* shadows an inline entry, matching the precedence of overrides
210+
* paths to lock entries. Entries in the nested `locks` of an
211+
* entry appear under the path of that entry. If a top-level
212+
* (override) entry denotes the same path as a nested entry, the
213+
* former takes precedence, matching the precedence of overrides
213214
* at evaluation time.
214215
*/
215216
void
@@ -220,10 +221,10 @@ struct LockFileV8
220221
absPath.insert(absPath.end(), path.get().begin(), path.get().end());
221222
if (lock.locks)
222223
lock.locks->getAllLockEntries(res, absPath);
223-
/* Note: this shadows any colliding inline entry, since
224-
the entry for the containing input sorts before the
225-
override path and thus has been recursed into
226-
already. */
224+
/* Note: this takes precedence over any nested entry for
225+
the same path, since the entry for the containing input
226+
sorts before the override path and thus has been
227+
recursed into already. */
227228
res.insert_or_assign(std::move(absPath), lock.lockedRef);
228229
}
229230
}
@@ -444,10 +445,10 @@ LockFlakeResult lockFlakeV8(
444445

445446
/* If so, and this input's transitive inputs are
446447
locked here (because it has no lock file of its
447-
own), refetch it and recompute its inline
448-
locks. Otherwise the update path doesn't match
449-
anything we can update, and the caller will
450-
warn about it. */
448+
own), refetch it and recompute its nested
449+
`locks`. Otherwise the update path doesn't
450+
match anything we can update, and the caller
451+
will warn about it. */
451452
if (!mustRefetch || !oldLock->locks) {
452453
debug("keeping existing input '%s'", absPathS);
453454
return oldLock->clone();

0 commit comments

Comments
 (0)