git-svn “Couldn't find revmap”- what does it mean?

后端 未结 2 1900
囚心锁ツ
囚心锁ツ 2021-02-01 14:32

When running git svn clone and often during subsequent git svn fetch operations I get this message for a number of folders:

Couldn\'t f         


        
2条回答
  •  悲哀的现实
    2021-02-01 14:54

    Just wanted to note - there is actually a hidden file in git-svn, called something like

    .git/svn/refs/remotes/git-svn/.rev_map.00088888-caaa-4444-9999-2222eeeeeee4
    

    ... where the closing id is the Repository UUID or git-svn-id.

    This is a binary file, and there is a bit more on it in /usr/lib/git-core/git-svn:

    # rev_map: ...
    # This is the replacement for the rev_db format, which was too big
    # and inefficient for large repositories with a lot of sparse history
    # (mainly tags)
    #
    # The format is this:
    #   - 24 bytes for every record,
    #     * 4 bytes for the integer representing an SVN revision number
    #     * 20 bytes representing the sha1 of a git commit
    ...
    #   - Piping the file to xxd -c24 is a good way of dumping it for
    #     viewing or editing (piped back through xxd -r), should the need
    #     ever arise.
    

    Note that output looks something like this:

    $ cat .git/svn/refs/remotes/git-svn/.rev_map.*  | xxd -c24 | head -1
    0000000: 0000 0001 33ee 22cc 9933 88aa 44ff 22dd 5566 88ee 66aa bbcc  ....5.'..?..J...Zj..`...
    

    I think that when you type git svn info, it is this file which is consulted, so that you get an SVN revision number based on the git SHA hash for a commit. I have no idea how one could reconstruct it, though (althogh git svn reset may help erasing entries from this file, not 100% sure not this)

提交回复
热议问题