Search code examples
gitsvngit-svn

How to find the git hash for an svn revision when git mirror of an svn repo is used?


I would like to use git when experimenting with llvm and clang code. Therefore I already cloned the source files from the git mirror:

% git clone http://llvm.org/git/llvm.git
% cd llvm/tools
% git clone http://llvm.org/git/clang.git

Now I would like to use 3.4.2 as a base of my work. I've found that it is svn Revision 216818 for llvm and for clang. But I am lost how to find the appropriate git hash for that so I could do this:

% git checkout -b myexperiment githash_of_svnrelease_342_final_of_LLVM
% cd tools/clang
% git checkout -b myexperiment githash_of_svnrelease_342_final_of_CLANG

Solution

  • Since then I've found that I should be able to find the git hash for a specific svn revision like this:

    % git svn log --show-commit -r216818
    

    This is documented in the git-svn manual. However in this very specific case of clang rev216818 the above command does not give me the git hash. This is probably because the llvm and clang git mirrors reflect only the svn trunk for each project. So if I'd like to fork my branch from the svn tag tags/RELEASE_342/final, than I have no other choice than to use git-svn as it is documented in the llvm documentation.