Define mirror targets one way: remote.<name>.<field>
There were two spellings for the same thing -- a flat remoteurl/remotekey/remotetype/remotevisibility set for a single server, and remote.<name>.* blocks for several. The flat one is gone; every target, including a lone one, is now a named block with the fields url, key, type and visibility. An existing ~/.mgshrc is converted on the next start. Only the key is rewritten, so values, comments, alignment, commented-out lines and the file's 0600 mode survive untouched, and mgsh prints each rename rather than doing it quietly. The target is named "public", which is what the old settings called the git remote they created, so a converted setup keeps pushing to the same place under the same remote name. A file that carries both spellings keeps what the new one says. The environment follows the same shape: MGSH_REMOTEURL and friends are replaced by MGSH_REMOTE_<NAME>_<FIELD>, so MGSH_REMOTE_GITLAB_KEY sets remote.gitlab.key. The field is read from the end of the variable name, which leaves target names free to contain underscores. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -147,7 +147,6 @@ func configKeys() []string {
|
||||
keys := []string{
|
||||
"base", "githost", "gitport", "gituser", "gitpath", "gitkey",
|
||||
"gitname", "gitemail", "pushdefault", "editor",
|
||||
"remoteurl", "remotekey", "remotetype", "remotevisibility",
|
||||
"remotes", "mirror", "secretscan",
|
||||
}
|
||||
sort.Strings(keys)
|
||||
|
||||
Reference in New Issue
Block a user