Skip to content

scap prep: set pushInsteadOf in the submodules config

Hashar requested to merge scap-prep-pushInsteadOf into master

On the deployment server we clone the repositories over https. Since we sometime had to push directly from the server I once discoverd the pushInsteadOf which lets one have git to replace the url to push to. For example:

[url "ssh://gerrit.wikimedia.org:29418"] pushInsteadOf = https://gerrit.wikimedia.org/r

It is convenient, and I still have it set in my ~/.gitconfig but most do not and get caught when pushing. That happened when I paired with Jaime a couple years ago. In bab8df99, I have set the push URL explicitly for the repositories we clone directly, I however did not set it for submodules.

To clear the wmf branches, we do a git push --delete from each of the submodules which thus attempt to push to the unauthenticated https URL and that results in:

05:00:06 Deleting branch from other projects fatal: could not read Username for 'https://gerrit.wikimedia.org': No such device or address fatal: could not read Username for 'https://gerrit.wikimedia.org': No such device or address fatal: could not read Username for 'https://gerrit.wikimedia.org': No such device or address ...

Set pushInsteadOf in the submodules so that scap clean push over ssh using the configured gerrit_push_url (and its associated credentials).

Bug: T306425 Bug: T303828

Merge request reports