Wireshark-dev: Re: [Wireshark-dev] How to clone 1.12 branch source code
From: Jeff Morriss <jeff.morriss.ws@xxxxxxxxx>
Date: Mon, 16 Jun 2014 13:33:45 -0400
On 06/16/14 11:05, Evan Huus wrote:
On Mon, Jun 16, 2014 at 8:00 AM, Jeff Morriss <jeff.morriss.ws@xxxxxxxxx
<mailto:jeff.morriss.ws@xxxxxxxxx>> wrote:

    [I merged a couple of forks of this thread to show more history
    before responding.]


    On 06/15/14 10:51, Richard Sharpe wrote:
    Le 15/06/2014 14:02, Jeff Morriss a écrit :

            On Sun, Jun 15, 2014 at 4:31 AM, wsgd <wsgd@xxxxxxx
            <mailto:wsgd@xxxxxxx>> wrote:

                Must be possible to clone directly the good branch, no ?

     >> git clone --branch master-1.12
    https://code.wireshark.org/__review/wireshark
    <https://code.wireshark.org/review/wireshark> master-1.12


        Why would you want to do that when you can clone the whole thing and
        then just check out what you want?


    Why clone master when you really want master-1.12?

    Before I RTFM'd and discovered the --branch command I used to do as
    you suggest but it seemed quite a waste:

    git clone [...] master-1.12

    git checkout origin/master-1.12 -b master-1.12
    git branch -D master

    Note that I really want a separate directory that is dedicated to
    master-1.12.  The whole do-everything-in-one-directory thing takes
    entirely too long (right now I can test a fuzz failure against 3 or
    more branches in parallel without even having to wait for a
    recompile let alone deal with all the mess that gets left behind
    when switching major branches--look at git status after switching
    from a master-1.10 compile to master for an example).


On Unixen (all non-windows platforms) git ships with an additional
script hidden away called 'git-new-workdir' which allows you to do just
that by using symlinks, so you can have multiple working directories on
multiple branches, all working off of a single actual clone.

Caveats are:
- I have no idea how to do that on Windows
- If you accidentally break the implicit rules (i.e. you checkout master
in your master-1.12 directory) all hell breaks loose.

Yeah, I saw that mentioned here before but never bothered. Disk space is cheap. :-) (And I've already had to wipe out and rebuild my git directories enough times that I'm wary of trying any new commands...)