From ddc02436eabd8afaa7c4e55d07dd183f5a9073aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Vig=C3=A9e?= Date: Wed, 1 Jul 2026 13:19:06 +0100 Subject: [PATCH 1/2] docs(codegen): show target attribution comment in gitignore example The heph-managed .gitignore block pairs each pattern with a `# //pkg:target` comment naming the emitting target, rendered on its own line above the pattern (hephbuild/heph#143). Update the example to match real output. --- website/docs/concepts/codegen.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/website/docs/concepts/codegen.md b/website/docs/concepts/codegen.md index 57c6aca..c0b4006 100644 --- a/website/docs/concepts/codegen.md +++ b/website/docs/concepts/codegen.md @@ -1,4 +1,3 @@ ---- sidebar_position: 3 title: Codegen description: How codegen targets write generated outputs back into your source tree, and when to copy vs. rewrite in place. @@ -99,14 +98,20 @@ heph tool gen-gitignore ``` scans the workspace for **every** `codegen = "copy"` output and writes them into -a managed block in the root `.gitignore`: +a managed block in the root `.gitignore`, pairing each pattern with a comment +naming the target that emits it: ```text title=".gitignore" # BEGIN heph-generated (managed by `heph tool gen-gitignore` — do not edit) +# //fmt:generated /fmt/generated.txt # END heph-generated ``` +The attribution comment always sits on its own line directly above the pattern +it names — never trailing on the same line — since git only treats a `#` as a +comment when it starts the line. + The command is: - **Scoped.** Only `copy` outputs are listed — `in_place` rewrites are tracked From e625baf8e14bf6c173c0913a7de135b6982b2abb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Vig=C3=A9e?= Date: Wed, 1 Jul 2026 13:20:01 +0100 Subject: [PATCH 2/2] fix: restore missing frontmatter delimiter dropped in previous commit --- website/docs/concepts/codegen.md | 1 + 1 file changed, 1 insertion(+) diff --git a/website/docs/concepts/codegen.md b/website/docs/concepts/codegen.md index c0b4006..b76204c 100644 --- a/website/docs/concepts/codegen.md +++ b/website/docs/concepts/codegen.md @@ -1,3 +1,4 @@ +--- sidebar_position: 3 title: Codegen description: How codegen targets write generated outputs back into your source tree, and when to copy vs. rewrite in place.