Skip to content

chore(submodule): ignore dirty submodule worktrees#523

Merged
egolearner merged 3 commits into
mainfrom
fix/submodule-ignore-dirty
Jun 24, 2026
Merged

chore(submodule): ignore dirty submodule worktrees#523
egolearner merged 3 commits into
mainfrom
fix/submodule-ignore-dirty

Conversation

@JalinWang

Copy link
Copy Markdown
Collaborator

Set ignore = dirty for every entry in .gitmodules so local submodule modifications do not show up as repository dirtiness.

This keeps the submodule status noise down while leaving tracked changes intact.

@JalinWang JalinWang requested a review from chinaux as a code owner June 24, 2026 03:14
@JalinWang JalinWang changed the title Ignore dirty submodule worktrees chore(submodule): ignore dirty submodule worktrees Jun 24, 2026
@JalinWang JalinWang requested review from egolearner and feihongxu0824 and removed request for chinaux June 24, 2026 03:16
@egolearner

Copy link
Copy Markdown
Collaborator

Thanks for the PR!

I don’t think we should set ignore = dirty for all thirdparty submodules by default. In this repo, letting git status report dirty submodule worktrees is intentional: it helps us catch accidental or missed local changes under thirdparty/ before they slip through review/release work. So the current behavior is more of a safeguard/feature than a bug.

Could you share the concrete scenario where these submodules need to be fully ignored? If this is about local build artifacts or tool-generated noise in a specific submodule, we can consider a narrower fix instead of changing the repo-wide default.

@JalinWang

JalinWang commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator Author

Could you share the concrete scenario where these submodules need to be fully ignored? If this is about local build artifacts or tool-generated noise in a specific submodule, we can consider a narrower fix instead of changing the repo-wide default.

sparsehash and googletest can end up with local changes on Windows because of apply_patch, which keeps git status dirty. ignore = dirty is the right fit here.

I also think ignore = all is too broad for these cases, because submodule commit changes are something we still want to track.

Updated this PR to be limited to the submodules that receive patches.

@egolearner egolearner merged commit 3713d64 into main Jun 24, 2026
16 checks passed
@egolearner egolearner deleted the fix/submodule-ignore-dirty branch June 24, 2026 13:01
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