3

Say I fix a bug in a common submodule used by multiple projects.

Is there a way to automatically notify the developers of all the super-projects to update the submodule?

Trev
  • 1,358
  • 3
  • 16
  • 28
  • 1
    Well, you could add a hook, to send an email. There is no way to contact all the users of a repository through git itself. – michas Mar 13 '13 at 21:18

2 Answers2

2

Is there a way to automatically notify the developers of all the super-projects to update the submodule

No.
A submodule is a clone of an upstream repo, nested in a parent repo.
It is a downstream repo compared to the original repo you cloned as a submodule.

And in a distributed environment, you simply don't know of the downstream repos.
You only know of the upstream repo.
See "Definition of “downstream” and “upstream”".

As mentioned in "Update git submodule", you would need to go in the submodule and git pull directly in there in order to update said submodule.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
1

You could add a post-commit hook to send out emails.

You could get the email of all committers on the branch using (bash syntax)

git log --pretty:format="%ce" | sort | uniq

Or alternatively, enforce the developer to

git pull --recurse-submodules

to always be on the latest version of all submodules with every pull. May or may not be a good idea if there are breaking changes pushed, depending on how you want to enforce this.

Chilledrat
  • 2,593
  • 3
  • 28
  • 38
Srikanth Venugopalan
  • 9,011
  • 3
  • 36
  • 76