check_submodules

0.0.5 • Public • Published

check_submodules

Small command line utility to verify submodule references in a git repository.

WARNING: This script was designed specifically for https://github.com/azure/azure-iot-sdk-c and its submodules. While it should in theory work against other repos, you should carefully test as the script itself doesn't receive generic testing.

What problems is it trying to solve?

Problem 1: Submodule mismatch

Some repositories (such as https://github.com/azure/azure-iot-sdk-c) reference the same submodule at multiple places in their source tree. Sometimes it's even more complicated, for example:

a (main repository)
  -> submodule b
  -> submodule c
      -> submodule b (ie. submodule c also references b as a submodule)

In those cases it might be useful to verify that when a submodule is reused in multiple places in the source tree, all the references to that submodule point to the same commit hash.

This utility performs that check.

Problem 2: Referencing submodules ahead of master|main

Even if the submodules are consistent, it is possible for a submodule to be on a branch and later that branch could get deleted. This leaves the master (or main) in an inconsistent state.

To avoid this hazard, this utility also verifies that submodules being checked in are 0 commits ahead of their own masters when merging into a branch into master.

Readme

Keywords

none

Package Sidebar

Install

npm i check_submodules

Weekly Downloads

39

Version

0.0.5

License

MIT

Unpacked Size

8.94 kB

Total Files

3

Last publish

Collaborators

  • windowsazure
  • pierreca
  • anthonyvercolano