As of v0.12.0, specifically 2fda83e (ENH: Record the active branch
of a subdataset in the parent, 2019-10-20, dataladgh-3817), we record the
current branch in the _parent_ repository as the value for
`submodule.<name>.branch` in .gitmodules when saving a new submodule.
There are a few problems with this:
* The current branch in the parent is recorded. It seems unlikely
that that was the intent because there is no reason to assume a
branch with that name exists in the submodule repository or, if it
does, to assume that the parent and submodule branches are
necessarily coupled. 2fda83e mentions dataladgh-1424
(`Datalad.recall_state() -> `load` command) as the motivation,
which makes it seem likely the current branch in the submodule,
not the parent, was supposed be recorded.
This was mentioned in a currently open PR:
<datalad#4275 (comment)>
* Discussion of recording the branch at dataladgh-1424 suggests that the
idea is to record this information with every save, but 2fda83e
records it only when the submodule is initially added. 2fda83e
doesn't say explicitly that its intent was to do it with every
save (just that the change moves in the direction of dataladgh-1424), but
still it doesn't seem a particularly useful incremental step to
have a one-shot record of the current branch at the time the
submodule is added.
* It's not clear that `submodule.<name>.branch` is a good spot to
record the branch information required by dataladgh-1424.
`submodule.<name>.branch` is about which _remote_ branch is used
when `--remote` is passed to `submodule update`. The goal in
dataladgh-1424 seems to be tracking what the current _local_ branch was
at the time of a save. Given these different purposes, it seems
like it'd be a good idea to track this information in a different
way (perhaps an entry in .gitmodules with a different key).
Given these issues, let's revert the changes from 2fda83e, along
with the changes from the follow-up commit ee50107 (BF: Do not
record adjust branch in submodule config, 2019-10-21).
Fixes datalad#4373.