BK-COLLAPSE(1)

πŸ“¦ version 7.3.3, in alpine 3.24

πŸ’… 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 -e option 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 use bk citool or bk delta/commit to 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 run bk citool or bk delta/commit to create the final changeset. required, remember? πŸ’€
  • -l β€” Record the csetkeys of the changesets being replaced in the BitKeeper/etc/collapsed file. πŸ“
  • --no-save β€” when fixing the entire changeset, the normal behavior is to save a backup patch of all the csets being removed in BitKeeper/tmp/collapse.patch in 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
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms