SourceInsight大项目添加文件列表 AddFromList

6110阅读 0评论2017-09-27 vivieu
分类:Windows平台

SourceInsight大项目添加文件列表 AddFromList

问题:
TI motorware 项目代码按模块组织,目录层次多,文件分散。在建立SourceInsight工程时,
手工添加这么多文件是不实现的,有什么方法批量添加需要的文件呢?

分析:
哪些是需要的文件?提交到git的文件是需要的,具体见.gitignore (只保留 28027F、foc、32b 相关文件)。

解决:
先利用git得到需要添加的文件列表。
// git ls-files --full-name | sed 's\^\c:/ti/motorware/motorware_1_01_00_13/sw/&\' > t.txt
git ls-files --full-name | awk -v prefix=`pwd` '/.[hc]$/{sub("^/c/","c:/",prefix); print prefix "/" $0}' > t.txt

然后执行 SourceInsight 菜单 Add and Remove Project Files...(M)/Add from List 即可。


REF:

List files in local git repo? - Stack Overflow

This command:
// git ls-tree --full-tree -r HEAD
lists all of the already committed files being tracked by your git repo.

Try this command:
git ls-files 
This lists all of the files in the repository, including those that are only staged but not yet committed.

sed在行首或者行尾添加内容 - 明之道 - 博客园
http://www.cnblogs.com/ITEagle/archive/2013/06/20/3145546.html

Unix awk 使用手册
~yhf/tutorial/awk_manual.html


上一篇:PDF拼接
下一篇:推荐一个贴图(含截图等功能)神器 snipaste