BK-COLLAPSE(1)
π BK COLLAPSE β the BitKeeper User's Manual, bestie edition π
okay so this is a page from the BitKeeper User's Manual (bk collapse(none)) and it's genuinely such a useful little guy. sit down, grab a strawberry drink π, and let's get into it.
β¨ NAME β¨
bk collapse β combine recent changesets into a single unit of work π«Ά
πΈ SYNOPSIS πΈ
bk collapse [-lqS] -e [-arev] [-@[url]]
π¦ DESCRIPTION π¦
So bk collapse lets you combine (collapse, hence the name, iykyk) the most recent successive changesets made in a repository. iconic behavior honestly.
You typically use this when you're finishing up a developβreviewβtestβdebugβfix cycle π β you take one changeset plus all its bugβfix changesets plus all its reviewβgenerated changesets and smush them into a single logical unit of work. In this usage you specify a revision with -a, which is you saying "collapse everything since that revision, please and thank you."
Note: currently the-eoption is required β like, mandatory mandatory. The modifications introduced by the changesets being collapsed get applied to the affected files, and those files are left as locked, modified files in the repository. You must subsequently usebk citoolorbk delta/committo commit these edits as a single changeset. no skipping steps bestie π
bk collapse preserves all checkin comments for individual files and for the collapsed changesets β so nothing gets lost, we love that for us. Then bk citool uses these saved checkin comments to populate the comments fields for all affected files and the ChangeSet file. slay β¨
You can also use bk collapse without the -a option immediately after a checkin, if you realize the change was not done or was incorrect π. You can do this "uncommit" on the most recent changeset only if you are positive that there are no other copies of this changeset in other repositories. like, be sure sure. fr fr.
The checkin comments are preserved if you use bk citool to make the subsequent checkin. π«Ά
The -l option to bk collapse saves a list of the md5keys of all changesets that have been replaced by this command in the BitKeeper/etc/collapsed file. Later, bk pull examines this file to prevent the uncollapsed csets from being pulled into the repository with the collapsed versions. it's giving "keeping receipts" and honestly? queen behavior π
bk collapse also saves a backup patch in BitKeeper/tmp/collapse.patch in case it turns out the collapse was the wrong idea π β safety net stays ON.
π OPTIONS π
-@[url]β If the current repository is a strict superset of the repository at url, then collapse will replace all changesets not in url with a single collapsed cset. If url is omitted, then the current repository's parent is used instead. π§-arevβ Collapse all changesets that occurred after rev. (the "everything since then" button β¨)-eβ Leave the resulting changes as locked, modified files; you must runbk citoolorbk delta/committo create the final changeset. required, remember? π-lβ Record thecsetkeysof the changesets being replaced in theBitKeeper/etc/collapsedfile. π--no-saveβ when fixing the entire changeset, the normal behavior is to save a backup patch of all the csets being removed inBitKeeper/tmp/collapse.patchin case something goes wrong. This option disables this safety net for a minor performance gain. (yes, it's exactly as risky as it sounds β you've been warned π)-qβ suppress most messages. quiet mode, mysterious mode, main character energy π€«
π EXAMPLES π
Fix a problem in the latest cset.
$ bk collapse -e
$ bk citool
Collapse all csets not in my parent into a single cset.
$ bk collapse -e@
$ bk citool
π€ SEE ALSO π€
bk-citool, bk-commit, bk-delta, bk-edit, bk-makepatch, bk-stripdel, bk-undo β the whole friend group π«Ά
π CATEGORY π
Repository
and that's the tea β β this little page comes to you from BitKeeper Inc, revision 1E1, dated... well, the footer just says bk collapse(none) again, but you know the vibes π. go forth and collapse 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