Open Phillipus opened 5 years ago
In fact this is not just limited to branches, but any commit that does not contain Archi grafico XML files.
Comment from @jbsarrodie in orginal thread:
@Phillipus
Our "letstest" repo has an orphan branch called "web" and the "Archisurance" repo has a "gh-pages" branch (not an orphan). These branches contain content not related to the model. So what happens if user switches to this branch:
I know, I did the same test.
We probably need to hide these special branches. Note - I don't know how to determine an orphan branch in JGit.
I might have found another option....
Few knows it, but branch name can contain some non alphabetical characters like slash '/'. So when a user creates a branch, we could (internally) add a known prefix that ends with '/', for example 'Archi/'. Doing so would allow us to filter branches managed by Archi: either 'master' or a branch that starts by 'Archi/'. Of course we could remove the prefix to only show the remaining part in UI.
We could even us this to keep track of the "parents" of a branch (ie. the branches it is forked off). For this we would simply add the short name of a branch to the full name of its parent: Imagine we create 'Project_A' off 'master', this would create 'master/Project_A'. If we then create 'Scenario_1' off 'Project_A', this would create 'master/Project_A/Scenario_1'...
So all branches managed by Archi would start with 'master', making it easy to filter them. This would have the advantage to allow to show this full path in the Branch view.
Of course, this really works only if we never rename a branch, but we already assume this would not happen.
The test "letstest" repo has an orphan branch called "web" and the "Archisurance" repo has a "gh-pages" branch (not an orphan). These branches contain content not related to the model. So what happens if user switches to this branch:
We probably need to hide these special branches. Note - I don't know how to determine an orphan branch in JGit.
Perhaps when we check if a new commit is required before doing a further action we should have the option to abandon the changes for the commit as well as cancelling?
Originally posted by @Phillipus in https://github.com/archimatetool/archi-modelrepository-plugin/issues/67#issuecomment-435372046