0

I am using ac2git to convert my accurev depot to git repository. I am able to successfully make the conversion however when I follow the steps after creating the new repository I am unable to push the changes representing the accurev transactions that are now commits.

What I mean is I loose the history, I am only able to see the hist and the diff files when I check the commit options on bitbucket.

I followed the following steps:

python ac2git.py
cd existing-project
git add --all
git commit -m "Initial Commit"
git remote add origin http://****@bitbucket.******.git
git push -u origin master

I am new to bitbucket so I am not sure what the problem is? Has anyone tried this accurev->git->bitbucket before?

In other words, how do I move my git repository on my local created as a result of ac2git to a new repository on bitbucket ?

The commit in bitbucket gives me the diff.xml/hist.xml/stream.xml

  • What do you mean by history, the commit messages? when you run `git log` on your local repo, can you see all the data? If that is the case try running `git push --all -u origin master` – Daniel Kravetz Malabud Aug 25 '16 at 14:49
  • Yes, on my local I can, when I run the push message I get this error : src refspec master does not match any. So I looked at http://stackoverflow.com/questions/4181861/src-refspec-master-does-not-match-any-when-pushing-commits-in-git but by doing that I can only see the diff and hist file in the bitbucket commit and I can see the code history. – Shruti Srivastava Aug 25 '16 at 14:52
  • You need to add the remote repo first. `git remote add origin http://****@bitbucket.******.git` and after THAT, do the push. You can check your current remotes with `git remote`. EDIT: `set-url` is to change the url of an *existing* repo – Daniel Kravetz Malabud Aug 25 '16 at 14:54
  • Still get the error srs refspec master does not match any. When I do a git status I can see that the files are untracked. – Shruti Srivastava Aug 25 '16 at 17:00
  • Seems like a duplicate of this question http://stackoverflow.com/questions/12452042/git-error-src-refspec-master-does-not-match-any-error-failed-to-push-some-refs#12793757 – Daniel Kravetz Malabud Aug 25 '16 at 17:03
  • Didnt solve my problem. I think ill update my question to make it more clear. – Shruti Srivastava Aug 25 '16 at 20:07

2 Answers2

1

Your first step is to create a repository in BitBucket. Then you simply need to follow BitBucket's instructions:

cd /path/to/my/repo
git remote add origin http://****@bitbucket.******.git
git push -u origin --all # pushes up the repo and its refs for the first time
git push origin --tags # pushes up any tags
  • Did that, so what I get in my bitbucket repository is the diff.xml instead of the actual code. That is what I meant when I said I am not getting the history. I am attaching a screenshot of the commit. – Shruti Srivastava Aug 26 '16 at 16:40
  • It seems like you created the repo on the wrong directory. Please attach a screenshot of a `git show` and `ls` (or `dir` on Windows) – Daniel Kravetz Malabud Aug 26 '16 at 17:54
  • No, that isnt the issue. I think I know why its happening. The tool has a few bugs. It is giving me a file not found error even though the file is present., I think its relayed to the empty commits bug. – Shruti Srivastava Aug 29 '16 at 14:18
  • 1
    I am marking this solution as correct, since a different error is causing the subsequent steps to fail which would have otherwise worked. – Shruti Srivastava Aug 29 '16 at 17:51
0

I'm not 100% certain that this is what has happened but it is worth noting that the ac2git script stores a lot of metadata under refs/ac2git/* refs, including a refs that will store a hist.xml, streams.xml and diff.xml in their commit history for each of your stream's transactions. See how_it_works.md which explains about refs/ac2git/depots/<depot_number>/streams/<stream_number>/info.

Though this ref acts as a branch, it shouldn't have been pushed up by invoking git push origin -u -all since the documentation claims that this only pushes things under refs/heads/. However, in case of errors the script may not correctly checkout a branch that was converted and it may leave your local repository in a detached HEAD state where it will have actually checked out one of the internal refs.

I don't know what a git push origin -u --all would do in this case for a brand new Bitbucket repo but if it had pushed your HEAD ref up to the repo then you would get this metadata on the remote.

However, for now this is just a theory and hopefully someone will be able to use this information to piece together a more clear solution for you.

nonsensickle
  • 4,438
  • 2
  • 34
  • 61