-
Notifications
You must be signed in to change notification settings - Fork 61
Add example of working with Git submodules #404
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,18 @@ | ||||||
| # Working with GIT submodules | ||||||
| This example discusses how one could build the relational tree structure representing submodules within GIT using Eiffel events. | ||||||
|
|
||||||
| ## Introduction | ||||||
| A common use case in GIT is where one want to connect a relationship between repositories to be able to mirror the GIT structure as it is. The scenario could be that you have a parent repository who have one or many GIT submodule. | ||||||
|
|
||||||
| Below is a simple image of how it could look in GIT. | ||||||
|
|
||||||
|  | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If you're going to supply an alternative text for visually impaired, please make it something better than "alt text" :-) |
||||||
|
|
||||||
| ## Eiffel solution | ||||||
| This will show you one setup for the Eiffel model on how to get around the use-case where there is a sceanrio where GIT submodules are used. | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
|  | ||||||
|
|
||||||
| Depending on the solution setup, a Service can be created to listen for SCCs (Source Change Created) that carry a specific identification tag/id for the Parent repository. Upon detecting such an SCC, the Service uses the SourceChange API to read the SHA IDs of contained submodules. It then fetches the related SCCs based on these IDs. Finally, it generates a CompositionDefined (CD) event and publishes it on the bus. | ||||||
m-linner-ericsson marked this conversation as resolved.
Show resolved
Hide resolved
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What does "SourceChange API" refer to in this case? I'm not aware of any API that returns the submodules of a given commit from a repository.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Propose to add a link to the events to help the reader if they want more information.
Suggested change
|
||||||
|
|
||||||
| Important drawback from this is that it does not create a linear relationship downwards. Even though one could argue that it does, but it requires knowledge about what SCC one is suposed to query. | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: We usually refer to the Git program as "Git" and a repository as "git", but we never use "GIT".