BK-CSETPRUNE(1)
π 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 acsetprunesover time on the same key set and you want the resulting repository to be able to communicate with a repository created by an earliercsetpruneπ―ββοΈ (iykyk)βGgonefileβ this will prune out the gone file and put the contents of the file passed in withβGas 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 runcsetpruneon 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 tocsetprunemore than one repository such that the resulting repositories communicate viapush,pullorchanges. 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:
- 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).
- clone the repository twice, once for each of
docsandsrcπ― - 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βnewrootbkβlogbkβ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
- Copyright (c) 1998-2015 BitKeeper Inc
- Copyright (C) 1989, 1990, 1991, 1992, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms