Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only recurse into submodules if .submodules exists #125

Merged
merged 1 commit into from
Oct 3, 2020
Merged

Only recurse into submodules if .submodules exists #125

merged 1 commit into from
Oct 3, 2020

Conversation

phijor
Copy link
Contributor

@phijor phijor commented Oct 1, 2020

git before version 2.11 does not know the --recurse-submodules flag. Some OSes (RHEL 7, Debian Jessie, Ubuntu 16.04 LTS) still ship with versions older than that.

With this change, git is only passed --recurse-submodules if the repo in question has submodules configured, as indicated by the presence of .gitmodules. This prevents bugs like #123 on newer platforms, while still supporting older platforms, as long as repos there do not have submodules configured.

This fixes #124.


Does this look like it would be enough to make check-manifest work on older platforms? I cant really test it right now.

Copy link
Owner

@mgedmin mgedmin left a comment

Choose a reason for hiding this comment

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

Looks good to me! I also don't have a way of testing this (well TBH, I'm just too lazy to hunt down docker images with RHEL7).

All it needs before it can be merged is a changelog entry, and also I want to wait for Travis results to see if test coverage remains at 100%. (It should, because you cunningly used the ternary operator, and I'm not measuring branch coverage :)

check_manifest.py Outdated Show resolved Hide resolved
@mgedmin
Copy link
Owner

mgedmin commented Oct 2, 2020

The PR looks good on travis: https://travis-ci.org/github/mgedmin/check-manifest/builds/731900926.

Travis dot ORG -> GitHub status updates probably ran into API rate limits again.

`git` before version 2.11 does not know the `--recurse-submodules` flag.
Some OSes (RHEL 7, Debian Jessie, Ubuntu 16.04 LTS) still ship with
versions older than that.

With this change, `git` is only passed `--recurse-submodules` if the
repo in question has submodules configured, as indicated by the presence
of `.gitmodules`.  This prevents bugs like #123 on newer platforms,
while still supporting older platforms, as long as repos there do not
have submodules configured.

This fixes #124.
@mgedmin
Copy link
Owner

mgedmin commented Oct 3, 2020

Travs is green, I'm just gonna merge this and try to come up with a changelog note myself then.

Thank you!

@mgedmin mgedmin merged commit 5394435 into mgedmin:master Oct 3, 2020
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.

--recurse-submodules not available in git that ships with RHEL7
2 participants