Skip to content

gitstatus ignores the ignore field of .gitmodules #356

@woody77

Description

@woody77

When used with a superproject that specifies submodules with the ignore field set to all, gitstatus will count it as an 'unstaged change' if the submodule is not at its own HEAD.

submodule configuration from .gitmodules:

[submodule "external/foo"]
        path = external/foo
        url = https://some.server.com/foo
        name = foo
        ignore = all

running git status doesn't show it as having unstaged changes:

╰─ git status
On branch bar
Your branch is ahead of 'origin/main' by 1 commit.
  (use "git push" to publish your local commits)

nothing to commit, working tree clean

unless it's run with --ignore-submodules=<value other than 'all'>:

╰─ git status --ignore-submodules=dirty
On branch bar
Your branch is ahead of 'origin/main' by 1 commit.
  (use "git push" to publish your local commits)

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
	modified:   external/foo (new commits)

no changes added to commit (use "git add" and/or "git commit -a")

but the prompt string constructed by gitstatus does count it as having unstaged changes:

bar:main ⇡1 !1 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions