Skip to content

Commit 1a450c6

Browse files
jll63claude
andcommitted
doc: state the rule against committing build output
#103 merged 415 files of b2 output - 613 MiB expanded, 94 MiB in the pack, on a repository of about 3 MB - days after #108 added the `bin/` ignore rule intended to prevent it. The branch was cut before that rule landed, and an ignore rule does not apply to a path that is already tracked, so the merge carried them in. Nothing in the build or the review catches this, and #117 could only untrack them: the superproject pins this library by SHA and its bot bumps the pin within minutes of every merge, so rewriting `develop` orphans commits `boostorg/boost` already points at - and would not even remove the blobs, which stay reachable through `refs/pull/<n>/head`. Write the rule down where the workflow is: stage named paths, never `git add <dir>`, and ask before committing a build artefact or any file over 1MB. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent 9e07aaf commit 1a450c6

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

‎CLAUDE.md‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -673,6 +673,30 @@ For examples:
673673
4. For changes affecting examples: enable `BOOST_OPENMETHOD_BUILD_EXAMPLES`
674674
5. Submit PRs against the `develop` branch
675675

676+
### Never commit build output, and ask before committing anything large
677+
678+
Stage named paths. `git add <dir>` and `git add -A` are not used here: b2's object trees (`bin/`
679+
at the root and under `config/`, `test/`, `test/dynamic_loading/` and each
680+
`test/implicit_shared_libraries/` variant) and CMake's `build/` sit in the working tree, and one
681+
careless `git add test` commits them. **Ask before committing any build artefact, and before
682+
committing any file over 1MB**, whatever its kind.
683+
684+
`.gitignore` is not a safety net. It has no effect on a path that is already tracked, and a branch
685+
cut before an ignore rule landed does not carry it - which is how #103 merged 415 files of b2
686+
output, 613 MiB expanded and 94 MiB in the pack on a repository of about 3 MB, days after #108
687+
added the `bin/` rule meant to prevent exactly that.
688+
689+
On a Boost library the mistake is permanent, and rewriting `develop` is not a remedy:
690+
691+
- The superproject pins `libs/openmethod` by SHA, and its bot bumps that pin within minutes of
692+
every merge, so a rewrite orphans the commits `boostorg/boost` already points at -
693+
`git submodule update` then fails at those commits for good.
694+
- The blobs stay reachable through `refs/pull/<n>/head`, which a maintainer cannot delete, and
695+
forks share object storage. Removing them for real is a GitHub Support matter.
696+
697+
So the only cheap fix is `git rm -r --cached` (#117), which cleans the tree and leaves the objects
698+
in the pack forever. Not committing them is the whole defence.
699+
676700
### Posting in public on the maintainer's behalf
677701

678702
Anything published under the maintainer's account - a GitHub issue or comment, a PR body, a

0 commit comments

Comments
 (0)