BK-CSETPRUNE(1)

πŸ“¦ version 7.3.3, in alpine 3.24

πŸ’… bk csetprune(none) β€” bestie's guide to the BitKeeper User's Manual

okay so you're in the BitKeeper User's Manual and the page you want is bk csetprune πŸŽ€ yes, the one that shrinks a repository by removing files. it's giving spring cleaning but permanent. let's go ✨


🌸 NAME 🌸

bk csetprune β€” shrink a repository by removing files πŸ—‘οΈβœ¨


⭐ SYNOPSIS ⭐

bk csetprune [options] βˆ’ < keylist

that's it. that's the whole vibe. options on the left, keys piped in on the right, no cap πŸ’…


πŸ’œ DESCRIPTION πŸ’œ

okay so csetprune is the command you use to prune certain files from the repository. and bestie, listen β€” these files are removed in a way which is permanent, i.e., the prune cannot be undone. 😭 like, not "oops undo" reversible. not "git reset" reversible. gone gone. so maybe think about it first? 🫢

the command operates on a list of file keys (sometimes called BitKeeper inodes). every file associated with a key gets removed from the repository and from all changesets in the ChangeSet file. 🧚

and it gets spicy: if a changeset becomes empty as a result of the key removal, then that changeset is removed from the ChangeSet file history. if a removed changeset had a tag, the tag is moved to the closest non-removed ancestor in the ChangeSet file. and if that ancestor was already tagged with the same tag, the duplicate tag is discarded πŸ™ˆ (we love a tidy tag pile, ngl).

after all the files have been removed, the identity of the ChangeSet file is changed (using bk newroot) and the remaining files are "reparented" to the new ChangeSet file. iconic behavior honestly πŸ‘‘


✨ OPTIONS ✨

  • βˆ’k16hexDigits β€” specifies the 16hexDigits used in a repository root key. you need this when you're doing a csetprunes over time on the same key set and you want the resulting repository to be able to communicate with a repository created by an earlier csetprune πŸ‘―β€β™€οΈ (iykyk)
  • βˆ’Ggonefile β€” this will prune out the gone file and put the contents of the file passed in with βˆ’G as the initial content of a new gone file. if there are additional files and deltas missing, a delta to the new gone file will be automatically generated and committed πŸͺ„ slay
  • βˆ’S, βˆ’βˆ’standalone β€” just run csetprune on the current component. this has no effect in a traditional standalone repository, but in a nested collection it processes just the current component and not the entire nested collection 🧩
  • βˆ’βˆ’tagβˆ’csets β€” alter the symbol structure to remove duplicates and move the symbols directly onto the tagged cset. use this if you do not need to csetprune more than one repository such that the resulting repositories communicate via push, pull or changes. with this option, the internal symbol graph structure is streamlined πŸ’«

πŸ”‘ GENERATING KEYS πŸ”‘

the bk log command may be used to generate the list of keys πŸ“. but when you're generating keys, it is important to realize that looking in a particular subdirectory is likely to miss some of the files that you may want to remove 😱. the files may have been moved to another directory or they may have been removed (which is really just a move to the BitKeeper/deleted subdirectory). sneaky little things.

the following command will generate a list of keys for all files originally created in the junk subdirectory, including all deleted and/or moved files:

bk βˆ’A log βˆ’hr+ βˆ’nd:ROOTKEY: | grep '|junk/'

no cap, that pipe is doing so much work and it ate πŸ’…


🌈 EXAMPLE 🌈

suppose there's a repository which has two major subsections, called docs and src respectively. the repository has grown to be too large and the goal is to split it in two πŸͺ“. the process for doing so would be to:

  1. make sure all users have pushed their changes into the main repository. changes made after the split will have to be exported as a traditional patch and imported, which loses the checkin comments 😭 (yeah. that's the trade-off. tragic but true).
  2. clone the repository twice, once for each of docs and src πŸ‘―
  3. in each new repository, strip out the files which will be in the other repository βœ‚οΈ

commands which will do this:

bk clone master src
bk clone master docs
# Remove the docs files from the src repository
cd src
bk βˆ’A log βˆ’hr+ βˆ’nd:ROOTKEY: | grep '|docs/' | bk csetprune
# Remove the src files from the docs repository
cd ../docs
bk βˆ’A log βˆ’hr+ βˆ’nd:ROOTKEY: | grep '|src/' | bk csetprune

look at that symmetry. main character energy from start to finish πŸ‘‘βœ¨


πŸ¦‹ SEE ALSO πŸ¦‹

  • bk‐newroot
  • bk‐log
  • bk‐gfiles

go read those too, bestie, they're all part of the lore πŸ“šπŸ’–


πŸ“ CATEGORY πŸ“

Admin β€” yeah, you're in your admin era now πŸ’…


⚠️ reminder from your girl: the prune is permanent. the prune cannot be undone. i said it in DESCRIPTION and i'm saying it again because i care about you πŸ«ΆπŸ’€

and that's the page!! this one came from BitKeeper Inc, version 1E1, and it's bk csetprune(none) β€” go forth and shrink responsibly, bestie πŸŒΈπŸŽ€πŸ’œ

πŸ“¦ where this page comes from
  • alpine 3.24: bitkeeper-doc 7.3.3-r1 Β· Apache-2.0
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms