如何使用 ClearCase 在代码中找到最初添加字符串的位置?
How to find where a string was added at first in code, with ClearCase?
我想查找在代码中添加了特定字符串的哪个 ClearCase 标签?
我正在使用基本的 ClearCase。
我recommended before (8 years ago) to limit the scope of your search and use the exec
clause of a cleartool find
.
示例:
cleartool find -all -type f -user myLogin \
-version "lbtype(A_LABEL)" \
-exec ...
如果可以在动态视图中执行此操作,则可以直接 grep CLEARCASE_XPN
的内容,cleartool find
为找到的每个版本设置的变量。
它引用了一个 extended pathname ,(在动态视图中)您可以直接读取和 grep 查找您的代码)
您可以对您在 Vob 中找到的每个标签执行此操作,从最旧到最新。
Z:myvob>ct lstype -kind lbtype -short
Z:myvob>ct find . -version "lbtype(A_LABEL)" -print
如果您正在寻找给定源文件中的特定更改,cleartool annotate 命令将为您提供一个良好的开端。如果您熟悉 GIT,这相当于 "git blame."
仅当元素是其中一种文本文件类型(text_file、utf?_text_file 等)时注释才有效,因为这些文件基于每个版本存储增量信息。
需要注意的是,这会告诉您更改来自哪个版本,但如果该版本是由合并创建的,您可能必须回溯合并以找到更改的原始位置。如果我没记错的话,ALMToolbox 的 "visual annotate" 工具可以为您做到这一点。
我想查找在代码中添加了特定字符串的哪个 ClearCase 标签?
我正在使用基本的 ClearCase。
我recommended before (8 years ago) to limit the scope of your search and use the exec
clause of a cleartool find
.
示例:
cleartool find -all -type f -user myLogin \
-version "lbtype(A_LABEL)" \
-exec ...
如果可以在动态视图中执行此操作,则可以直接 grep CLEARCASE_XPN
的内容,cleartool find
为找到的每个版本设置的变量。
它引用了一个 extended pathname ,(在动态视图中)您可以直接读取和 grep 查找您的代码)
您可以对您在 Vob 中找到的每个标签执行此操作,从最旧到最新。
Z:myvob>ct lstype -kind lbtype -short
Z:myvob>ct find . -version "lbtype(A_LABEL)" -print
如果您正在寻找给定源文件中的特定更改,cleartool annotate 命令将为您提供一个良好的开端。如果您熟悉 GIT,这相当于 "git blame."
仅当元素是其中一种文本文件类型(text_file、utf?_text_file 等)时注释才有效,因为这些文件基于每个版本存储增量信息。
需要注意的是,这会告诉您更改来自哪个版本,但如果该版本是由合并创建的,您可能必须回溯合并以找到更改的原始位置。如果我没记错的话,ALMToolbox 的 "visual annotate" 工具可以为您做到这一点。