Skip to content

Conversation

@txemaotero
Copy link
Contributor

@txemaotero txemaotero commented Dec 9, 2025

This PR aims to provide some support to work with submodules. It's motivated by the issue #1822

New functionality:

  • When hitting <cr> on a submodule entry with changes in the status view, a new neogit instance is opened with the submodule as root.
  • When inside the status view of a submodule, hitting gp (default for the new GoToParentRepo mapping) opens a new neogit instance with the parent repo as root.

Implementation details:

  • On new neogit instance creation, information about submodules and parent repo is cached.
  • Helper functions are defined to get the submodule under the cursor or the parent repo if present.
  • New git commands were added to:
    • Get a list of the submodules in the repo (in the new git/submodule.lua file)
    • Get the path to the parent repo (as a new flag for the rev_parse command)
  • The feature was validated manually but a new integration test was also introduced.

@txemaotero txemaotero force-pushed the feature/submodule-support branch from ccc8331 to bf6c453 Compare December 9, 2025 23:06
@CKolkey
Copy link
Member

CKolkey commented Dec 11, 2025

Great stuff! Small thing re: syntax preference but otherwise fine 👍🏼

New functionality:
- When hitting `<cr>` on a submodule entry with changes in the status
  view, a new neogit instance is opened with the submodule as root.
- When inside the status view of a submodule, hitting `gp` (default for
  the new `GoToParentRepo` mapping) opens a new neogit instance with the
  parent repo as root.

Implementation details:
- On new neogit instance creation, information about submodules and
  parent repo is cached.
- Helper functions are defined to get the submodule under the cursor or
  the parent repo if present.
- New git commands were added to:
    - Get a list of the submodules in the repo (in the new
      `git/submodule.lua` file)
    - Get the path to the parent repo (as a new flag for the `rev_parse`
      command)
- The feature was validated manually but a new integration test was also
  introduced.
@txemaotero txemaotero force-pushed the feature/submodule-support branch from bf6c453 to 76f470a Compare December 12, 2025 14:04
@CKolkey CKolkey merged commit d8bf910 into NeogitOrg:master Dec 12, 2025
4 of 6 checks passed
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

Successfully merging this pull request may close these issues.

2 participants