找出谁编写/编辑了这行代码的最简单方法是什么?
这显然需要源文件处于源代码控制之下。 理想情况下,我想要一个在 IDE(Eclipse、Visual Studio 等)下工作的工具 - 但外部工具也很好。 显然,可以手动浏览文件的先前版本,并比较各个版本,但我正在寻找一种方法来快速查看谁负责代码部分。
我正在使用 CVS,但该工具理想情况下应该与不同的源代码控制系统一起使用。
This obviously requires the source file to be under source control. I would ideally like a tool which works under the IDE (Eclipse, Visual Studio, etc) - but an external tool would be nice, too. Obviously, it is possible manually go through previous versions of the file, and compare the various versions, but I am looking for a way to be able to see quickly who is responsible for a code section.
I am using CVS, but the tool should ideally work with different source control systems.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
这看起来像 责备函数,在 使用 CVS 的 Eclipse,或使用 Subversion(也在 eclipse 中)
正如您所提到的,该功能的 eclipse 名称是 显示注释。
That looks like the blame function, supported in eclipse with CVS, or with Subversion (also in eclipse)
As you mention, the eclipse-name for that feature is Show Annotations.
您没有提及您正在使用哪个源代码控制。
如果你使用 Subversion,你可以看一下:
:)
You don't mention wich source control are you using.
If you're using Subversion, you can take a look at:
:)
适用于带有 TFS 的 Visual Studio .NET。
该功能是“Annotate”,其工作方式与 Blame 几乎相同。
(我个人将这些称为团队的猎巫工具)。
For Visual Studio .NET with TFS.
The function is "Annotate" and works pretty much the same with Blame.
(personally I refer to these as the team's witch hunt tool).
这个问题相当广泛/开放。 无论如何,这是一个好主意,可以作为参考......
在工作中,我使用Perforce及其图形界面。 延时视图允许查看文件的每一行、已更改的修订版本以及详细信息(谁提交了更改、何时提交等)。 您可以移动滑块来查看以前的版本。
有一个命令行版本:
p4 annotate
。我开始使用 Mercurial,所以我看了它。 版本控制系统比较(好网站,我刚刚发现它)显示该命令是
hg annotate
。The question is quite broad/open. Somehow, it is a good idea, it can be used as reference...
At work, I use Perforce with its graphical interface. The Time-lapse view allows to see the file with, for each line, the revision version in which it has been changed, and details (who submitted the change, when, etc.). And you can move a slider to see previous versions.
There is a command line version:
p4 annotate
.I am starting to use Mercurial so I looked at it. Version control systems comparison (good site, I just discovered it) shows that the command is
hg annotate
.在许多版本控制系统中,包括 CVS,Perforce,AccuRev,Mercurial 和 Team Foundation Server,命令是
注释
。在 Subversion 和 RCS,命令是
blame
。
例如,使用 CVS:
将创建
foo_changes.txt
,其中列出与当前版本的foo.cc
中每行的最新更改相关的修订号和用户名。 使用不同的选项将为您提供文件的先前版本或标记版本的相同信息。我也需要回答这个问题,但是当我阅读已经发布的答案时,它并没有立即跳出来,所以希望这个总结应该有所帮助。
In many version control systems including CVS, Perforce, AccuRev, Mercurial, and Team Foundation Server, the command is
annotate
.In Subversion and RCS, the command is
blame
.For example, with CVS:
will create
foo_changes.txt
, which lists the revision number and username associated with the most recent change for each line in the current version offoo.cc
. Using different options will give you the same info for previous versions or tagged versions of the file.I needed this question answered too, but it didn't jump out at me right away when reading the answers already posted, so hopefully this summary should help.
在 AccuRev 中,使用注释 +“版本滑块”功能更加智能,您可以选择浏览历史文件的注释版本:(
不仅谁更改了最新版本的内容,还包括 所有修订版)
(来源:accurev.com)
In AccuRev this is even smarter with the annotate + "version slider" function, which will give you the option to browse through the annotated version of the file in history:
(Not only who changed what on the latest revision, but also on all revisions)
(source: accurev.com)
对于 Eclipse 中的 perforce 插件,注释未显示在上下文菜单中。
所以我需要使用:
p4 annotate my-file
然后使用 Eclipse 浏览历史记录。For perforce plugin in Eclipse annotate is not showing up in the context menu.
So I need to use:
p4 annotate my-file
and then using Eclipse browse the history.