Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues with branches and commits with non-model content #71

Open
Phillipus opened this issue Nov 2, 2018 · 2 comments
Open

Issues with branches and commits with non-model content #71

Phillipus opened this issue Nov 2, 2018 · 2 comments

Comments

@Phillipus
Copy link
Member

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:

  1. The branch is checked out. There are no grafico XML files.
  2. GraficoModelLoader tries to load grafico files with GraficoModelImporter but this fails returning a null new IArchimateModel.
  3. User has now switched to a non-grafico branch but the ArchiMateModel still looks the same as before.
  4. User cannot switch back to another branch because this action causes (1) Export to grafico then (2) Ask user to commit this change. If user says yes, the special branch has this new commit. If user cancels they are stuck.

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 #67 (comment)

@Phillipus
Copy link
Member Author

In fact this is not just limited to branches, but any commit that does not contain Archi grafico XML files.

@Phillipus
Copy link
Member Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant