• 
      

    [WIP] SubGit support

    Review Request #7078 — Created March 18, 2015 and discarded — Latest diff uploaded

    Information

    RBTools
    master

    Reviewers

    RBTools currently supports interacting with reviews from a git-svn clone; it jumps through some hoops specific to git-svn to make everything happy from the perspective of the ReviewBoard API and backend SVN repo. However, it has no such support for SubGit, which is (IMHO) a far superior translation tool. This PR aims to provide that support, so that "rbt post" and other operations Just Work™ when the local git repo is a clone of a SubGit mirror.

    Assuming that you have a setup like this:

    [subgit-server] $ subgit configure --svn-url svn+ssh://svn.example.com/path/to/repo ./repo.git
    [subgit-server] $ $EDITOR repo.git/subgit/config repo.git/subgit/authors.txt
    [subgit-server] $ subgit install ./repo.git
    
    [some-client] $ git clone ssh://subgit-server.example.com/repo.git
    

    the following commands should work:

    [some-client] $ cd repo.git
    [some-client] $ gco feature/awesome
    [some-client] $ rbt diff
    [some-client] $ rbt post
    [some-client] $ gco feature/depends_on_awesome
    [some-client] $ rbt post --parent feature/awesome
    

    and possibly others, but that is most of my workflow (besides adding backend-agnostic options to the above commands, such as --diff-only or --change-description, etc).

    This PR is currently mostly for discussion value, as there are some significant known limitations:
    1) No tests (yet).
    - There were also no tests for git-svn when I started
    - I plan to run my new (forthcoming) tests against both kinds of translation

    2) Requires SSH access to the SubGit mirror host.
    - RBTools must inspect the SubGit configuration to determine the SVN URL.
    - There's a git config option you can set to specify it explicitly, but this is not currently documented, and it should probably be a .reviewboardrc option instead.

    3) It's obviously way behind master. I will rebase and re-verify once I have a bunch of tests.

    Also inviting the SubGit folks to participate in this discussion.

    No unit tests yet (see above), but I use it for my day-to-day development and code review. I've been using the current version for a month or two without any problems (especially since the most recent commits in which I fixed a bug with --parent).