Fossil User Forum

Closing a branch from the CLI
Login

Closing a branch from the CLI

Closing a branch from the CLI

(1) By Ron Aaron (ron) on 2020-07-19 04:57:17 [link] [source]

Is there a way to close a branch from the CLI?

I see how to list branches but not how to prune them.

(2) By Warren Young (wyoung) on 2020-07-19 05:00:26 in reply to 1 [link] [source]

(3) By Ron Aaron (ron) on 2020-07-19 13:39:06 in reply to 2 [link] [source]

Thanks, I would never have thought of 'amend'.

Why doesn't 'branch' have an option to do this?

(4) By anonymous on 2020-07-19 17:37:18 in reply to 1 [link] [source]

Indeed, 'fossil branch close' is a reasonable command to have, given the absense of delete.

As for the intended use, it appears that a branch would be closed automatically on 'merge --integrate'.

(5) By Stephan Beal (stephan) on 2020-07-19 18:04:46 in reply to 4 [link] [source]

As for the intended use, it appears that a branch would be closed automatically on 'merge --integrate'.

Noting that it doesn't get closed until/unless the merge is committed. If the merge is canceled, so is the close.

(6) By Warren Young (wyoung) on 2020-07-19 18:58:40 in reply to 3 [link] [source]

The current two methods are sensible because "closing" a branch is applying a tag to a commit, so you must either do it during the initial commit as with merge --integrate or you must go back later and amend the last commit on that branch.

If there were a fossil branch close command, it would just be a thin wrapper over amend --close.

I think this is one of those cases where Fossil might seem more complicated than necessary but only because you haven't fully grokked all of the existing concepts. Adding the new mechanism would actually complicate things by adding a third way to do something we already have.

I suggest reading the branching doc, particularly the section on tags and properties.

(7) By andygoth on 2020-07-30 00:17:48 in reply to 1 [source]

By the way, here's how to reopen a closed branch, something I just had to do. For this command, I'm reopening the current branch, but you can replace "current" with the branch name:

f tag cancel -raw closed current

(Assuming you have an f=fossil alias.)