Skip to content

Handling of submodules #203

Closed
Closed

Description

@spossann

The commits that the submodules (struphy-tutorials and struphy-parameter-files) are pointing to may belong to branches that have been merged and squashed. We do not have a clear strategy of how to handle the submodule commits at the moment.

Accepted solution:

  • Move tutorials and parameter files into the Struphy repo, under
    • doc/tutorials/
    • examples/
  • Push to separate repos upon new Struphy release

Previously proposed solution (not accepted):

  • create devel branches in the submodules
  • merge new features of the submodules into their devel immediately
  • in a Struphy feature branch, point the submodules to the last commit in the submod's devel before merging
  • never squash commits in submodules
  • The main of the submodules remains as the main branch that is cloned by default; it is updated only when a new Struphy release is made

@max-models what do you think?

Activity

  1. max-models commented on Mar 12, 2026

    @max-models
    Member

    Well, I don't see the benifit of using submodules for tutorials or parameter files at all. These are projects which have a very stong connection to struphy, and I would just prefer moving them back into the repository and avoiding submodules alltogether. If we also want tutorials and parameter files to be accessible in a separate repo, then I would just add a github action that pushes updated versions to these repos each time we update main in struphy.

  2. spossann commented on Mar 12, 2026

    @spossann
    MemberAuthor

    Well, I don't see the benifit of using submodules for tutorials or parameter files at all. These are projects which have a very stong connection to struphy, and I would just prefer moving them back into the repository and avoiding submodules alltogether. If we also want tutorials and parameter files to be accessible in a separate repo, then I would just add a github action that pushes updated versions to these repos each time we update main in struphy.

    I think it can be beneficial to be able to update parameter files and tutorials in separate repos. In particular, it should be possible for people who are not developing Struphy to add files and tutorials. In that case it would not be good to have always two versions of each file, one in Struphy and one in the respective repo.

  3. linked a pull request that will close this issue203 handling of submodules #204on Mar 12, 2026
  4. max-models commented on Mar 12, 2026

    @max-models
    Member

    Well, I don't see the benifit of using submodules for tutorials or parameter files at all. These are projects which have a very stong connection to struphy, and I would just prefer moving them back into the repository and avoiding submodules alltogether. If we also want tutorials and parameter files to be accessible in a separate repo, then I would just add a github action that pushes updated versions to these repos each time we update main in struphy.

    I think it can be beneficial to be able to update parameter files and tutorials in separate repos. In particular, it should be possible for people who are not developing Struphy to add files and tutorials. In that case it would not be good to have always two versions of each file, one in Struphy and one in the respective repo.

    Ok, I can sort of see what you are going for. But I still disagree that this is worth it.

    Typically, I found most codes to simply have an examples/ directory which is always included when cloning the repo. For example:

    So that's sort of what I would have assumed would be included if I clone struphy, but now you don't get any of that except if you know you have to clone with --recurse-submodules. I don't really see who a person would be who would like to contribute to the tutorials but can't clone the struphy repo honestly.

    It seems like your idea is that the default (main) branch in struphy-tutorials should correspond to main in struphy, but in that case an outsider can't contribute anyway, since they would have to make a PR into devel (which means they need to clone struphy anyway) or PR into main (in which case we later have to merge main into devel). I just feel like all of this structure is much more complex to keep track of than simply having the files in the struphy repo and making sure they are compatible with the code in the current branch 😅

  5. spossann commented on Mar 12, 2026

    @spossann
    MemberAuthor

    I think you are right. The best solution is probably to have everything in the repo and push to the external repos upon release. Will do the changes asap.

  6. added a commit that references this issue on Mar 20, 2026
  7. spossann commented on Mar 20, 2026

    @spossann
    MemberAuthor

    Handled in PR #206

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions