Jump to content

Odd little quirk (branching off empty branch)


Xorcist

Recommended Posts

Not sure if this is intended, but we use an integration branch, so our normal work process for every new repo is to create a new branch off main (for integration purposes), then create a branches off that branch for the actual tasks.

So our branches look like this: (Where T is clearly a child branch of I which is clearly a child branch of M)

Branches.png

But our branch explorer looks like this: (Where M is the head for both I and T)

Branch_Explorer.png

Note that this does not happen, if a file is added to I and a check-in is performed (so that a change-set exists) before creating child branch T.

Link to comment
Share on other sites

Hi!

 

Yes this is because how we currently draw the branch explorer. When the branch is created it always has a parent changeset, in your case is the changeset zero, that why both branches are having links to it.

We use this branch base changeset to draw all the branches, imagine a branch starting from the changeset #1 that is inside of the /main branch, we have to keep targeting #1, we can't target /main always (it's head changeset) on every draw because branches are also static objects.

We could improve this by adding condition, if the branch is empty target it's parent branch by name, but I'm not sure if this may lead into confusion since it will be a dynamic draw and the "switch to branch" operation will remain as an static configuration. Imagine you create content on the /M/I branch, right now /M/I/T will continue targeting the changeset #0, if we implement my suggestion /M/I/T will start targeting the changeset created on the /M/I branch which is not correct. So we could target to the very begging of the /M/I branch instead but all our branches are currently targeting changesets, not branches or blank spots... it's complicated.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...