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

Mepo state files (.mepo/state.json) should include the full path to remote #312

Closed
pchakraborty opened this issue Aug 19, 2024 · 2 comments
Assignees

Comments

@pchakraborty
Copy link
Collaborator

Currently the state file (.mepo/state.json) mirrors the registry, and looks like

[
  {
    "name": "GEOSgcm",
    "local": ".",
    "remote": "../GEOSgcm.git",
    "version": [
      "v11.5.2",
      "t",
      true
    ],
    "sparse": null,
    "develop": "main",
    "recurse_submodules": null,
    "fixture": true,
    "ignore_submodules": null
  },
  {
    "name": "env",
    "local": "@env",
    "remote": "../ESMA_env.git",
    "version": [
      "v4.25.1",
      "t",
      true
    ],
    "sparse": null,
    "develop": "main",
    "recurse_submodules": null,
    "fixture": false,
    "ignore_submodules": null
  },
  ...
]

As a result, every time remote needs to be accessed, there is an extra step where git remote get-url origin is run. We can avoid that by storing the complete URL of each repo in state.json. For example

[
  {
    "name": "GEOSgcm",
    "local": ".",
    "remote": "https://github.com/GEOS-ESM/GEOSgcm.git",       # <--- changed
    "version": [
      "v11.5.2",
      "t",
      true
    ],
    "sparse": null,
    "develop": "main",
    "recurse_submodules": null,
    "fixture": true,
    "ignore_submodules": null
  },
  {
    "name": "env",
    "local": "@env",
    "remote": "https://github.com/GEOS-ESM/ESMA_env.git",      # <--- changed
    "version": [
      "v4.25.1",
      "t",
      true
    ],
    "sparse": null,
    "develop": "main",
    "recurse_submodules": null,
    "fixture": false,
    "ignore_submodules": null
  },
  ...
]
@pchakraborty pchakraborty self-assigned this Aug 19, 2024
@pchakraborty
Copy link
Collaborator Author

The first time mepo encounters an old-style json state file, it updates the remote entries in that file.

@pchakraborty
Copy link
Collaborator Author

Done #316

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