dolthub / doltpy

A Python API for Dolt
Apache License 2.0
55 stars 13 forks source link

Renaming branch fails #105

Closed louisrigot closed 3 years ago

louisrigot commented 3 years ago

If I want to rename a branch, for example renaming master into main:

repo.branch("master", new_branch="main", move=True)

it fails

doltpy.core.dolt.DoltException: (['dolt', 'branch', '--move', 'master', 'm', 'a', 'i', 'n'], b'usage: dolt branch [--list] [-v] [-a] [-r]\n   or: dolt branch [-f] <branchname> [<start-point>]\n   or: dolt branch -m [-f] [<oldbranch>] <newbranch>\n   or: dolt branch -c [-f] [<oldbranch>] <newbranch>\n   or: dolt branch -d [-f] [-r] <branchname>...\n\nSpecific dolt branch options\n    <start-point>\n      A commit that a new branch should point at.\n    \n    --list\n      List branches\n    \n    -f, --force\n      Reset <branchname> to <startpoint>, even if <branchname> exists already. Without -f, dolt branch refuses to change an\n      existing branch. In combination with -d (or --delete), allow deleting the branch irrespective of its merged status. In\n      combination with -m (or --move), allow renaming the branch even if the new branch name already exists, the same applies\n      for -c (or --copy).\n    \n    -c, --copy\n      Create a copy of a branch.\n    \n    -m, --move\n      Move/rename a branch\n    \n    -d, --delete\n      Delete a branch. The branch must be fully merged in its upstream branch.\n    \n    --D\n      Shortcut for --delete --force.\n    \n    -v, --verbose\n      When in list mode, show the hash and commit subject line for each head\n    \n    -a, --all\n      When in list mode, shows remote tracked branches\n    \n    -r, --remote\n      When in list mode, show only remote tracked branches. When with -d, delete a remote tracking branch.\n    \n    --show-current\n      Print the name of the current branch\n    \n', b'', 1)
timsehn commented 3 years ago

Thanks. we'll look into this.

On Mon, Nov 16, 2020 at 10:49 AM Louis Rigot notifications@github.com wrote:

If I want to rename a branch, for example renaming master into main:

repo.branch("master", new_branch="main", move=True)

it fails

doltpy.core.dolt.DoltException: (['dolt', 'branch', '--move', 'master', 'm', 'a', 'i', 'n'], b'usage: dolt branch [--list] [-v] [-a] [-r]\n or: dolt branch [-f] []\n or: dolt branch -m [-f] [] \n or: dolt branch -c [-f] [] \n or: dolt branch -d [-f] [-r] ...\n\nSpecific dolt branch options\n \n A commit that a new branch should point at.\n \n --list\n List branches\n \n -f, --force\n Reset to , even if exists already. Without -f, dolt branch refuses to change an\n existing branch. In combination with -d (or --delete), allow deleting the branch irrespective of its merged status. In\n combination with -m (or --move), allow renaming the branch even if the new branch name already exists, the same applies\n for -c (or --copy).\n \n -c, --copy\n Create a copy of a branch.\n \n -m, --move\n Move/rename a branch\n \n -d, --delete\n Delete a branch. The branch must be fully merged in its upstream branch.\n \n --D\n Shortcut for --delete --force.\n \n -v, --verbose\n When in list mode, show the hash and commit subject line for each head\n \n -a, --all\n When in list mode, shows remote tracked branches\n \n -r, --remote\n When in list mode, show only remote tracked branches. When with -d, delete a remote tracking branch.\n \n --show-current\n Print the name of the current branch\n \n', b'', 1)

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/dolthub/doltpy/issues/105, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABJAR3CNHMVRNCJVC6EGHM3SQFX2PANCNFSM4TXRMITA .

timsehn commented 3 years ago

This is definitely a doltpy bug:

PS C:\Users\timse\dolthub\dolt\dolt-test> dolt branch
* master
PS C:\Users\timse\dolthub\dolt\dolt-test> dolt branch -m master main
PS C:\Users\timse\dolthub\dolt\dolt-test> dolt branch
* main

On Mon, Nov 16, 2020 at 10:51 AM Tim Sehn notifications@github.com wrote:

Thanks. we'll look into this.

On Mon, Nov 16, 2020 at 10:49 AM Louis Rigot notifications@github.com wrote:

If I want to rename a branch, for example renaming master into main:

repo.branch("master", new_branch="main", move=True)

it fails

doltpy.core.dolt.DoltException: (['dolt', 'branch', '--move', 'master', 'm', 'a', 'i', 'n'], b'usage: dolt branch [--list] [-v] [-a] [-r]\n or: dolt branch [-f] []\n or: dolt branch -m [-f] [] \n or: dolt branch -c [-f] []

\n or: dolt branch -d [-f] [-r] ...\n\nSpecific dolt branch options\n \n A commit that a new branch should point at.\n \n --list\n List branches\n \n -f, --force\n Reset to , even if exists already. Without -f, dolt branch refuses to change an\n existing branch. In combination with -d (or --delete), allow deleting the branch irrespective of its merged status. In\n combination with -m (or --move), allow renaming the branch even if the new branch name already exists, the same applies\n for -c (or --copy).\n \n -c, --copy\n Create a copy of a branch.\n \n -m, --move\n Move/rename a branch\n \n -d, --delete\n Delete a branch. The branch must be fully merged in its upstream branch.\n \n --D\n Shortcut for --delete --force.\n \n -v, --verbose\n When in list mode, show the hash and commit subject line for each head\n \n -a, --all\n When in list mode, shows remote tracked branches\n \n -r, --remote\n When in list mode, show only remote tracked branches. When with -d, delete a remote tracking branch.\n \n --show-current\n Print the name of the current branch\n \n', b'', 1) — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub , or unsubscribe < https://github.com/notifications/unsubscribe-auth/ABJAR3CNHMVRNCJVC6EGHM3SQFX2PANCNFSM4TXRMITA .

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/dolthub/doltpy/issues/105#issuecomment-728255803, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABJAR3EUT63FZ73EBQ5UST3SQFYEVANCNFSM4TXRMITA .