gitstatus icon indicating copy to clipboard operation
gitstatus copied to clipboard

don't force checking for dirty submodules

Open orn688 opened this issue 3 years ago • 4 comments

opts.ignore_submodules = GIT_SUBMODULE_IGNORE_DIRTY is equivalent to setting the git status flag --ignore-submodules=dirty, which takes precedence per-submodule ignore settings in .gitmodules. This means that gitstatus returns a different result than a default git status call with no flags if there are any dirty submodules that are marked ignore = all in .gitsubmodules.

This is confusing because git status and gitstatusd will be out of sync and there's no obvious reason why.

This should only result in a behavior change for projects with submodules that set the .gitmodules config value submodule.<name>.ignore to something besides none or dirty, but in all cases it will ensure git status and gitstatusd are in agreement.

Fixes #356.

orn688 avatar Oct 21 '22 18:10 orn688

If you remove that line, are you sure it'll respect the per-submodule ignore settings in .gitmodules? Could you test it?

Also, I vaguely remember that there was a setting that makes git status recurse submodules. Does this really exist or am I misremembering? If it does exist, could you test what happens if you set it?

romkatv avatar Oct 21 '22 18:10 romkatv

Good idea, I just tested it out. Removing ignore = all from an entry in .gitmodules corresponding to a dirty submodule and committing the change causes gitstatusd to indicate that the repo is dirty, consistent with git status. So it seems to be working as intended.

I don't see any recurse-submodules option for git status, but there is git submodule status, which takes an optional --recursive flag – is that what you mean?

orn688 avatar Oct 21 '22 18:10 orn688

I don't see any recurse-submodules option for git status, but there is git submodule status, which takes an optional --recursive flag – is that what you mean?

I don't know. What I do know is that the line this PR is deleting was put there for a reason and presently we don't know what this reason was. If you could find out, and if this reason is no longer relevant, I'll merge it.

romkatv avatar Oct 21 '22 18:10 romkatv

I don't know. What I do know is that the line this PR is deleting was put there for a reason and presently we don't know what this reason was. If you could find out, and if this reason is no longer relevant, I'll merge it.

You added it in version 0.1 (code), but unfortunately I don't see any comment or anything to explain why you put it there in the first place.

Based on a Github Code Search, I also don't see any other major projects that are using the GIT_SUBMODULE_IGNORE_DIRTY option, so I have no idea why you might have chosen to use it in this project.

orn688 avatar Oct 21 '22 19:10 orn688