Skip to content

submodule instructions#2272

Merged
jcubic merged 1 commit intoisomorphic-git:mainfrom
sdarwin:feature/doc
Jan 20, 2026
Merged

submodule instructions#2272
jcubic merged 1 commit intoisomorphic-git:mainfrom
sdarwin:feature/doc

Conversation

@sdarwin
Copy link
Contributor

@sdarwin sdarwin commented Jan 19, 2026

If anyone submits a pull request which modifies __tests__ or adds new api commands, comment to them when necessary, "Please refer to Appendix A submodules in the CONTRIBUTING.md file. Make sure to include submodule tests."

Summary by CodeRabbit

  • Documentation
    • Added Appendix A on submodules with step-by-step guidance appended to the contribution guide.
    • Updated contribution checklist to reference Appendix A and require submodule tests for new/updated commands.
    • Clarified test conventions for submodule-aware scenarios, including recommended test variants and structuring guidance for existing and new APIs.
    • Documentation-only; no executable changes.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Jan 19, 2026

📝 Walkthrough

Walkthrough

Adds Appendix A on submodules to CONTRIBUTING.md and updates the PR template to reference it; Appendix A documents testing conventions (two tests per command including -in-submodule variants), guidance for __tests__, and notes on making src/api submodule-aware. Documentation-only changes.

Changes

Cohort / File(s) Summary
CONTRIBUTING (Appendix A)
CONTRIBUTING.md
Appended Appendix A covering submodule handling: test conventions (two test files per command, -in-submodule variants), guidance for creating/updating __tests__, testing expectations, and notes on src/api submodule-aware command handling (+26 lines).
PR Template
.github/PULL_REQUEST_TEMPLATE.md
Added checklist entries referencing "Appendix A submodules" and reminding contributors to include submodule tests (+2 lines).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐇 I hopped through lines of guiding prose,
I tucked Appendix A where submodule knowledge grows,
Two tests now dance—one plain, one submodule-born,
Paths mapped, APIs noted at early morn,
A tiny hop, the docs are warm.

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'submodule instructions' is vague and overly broad. While it relates to the changeset, it lacks specificity about what the instructions entail or what aspect of the PR is most important. Consider a more descriptive title such as 'Add submodule testing guidance to CONTRIBUTING.md and PR template' to clearly convey the main change.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Fix all issues with AI agents
In `@CONTRIBUTING.md`:
- Line 123: Edit the sentence to correct punctuation and formatting: add a comma
after "features", wrap both paths in backticks (`src/api/` and `src/commands/`)
for consistency, and ensure the `discoverGitdir` and `gitdir` identifiers are
formatted in backticks where mentioned (e.g., "apply the `discoverGitdir`
function" and "send the `gitdir` value through the `discoverGitdir` filter") so
all technical symbols are consistently styled.
- Line 121: Remove the trailing period from the subsection header text "3.
Creating new `src/api/` commands." so it matches the other headers; update the
header to "3. Creating new `src/api/` commands" (no period) wherever that exact
header appears to maintain consistent formatting across subsections.
- Line 119: Update the documentation text in CONTRIBUTING.md by replacing the
lowercase acronym "api" with the capitalized "API" in the sentence that reads
'Let's imagine "brancher" is a new api command.'; locate the same phrase and
change "api" to "API" so the line reads '... a new API command' to maintain
consistent technical capitalization.
🧹 Nitpick comments (1)
CONTRIBUTING.md (1)

127-127: Improve phrasing for clarity.

The phrase "perhaps nothing must change" is awkward. Consider rephrasing for better readability.

📝 Suggested improvement
-Depending on the situation, perhaps nothing must change. See the notes above regarding the `discoverGitdir` function.
+Depending on the situation, no changes may be necessary. See the notes above regarding the `discoverGitdir` function.

CONTRIBUTING.md Outdated

2. Creating new `__tests__` for brand new apis

Let's imagine "brancher" is a new api command. Place two new files in `__tests__` which are `test-brancher.js` and `test-brancher-in-submodule.js`. They should be mostly identical. For submodule tests, import and use `makeFixtureAsSubmodule` instead of `makeFixture`. See the notes above about the `gitdir` variable.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Capitalize "API" for consistency.

Technical acronyms should be capitalized. Change "api" to "API" to align with standard technical writing conventions.

📝 Suggested fix
-Let's imagine "brancher" is a new api command. Place two new files in `__tests__` which are `test-brancher.js` and `test-brancher-in-submodule.js`. They should be mostly identical. For submodule tests, import and use `makeFixtureAsSubmodule` instead of `makeFixture`. See the notes above about the `gitdir` variable.  
+Let's imagine "brancher" is a new API command. Place two new files in `__tests__` which are `test-brancher.js` and `test-brancher-in-submodule.js`. They should be mostly identical. For submodule tests, import and use `makeFixtureAsSubmodule` instead of `makeFixture`. See the notes above about the `gitdir` variable.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
Let's imagine "brancher" is a new api command. Place two new files in `__tests__` which are `test-brancher.js` and `test-brancher-in-submodule.js`. They should be mostly identical. For submodule tests, import and use `makeFixtureAsSubmodule` instead of `makeFixture`. See the notes above about the `gitdir` variable.
Let's imagine "brancher" is a new API command. Place two new files in `__tests__` which are `test-brancher.js` and `test-brancher-in-submodule.js`. They should be mostly identical. For submodule tests, import and use `makeFixtureAsSubmodule` instead of `makeFixture`. See the notes above about the `gitdir` variable.
🤖 Prompt for AI Agents
In `@CONTRIBUTING.md` at line 119, Update the documentation text in
CONTRIBUTING.md by replacing the lowercase acronym "api" with the capitalized
"API" in the sentence that reads 'Let's imagine "brancher" is a new api
command.'; locate the same phrase and change "api" to "API" so the line reads
'... a new API command' to maintain consistent technical capitalization.

CONTRIBUTING.md Outdated

Let's imagine "brancher" is a new api command. Place two new files in `__tests__` which are `test-brancher.js` and `test-brancher-in-submodule.js`. They should be mostly identical. For submodule tests, import and use `makeFixtureAsSubmodule` instead of `makeFixture`. See the notes above about the `gitdir` variable.

3. Creating new `src/api/` commands.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Remove period for consistency.

Subsection headers 1, 2, and 4 don't have periods, but subsection 3 does. Remove the period to maintain consistent formatting.

📝 Suggested fix
-3. Creating new `src/api/` commands.
+3. Creating new `src/api/` commands
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
3. Creating new `src/api/` commands.
3. Creating new `src/api/` commands
🤖 Prompt for AI Agents
In `@CONTRIBUTING.md` at line 121, Remove the trailing period from the subsection
header text "3. Creating new `src/api/` commands." so it matches the other
headers; update the header to "3. Creating new `src/api/` commands" (no period)
wherever that exact header appears to maintain consistent formatting across
subsections.

CONTRIBUTING.md Outdated

3. Creating new `src/api/` commands.

In terms of submodule-related features only modify src/api/ files and not src/commands/. This is an architectural decision to keep logic at one layer of the stack, while other layers may remain unaffected. Review other files, the basic idea is to apply the `discoverGitdir` function, and never assume `gitdir` is right. Send the `gitdir` value through the `discoverGitdir` filter before passing it anywhere else. In a common situation, when submodules aren't used, the `discoverGitdir` filter will just send back the original value. If it turns out a submodule is used it will return the required information.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Fix grammar and formatting.

This line has multiple minor issues:

  • Missing comma after "features"
  • Inconsistent use of backticks around file paths (src/api/ and src/commands/ should both have backticks)
📝 Suggested fix
-In terms of submodule-related features only modify src/api/ files and not src/commands/. This is an architectural decision to keep logic at one layer of the stack, while other layers may remain unaffected. Review other files, the basic idea is to apply the `discoverGitdir` function, and never assume `gitdir` is right. Send the `gitdir` value through the `discoverGitdir` filter before passing it anywhere else. In a common situation, when submodules aren't used, the `discoverGitdir` filter will just send back the original value. If it turns out a submodule is used it will return the required information.
+In terms of submodule-related features, only modify `src/api/` files and not `src/commands/`. This is an architectural decision to keep logic at one layer of the stack, while other layers may remain unaffected. Review other files, the basic idea is to apply the `discoverGitdir` function, and never assume `gitdir` is right. Send the `gitdir` value through the `discoverGitdir` filter before passing it anywhere else. In a common situation, when submodules aren't used, the `discoverGitdir` filter will just send back the original value. If it turns out a submodule is used it will return the required information.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
In terms of submodule-related features only modify src/api/ files and not src/commands/. This is an architectural decision to keep logic at one layer of the stack, while other layers may remain unaffected. Review other files, the basic idea is to apply the `discoverGitdir` function, and never assume `gitdir` is right. Send the `gitdir` value through the `discoverGitdir` filter before passing it anywhere else. In a common situation, when submodules aren't used, the `discoverGitdir` filter will just send back the original value. If it turns out a submodule is used it will return the required information.
In terms of submodule-related features, only modify `src/api/` files and not `src/commands/`. This is an architectural decision to keep logic at one layer of the stack, while other layers may remain unaffected. Review other files, the basic idea is to apply the `discoverGitdir` function, and never assume `gitdir` is right. Send the `gitdir` value through the `discoverGitdir` filter before passing it anywhere else. In a common situation, when submodules aren't used, the `discoverGitdir` filter will just send back the original value. If it turns out a submodule is used it will return the required information.
🤖 Prompt for AI Agents
In `@CONTRIBUTING.md` at line 123, Edit the sentence to correct punctuation and
formatting: add a comma after "features", wrap both paths in backticks
(`src/api/` and `src/commands/`) for consistency, and ensure the
`discoverGitdir` and `gitdir` identifiers are formatted in backticks where
mentioned (e.g., "apply the `discoverGitdir` function" and "send the `gitdir`
value through the `discoverGitdir` filter") so all technical symbols are
consistently styled.

@sdarwin sdarwin force-pushed the feature/doc branch 3 times, most recently from 6a857de to b00caab Compare January 19, 2026 23:44
@jcubic
Copy link
Member

jcubic commented Jan 20, 2026

Maybe it's worth updating the PR template with information about it as well.

@sdarwin
Copy link
Contributor Author

sdarwin commented Jan 20, 2026

updating the PR template

Done.
I think it will still be necessary to remind people, but it's worth trying to prompt them in the template.

@jcubic jcubic merged commit 253f812 into isomorphic-git:main Jan 20, 2026
4 checks passed
@isomorphic-git-bot
Copy link
Member

🎉 This PR is included in version 1.36.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments