divvun / gut

A Git(Hub) multirepo maintenance tool
6 stars 0 forks source link

create repo from svn-cloned git repo fails on push #53

Closed snomos closed 4 years ago

snomos commented 4 years ago

Steps to reproduce:

  1. PERL_UNICODE=D git svn clone https://gtsvn.uit.no/langtech/trunk/langs/sme --authors-file=svn2git-authors.txt lang-sme/
  2. target/debug/dadmin create repo -o giellalttmp -r lang-.* -d /Users/smo036/svn2git/

The file svn2git-authors.txt is attached. /Users/smo036/svn2git/ is the local dir in which lang-sme is located. Replace with the actual path from step 1.

Step 1. stops with an error at svn rev 85005:

r85005 = 5ffc6c641376643c9feeea02a4abb3fea7e0f3ad (refs/remotes/git-svn)
tools/grammarcheckers/errordata/error-áidna.txt was not found in commit 5ffc6c641376643c9feeea02a4abb3fea7e0f3ad (r85005)

The resulting git repo still seems to be just fine (just lacking a 100k commits), and in size it should be good enough for real-world testing.

The result is the following:

$ target/debug/dadmin create repo -o giellalttmp -r lang-.* -d /Users/smo036/svn2git/
 2020-04-07T06:42:07.265Z DEBUG dadmin > Arguments: Args { command: Create(Repo(CreateRepoArgs { organisation: "giellalttmp", regex: Filter { regex: lang-.* }, dir: Some(Directory { path: "/Users/smo036/svn2git/" }), public: false, use_https: false, no_push: false })) }
 2020-04-07T06:42:07.265Z DEBUG dadmin::commands::create_repo > Create Repo CreateRepoArgs { organisation: "giellalttmp", regex: Filter { regex: lang-.* }, dir: Some(Directory { path: "/Users/smo036/svn2git/" }), public: false, use_https: false, no_push: false }
 2020-04-07T06:42:07.267Z DEBUG dadmin::commands::create_repo > Filtered sub dirs: ["/Users/smo036/svn2git/lang-sme"]
 2020-04-07T06:42:07.269Z INFO  dadmin::user                  > User path: Some("/Users/smo036/Library/Preferences/dadmin/user.toml")
 2020-04-07T06:42:07.302Z DEBUG dadmin::github::rest          > POST: https://api.github.com/orgs/giellalttmp/repos
 2020-04-07T06:42:09.039Z DEBUG dadmin::commands::create_repo > new created repo: "https://github.com/giellalttmp/lang-sme"
 2020-04-07T06:42:09.043Z DEBUG dadmin::git::push             > Branches ["git-svn"]
 2020-04-07T06:42:10.607Z DEBUG dadmin::git::push             > Push result Err(Error { code: -1, klass: 4, message: "src refspec \'refs/heads/git-svn\' does not match any existing object" })
Created repo for lang-sme successfully at: https://github.com/giellalttmp/lang-sme

The reported branch is the only one it seems:

git branch -a
  remotes/git-svn

Env. info:

svn2git-authors.txt

snomos commented 4 years ago

It seems that @albbas has had the same issue - all repos created last night are empty, which indicates that dadmin failed for him in a similar way: the repos are created, but nothing is pushed.

lenguyenthanh commented 4 years ago

Issues

The reason it was failed is: dadmin tried to push all branches (include local and remote) which is wrong. Dadmin should only push local branches.

And another problem is: the lang-sme repository doesn’t have any local branch. If you use command git branch -l -which show all local branches - it will print empty line. git branch -a will show all branches both local and remote.

Solution