【问题标题】:Update cscope db and ctags for just modified files in large projects为大型项目中刚刚修改的文件更新 cscope db 和 ctags
【发布时间】:2016-05-15 20:36:24
【问题描述】:

假设我在 c project 中有大约 100000 个 *.c *.h 文件。我使用find 命令将它列到 cscope.files 中,然后从它们创建 cscope.out 和标记文件,如下所示。

1. find `pwd` -type f \( -name "*.c" -o -name "*.h" \) > cscope.files
2. /usr/bin/ctags -L cscope.files
3. cscope -b -i cscope.files -f cscope.out

这样做需要 25 - 30 分钟的时间。如果我修改单个 c 文件,那么如果我想更新 ctags,那么它大约需要 20 分钟,因为我正在更新整个 c project(即步骤 2,3)。那么有什么方法可以更快地更新 cscope.out 和标签文件,只需更新它们以更改 c 文件。

【问题讨论】:

  • 是的,我肯定也会对这样的事情感兴趣,因为我的项目不需要那么长的时间,但足够长的时间,一些增量选项会有所帮助......你明白了吗以任何方式解决@ypp?

标签: ctags cscope


【解决方案1】:

您可以使用 ctags 为一组文件生成标签(修改时间大于 .tags 修改时间)并使用 --append 开关将结果附加到当前存在的标签:

ctags --recurse --verbose --append --extra=+q --fields=+aimS --c-kinds=+p --c++-kinds=+p -L list_of_files

更多信息:https://gist.github.com/Flolagale/5195934

【讨论】:

    猜你喜欢
    • 2023-03-06
    • 2012-04-26
    • 1970-01-01
    • 2022-06-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多