Git SVN如何忽略路径工作(忽略每日构建标签)? [英] How do Git SVN ignore-paths work (ignoring daily build tags)?
问题描述
我试图用git svn克隆一个svn仓库。该存储库具有我想要忽略的标记的每日构建。我试图使用忽略路径选项来做到这一点,但我仍然将日常构建标记作为分支存储在我的存储库中。
一个非常新的相似(但迄今尚未回答)的问题在这里:
如何git svn只获取具有特定模式的分支/标签?
版本库布局 - https://test.kuali.org/svn/rice
General Repository结构
- 分支
- 分支1
-
-
-
- 标签
-
- 忽略目录1
- 标记1
- 标记2
- 旧
- 旧标记1
- 旧标记2
-
- 每日构建1
- 每日构建2
$ b
-
$ b我试过的是什么
我对正则表达式并不擅长,他们可能是错误的,但这里是我的尝试:
这只是我在git svn文档中找到的一个修改版本:
git svn clone -r15709:HEAD --prefix = svn / --stdlayout --no-follow-parent --ignore-paths =^ [^ /] + /(?: tags / builds | tags / old | branches)https://test.kuali.org/svn/rice
这是我试图简化:
git svn clone -r15709:HEAD --prefix = svn / --stdlayout --no -follow-parent --ignore-paths =(old | builds)https://test.kuali.org/svn/rice rice-full
绝望......(并添加一些我不需要的其他路径)
git svn clone -r15711:HEAD --prefix = svn / --stdlayout --ignore-paths =^ [^ /] + /(?: builds | old)| inactive | rice-functional-tests | sandbox | toolshttps://test.kuali.org/svn/rice
然后我切换到更新的版本,因此它会尽快完成,并尝试忽略所有分支和标签进行测试。这似乎没有得到任何分支和标签,但它也没有完成。它似乎冻结了(至少它运行的时间比我想它应该只有一两天的历史还要长):
git svn clone -r21846:HEAD --prefix = svn / --stdlayout --ignore-paths =^ tags * | ^ branches *https://test.kuali.org/svn/rice
我试过的最后一个是:
git svn clone -r15711:HEAD --prefix = svn / --stdlayout --ignore-paths =^ tags / old * | ^ tags / builds * | ^ inactive * | ^ rice-functional-测试* | ^ sandbox * | ^ tools *https://test.kuali.org/svn/rice
一般思考和问题
-
我不确定ignore-paths正则表达式匹配的是什么。它是svn仓库的相对路径(tags / builds / Daily build 1)吗?是否对项目中的每个文件(标签/构建/每日构建1 /文件1,标记/构建/每日构建1 /文件2)或仅在分支/标记级别(标记/构建/每日构建1)进行评估?它是否包含存储库基础网址( https://test.kuali.org/ svn / rice / tags / builds / Daily build 1)?
-
除了--stdlayout之外还有什么我应该做的(指定一个正则表达式可以得到我想要的标签)?
-
我只对trunk和某些发布标签感兴趣。有没有更好的方法来获得这些?我尝试过只使用trunk的克隆,然后在配置文件中添加一个fetch =,只添加我关心的标签,然后获取标签的修订版本,但是当我在git gui中查看结果时(可视化所有分支)这两个标签显示为一次提交浮动(不限于中继或其他)。
-
- branches
- Branch 1
- Ignore Directory 1
- Ignore Directory 1
- tags
- Tag 1
- Tag 2
- old
- Old Tag 1
- Old Tag 2
- builds
- Daily build 1
- Daily build 2
- trunk
不是确定它是否相关,但我在Windows 7 64位机器上使用msysgit(git version 1.7.3.1.msysgit.0)。
长问题,我知道...我只是想彻底。
c $ c> git svn clone -T http:// path / to / trunk ),然后通过修改配置文件并执行 git svn fetch
es来添加所需的特定标签和分支。
I am trying clone an svn repository using git svn. The repository has daily builds tagged which I want to ignore. I am trying to use the "ignore-paths" option to do that, but I am still getting the daily build tags as branches in my repository.
A very recent and similar (but so far unanswered) question is here: How to git svn fetch only branches/tags with certain patterns?
Repository Layout - https://test.kuali.org/svn/rice
General Repository Structure
What I have Tried
I am not that great at regular expressions, and they might be wrong, but here is what I've tried:
This was just a modified version of something I found in the git svn documentation:
git svn clone -r15709:HEAD --prefix=svn/ --stdlayout --no-follow-parent --ignore-paths="^[^/]+/(?:tags/builds|tags/old|branches)" https://test.kuali.org/svn/rice
This was me trying to simplify:
git svn clone -r15709:HEAD --prefix=svn/ --stdlayout --no-follow-parent --ignore-paths="(old|builds)" https://test.kuali.org/svn/rice rice-full
Desperation... (and adding some other paths I didn't need)
git svn clone -r15711:HEAD --prefix=svn/ --stdlayout --ignore-paths="^[^/]+/(?:builds|old)|inactive|rice-functional-tests|sandbox|tools" https://test.kuali.org/svn/rice
Then I switched to a more recent revision so it would finish sooner and tried ignoring all branches and tags for a test. This one seemed not to get any branches and tags, but it also never finished. It seemed to freeze (at least, it ran longer than I thought it should have for only getting a day or two of history):
git svn clone -r21846:HEAD --prefix=svn/ --stdlayout --ignore-paths="^tags*|^branches*" https://test.kuali.org/svn/rice
The last one I tried was:
git svn clone -r15711:HEAD --prefix=svn/ --stdlayout --ignore-paths="^tags/old*|^tags/builds*|^inactive*|^rice-functional-tests*|^sandbox*|^tools*" https://test.kuali.org/svn/rice
General Thoughts and Questions
I'm not sure exactly what the ignore-paths regular expression is matching against. Is it the relative path of the svn repository (tags/builds/Daily build 1)? Is it evaluated for each file in the project (tags/builds/Daily build 1/file 1, tags/builds/Daily build 1/file 2) or just at the branch/tag level (tags/builds/Daily build 1)? Does it include the repository base url (https://test.kuali.org/svn/rice/tags/builds/Daily build 1)?
Is there something I should be doing other than --stdlayout (specifying a regular expression for the tags that would get what I want)?
I am only interested in trunk and certain release tags. Is there a better way to get those? I have tried cloning with only trunk, then adding a "fetch=" in the config to add only the tags I care about, then fetch the revision those were tagged from, but when I look at the result in git gui (visualize all branches) the two tags show up as floating with a single commit (not tied to trunk or each other).
Not sure if it is relavant, but I am using msysgit (git version 1.7.3.1.msysgit.0) on a windows 7 64 bit machine.
Long question, I know... I just wanted to be thorough.
It might be easier to just clone the trunk and nothing else (git svn clone -T http://path/to/trunk
), and then add the specific tags and branches you want by modifying the config file and doing git svn fetch
es.
这篇关于Git SVN如何忽略路径工作(忽略每日构建标签)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!