Research: Git Submodule and Monorepo Best Practices for Reynard #3

Open
opened 2026-04-20 08:24:31 +02:00 by kade · 0 comments
Owner

Research Goals

Investigate git submodule and monorepo best practices to prevent data loss and improve git workflow reliability in the Reynard project.

Current Issues

  • Warning: adding embedded git repository when trying to add submodules as regular directories
  • Data loss from git mismanagement
  • Submodules breaking worktrees, checkouts, branches, and mirroring
  • Tools not supporting submodules well
  • Detached HEAD state issues
  • Forgetting to push submodule changes
  • Keeping submodules in sync is difficult

Progress Update

Completed Actions

  1. Converted embedded git repositories to proper submodules:

    • ComfyUI_Scriptable: converted to proper submodule
    • vendor/candle: converted to proper submodule
    • vendor/font-kit: converted to proper submodule
    • vendor/libc: converted to proper submodule (using --force)
    • vendor/no-std-io2: converted to proper submodule (with GIT_LFS_SKIP_SMUDGE)
    • vendor/notify: converted to proper submodule (with GIT_LFS_SKIP_SMUDGE)
    • wolfy/ComfyUI: converted to proper submodule
  2. Fixed broken forgejo-client submodule:

    • Corrected path from forgejo-client to scripts/forgejo-client
    • Updated .gitmodules configuration
  3. Created safe git operations workflow:

    • Documented in .windsurf/workflows/git-safety.md
    • Includes guidelines for submodule operations
    • Pre-commit checklist to prevent common mistakes

Issues Encountered

  • vendor/naga_oil: Repository not found on Forgejo (kade/naga_oil)
  • vendor/xim-rs: Repository not found on Forgejo (kade/xim-rs)
  • wolfy/custom_nodes/ComfyUI_Scriptable: Nested submodule issue (wolfy is a submodule, cannot add nested submodule)
  • LFS smudge errors: Handled with GIT_LFS_SKIP_SMUDGE for vendor/no-std-io2 and vendor/notify

Remaining Work

  • Handle missing repositories (vendor/naga_oil, vendor/xim-rs)
  • Resolve nested submodule issue for wolfy/custom_nodes/ComfyUI_Scriptable
  • Determine if monorepo without submodules is better option
  • Document recommended git workflow for Reynard

References


This issue will be updated continuously with research findings and progress.

## Research Goals Investigate git submodule and monorepo best practices to prevent data loss and improve git workflow reliability in the Reynard project. ## Current Issues - Warning: adding embedded git repository when trying to add submodules as regular directories - Data loss from git mismanagement - Submodules breaking worktrees, checkouts, branches, and mirroring - Tools not supporting submodules well - Detached HEAD state issues - Forgetting to push submodule changes - Keeping submodules in sync is difficult ## Progress Update ### Completed Actions 1. **Converted embedded git repositories to proper submodules:** - ComfyUI_Scriptable: converted to proper submodule - vendor/candle: converted to proper submodule - vendor/font-kit: converted to proper submodule - vendor/libc: converted to proper submodule (using --force) - vendor/no-std-io2: converted to proper submodule (with GIT_LFS_SKIP_SMUDGE) - vendor/notify: converted to proper submodule (with GIT_LFS_SKIP_SMUDGE) - wolfy/ComfyUI: converted to proper submodule 2. **Fixed broken forgejo-client submodule:** - Corrected path from forgejo-client to scripts/forgejo-client - Updated .gitmodules configuration 3. **Created safe git operations workflow:** - Documented in .windsurf/workflows/git-safety.md - Includes guidelines for submodule operations - Pre-commit checklist to prevent common mistakes ### Issues Encountered - vendor/naga_oil: Repository not found on Forgejo (kade/naga_oil) - vendor/xim-rs: Repository not found on Forgejo (kade/xim-rs) - wolfy/custom_nodes/ComfyUI_Scriptable: Nested submodule issue (wolfy is a submodule, cannot add nested submodule) - LFS smudge errors: Handled with GIT_LFS_SKIP_SMUDGE for vendor/no-std-io2 and vendor/notify ### Remaining Work - [ ] Handle missing repositories (vendor/naga_oil, vendor/xim-rs) - [ ] Resolve nested submodule issue for wolfy/custom_nodes/ComfyUI_Scriptable - [ ] Determine if monorepo without submodules is better option - [ ] Document recommended git workflow for Reynard ## References - [Reasons to avoid Git submodules](https://blog.timhutt.co.uk/against-submodules/) - [Managing Monorepos with Git Submodules: A Practical Guide](https://thebottleneckdev.com/blog/monorepo-git-submodules) - [Git Submodules vs. Monorepos: What is the Best Strategy?](https://medium.com/@fulton_shaun/git-submodules-vs-monorepos-whats-the-best-strategy-caa5de25490b) --- *This issue will be updated continuously with research findings and progress.*
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
kade/forgejo-client#3
No description provided.