submodules?

263 views
Skip to first unread message

Filip Kinský

unread,
Feb 10, 2012, 7:08:28 AM2/10/12
to git-t...@googlegroups.com
I have to work with quite badly structured TFS repository which looks like this:

/DEV/Java
       /....
       /.NET

/TESTS/Java
           /...
           /.NET

I need to work with /DEV/.NET and /TESTS/.NET subdirectories at the same time (make commits over both subdirs), but I don't want to checkout whole huge TFS repository. Is there any possibility how to solve this problem? I was reading about git submodules, but I'm just basic git user and never used it before even in plain git, so I'd like to know if it's possible in combination with TFS at all..

Anyone already faced/solved problem like this before?

Ivan Danilov

unread,
Feb 10, 2012, 8:22:55 AM2/10/12
to git-t...@googlegroups.com
git submodules are useful when tiy need to separate several code pieces to several repositories and have dependencies between them under control (i.e. have ability to develop first piece without breaking second until first is done).
I don't think that submodules will help you here.

If you have the option to change TFS structure - I would suggest to move these one level lower, i.e. not in root $/ folder but rather somewhere in $/Main. One could argue also that it will be more correctly as well, because it will allow clear branching strategy, e.g. $/FirstBranch is just an another version of $/Main. Entire $/Main. With current structure you can't branch clearly at all, because some part of your code will be left.

If you have no luxury of changing TFS structure... afair, git-tfs now can't clone root folder $/ due to plain check that was added because of some minor technical issues (but mainly because it was not anticipated and seemed unnecessary back then). Probably the only sane option for you if you want to integrate with git is to poke with sources and remove check - and to do something about these issues later of course.

Take a look here also: https://github.com/git-tfs/git-tfs/issues/85

Filip Kinský

unread,
Feb 11, 2012, 2:28:29 PM2/11/12
to git-t...@googlegroups.com
Thanks for your detailed response. Unfortunately I'm not able to change TFS structure, so it looks like I'm done here ;( Or I can play with git-tfs sources if I find enough time - it could be possible to add some new "ignore" option to git tfs clone command or something similar...

Ivan Danilov

unread,
Feb 12, 2012, 4:59:23 PM2/12/12
to git-t...@googlegroups.com
The problem is not in ignore - git-tfs already can ignore files given by regex pattern. Problem is that you can't clone root path $/

Filip Kinský

unread,
Feb 13, 2012, 2:31:02 AM2/13/12
to git-t...@googlegroups.com
I see.. Will try to play with --ignore-regex, because it looks like it could be sufficient for my current problem. I don't have the $/ problem actually - the paths I wrote in my initial post were just samples and the real paths are nested in one more directory ($/DEV/.NET and $/DEV/TESTS/.NET), so I should be able to clone $/DEV with --ignore-regex option to ignore the directories I'm not interested in.

Thanks a lot for your support.

Ivan Danilov

unread,
Feb 13, 2012, 7:15:53 AM2/13/12
to git-t...@googlegroups.com
Oh, in this case everything should be more or less fine.

Charles Josephs

unread,
Feb 26, 2013, 11:33:00 AM2/26/13
to git-t...@googlegroups.com
I have this exact scenario but in addition git-tfs craps out if I try to let it just get everything. It's fine if I get each source tree separately, but I think it craps out on something in one of the other folders that I don't really care about anyway. 

With a TFS structure like:
/Project
    /LibSource
    /AppSource
    /Releases
    /Documentation
    /Other

I just want LibSource and AppSource.  I tried something like --ignore-regex='Releases|Documentation|Other' but it doesn't seem to have any effect. It does not report any errors with my regex but using the --debug flag it's clear that git-tfs is still downloading all files even in the ignored paths and it does ultimately crap out. Any suggestions? Am I just using --ignore-regex incorrectly? I'm not a regex master by any means but I'm no novice either. 

Matt Burke

unread,
Feb 26, 2013, 12:53:11 PM2/26/13
to git-t...@googlegroups.com
On Tue, Feb 26, 2013 at 11:33 AM, Charles Josephs <cjos...@gmail.com> wrote:
> I just want LibSource and AppSource. I tried something like
> --ignore-regex='Releases|Documentation|Other' but it doesn't seem to have
> any effect. It does not report any errors with my regex but using the
> --debug flag it's clear that git-tfs is still downloading all files even in
> the ignored paths and it does ultimately crap out. Any suggestions? Am I
> just using --ignore-regex incorrectly? I'm not a regex master by any means
> but I'm no novice either.

It looks like you're doing it right. Could you check that the regex
gets into the .git/config file correctly in your repository?

Charles Josephs

unread,
Feb 26, 2013, 1:16:53 PM2/26/13
to git-t...@googlegroups.com
This is what makes it into the config file:

[tfs-remote "default"]
ignore-paths = Releases|Documentation|Other
url = ...
repository = $/Project
fetch = refs/remotes/default/master

Charles Josephs

unread,
Feb 26, 2013, 1:19:03 PM2/26/13
to git-t...@googlegroups.com
Also, using --debug here's some sample output showing it is downloading files it shouldn't be..

get [C9]$/Project/Documentation/Testing/REQ02.docx
get [C9]$/Project/Documentation/Testing/REQ03.docx
get [C9]$/Project/Documentation/Testing/REQ04.docx
get [C9]$/Project/Documentation/Testing/REQ05.docx

Matt Burke

unread,
Feb 26, 2013, 3:22:50 PM2/26/13
to git-t...@googlegroups.com
The config looks right, but the behavior doesn't. I started a pull
request (https://github.com/git-tfs/git-tfs/pull/312) with a test with
a similar scenario, and it passes. I wonder if you could check out the
test, and maybe debug into git-tfs.
> --
> You received this message because you are subscribed to the Google Groups
> "git-tfs-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to git-tfs-dev...@googlegroups.com.
> To post to this group, send email to git-t...@googlegroups.com.
> Visit this group at http://groups.google.com/group/git-tfs-dev?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

Charles Josephs

unread,
Feb 26, 2013, 3:29:52 PM2/26/13
to git-t...@googlegroups.com
I'd like to but I'm running a pure vs2012 environment and I had trouble installing the VS 2008 and 2010 SDKs so I can't get git-tfs to compile unfortunately..

Matt Burke

unread,
Feb 26, 2013, 3:31:28 PM2/26/13
to git-t...@googlegroups.com
You can turn off the VS2008 and VS2010 projects in GitTfs and only
build the vs11/2012 adapter.

Filip Kinský

unread,
Feb 26, 2013, 4:15:20 PM2/26/13
to git-t...@googlegroups.com
Do you really have the ignore pattern matching the root of the TFS path you're cloning? I have TFS structure like this:

/ROOT
  /DEV
    /JAVA
    /NET
  /DOCS

And I successfully clone from TFS using this command:
git tfs quick-clone --ignore-regex="^DEV/JAVA|^DOCS" https://mytfs $/TFSXY/ROOT


--
You received this message because you are subscribed to a topic in the Google Groups "git-tfs-dev" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/git-tfs-dev/DQD01XEh7NQ/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to git-tfs-dev...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages