git-new-workdir

Kohei Yoshida kohei.yoshida at gmail.com
Thu Dec 13 08:57:27 PST 2012


On 12/13/2012 10:21 AM, Lionel Elie Mamane wrote:
> On Wed, Dec 12, 2012 at 02:21:18PM -0500, Kohei Yoshida wrote:
>
>> Not following the thread fully I'm not sure what this is about.  I'm
>> guessing this is about git-new-workdir vs submodules.
>
>> To put it short, I got it to work, and so far I haven't seen any
>> major issues but some occasional oddities which I just dismiss for
>> now.
>
> What version of git do you use? I haven't gotten it to work on the
> submodules, actually. So I duplicate the submodules currently.

I use git 1.8.0.  I did upgrade my git specifically for submodules.

>
> I'd appreciate a description of how did it, actually.

Well, there is not much to it, actually.  Here is what I have/did.

I have this primary master branch

~/libo/master

and in it, submodules work more or less as expected.  It automatically 
checks out required submodules which for me is just helpcontent2.

Now, to create a new workdir for, say, libreoffice-4-0 branch, I run

cd ~/libo
git-new-workdir master libreoffice-4-0 libreoffice-4-0

I tend to name the directory the same name as the branch name. Then

cd libreoffice-4-0
ln -s ../master/src
git-new-workdir ../master/helpconent2 helpcontent2 libreoffice-4-0

to checkout helpcontent2.

That's all.

Now, I do the same with my own unpublished local branch, in which case I 
don't normally bother to create a branch for it in helpcontent2 (or any 
other submodules) due to laziness.

I would think that you probably should create a branch for the 
submodules as well to get it to work, but I skip that step for now since 
not creating a branch in the submodules doesn't seem to create major 
pain for me.  Plus I don't really push anything to any of the submodules.

Now, I didn't really want to describe my settings because I don't really 
know if this is really not causing any issues.  And unlike my previous 
settings, there is no automatic script to set up a new workdir.  But it 
seems to just work fine for me.

>> To me git-new-workdir is not about diskspace, but about avoiding the
>> hassle of managing multiple local repos.  Keeping it in one local
>> repo make it easier to manage especially when I tend to cherry-pick
>> between branches quite a lot.
>
> Exactly. In its absence, you have to constantly push/pull from one
> local repo to the other, and that's a hassle.

Yup, and I prefer not having to do it.

Kohei

-- 
Kohei Yoshida, LibreOffice hacker, Calc


More information about the LibreOffice mailing list