Dvc: remote modify: add `name` param?

Created on 6 Apr 2020  路  12Comments  路  Source: iterative/dvc

So you can change the name of a remote e.g.

$ dvc remote add myremote some/path
$ dvc remote list
myremote some/path
$ dvc remote modify myremote name supercoolremote
$ dvc remote list
supercoolremote some/path

The workaround rn is to just add the remote again and remove the previous one. But if it has some special configuration then it's more difficult. A better workaroud is to edit the .dvc/config file but relatively advanced.

git remote lets you change a remote name BTW.

enhancement feature request p3-nice-to-have

Most helpful comment

I'd like to look into it. @jorgeorpinel How about make it dvc remote rename <old> <new> following the similar command in Git git remote rename <old> <new>.

All 12 comments

BTW if you actually run my example command to modify the inexistent name param, it gets written to .dvc/config, which causes an error output whenever you try to change the config later:

ERROR: configuration error - config file error:
extra keys not allowed @ data['remote']['myremote']['name']

You have to manually fix the config file to fix this.

which causes an error output whenever you try to change the config later:

(Yep, I hit the same issue here https://github.com/iterative/dvc/issues/3552 - quite annoying one :) )

A better workaroud is to edit the .dvc/config file but relatively advanced.

not sure this is very advanced to be honest

Not advanced in terms of skill, but you need to know that remote config is in that file. It won't be obvious knowledge for DVC beginners. Also for gdrive remotes the file in .dvc/tmp/...json would also need to be changed manually, I think (if it already exists).

Also for gdrive remotes the file in .dvc/tmp/...json would also need to be changed manually, I think (if it already exists).

it doesn't contain the remote name yet. With GDrive multiple remotes are not supported effectively yet.

It won't be obvious knowledge for DVC beginners.

it's a good question. I think for people familiar with command line, git, etc it should be more or less intuitive that there is a config somewhere.

OK. No strong opinion. I would err on the side of adding this which I'm assuming should be pretty easy, since git remote allows you to do it, so you may expect this if you're used to Git. + the other reasons outlines. Feel fee to close this though, up to you! Thanks

I'd like to look into it. @jorgeorpinel How about make it dvc remote rename <old> <new> following the similar command in Git git remote rename <old> <new>.

Good idea, indeed that's how it works on Git. But since we already have a modify subcommand to change all possible remote config I'd prefer to add a name config param for that.

It does not hurt to add both? Is there some modify command analog in GIt?

Not really. They have a subcommand for each remote config param you can change: https://git-scm.com/docs/git-remote

name is ugly. dvc remote rename is much better.

Plus name complicates the argument resolution, I really don't like that and don't think it is worth bothering with. Let's just introduce dvc remote rename as suggested by @karajan1001 .

I have no strong opinion. Either introduce name to https://dvc.org/doc/command-reference/remote/modify#available-parameters-for-all-remotes (implies less maintenance both in core code and docs) or introduce rename subcommand.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dmpetrov picture dmpetrov  路  64Comments

luchoPipe87 picture luchoPipe87  路  69Comments

JoeyCarson picture JoeyCarson  路  53Comments

Suor picture Suor  路  39Comments

ynop picture ynop  路  41Comments