找出谁编写/编辑了这行代码的最简单方法是什么?

发布于 2024-07-09 22:43:01 字数 186 浏览 5 评论 0原文

这显然需要源文件处于源代码控制之下。 理想情况下,我想要一个在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(7

回忆追雨的时光 2024-07-16 22:43:01

这看起来像 责备函数,在 使用 CVS 的 Eclipse,或使用 Subversion(也在 eclipse 中)

正如您所提到的,该功能的 eclipse 名称是 显示注释

Eclipse Show-Annotations

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.

Eclipse Show-Annotations

°如果伤别离去 2024-07-16 22:43:01

您没有提及您正在使用哪个源代码控制。

如果你使用 Subversion,你可以看一下:

svn blame

:)

You don't mention wich source control are you using.

If you're using Subversion, you can take a look at:

svn blame

:)

樱花细雨 2024-07-16 22:43:01

适用于带有 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).

破晓 2024-07-16 22:43:01

这个问题相当广泛/开放。 无论如何,这是一个好主意,可以作为参考......

在工作中,我使用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.

若有似无的小暗淡 2024-07-16 22:43:01

在许多版本控制系统中,包括 CVSPerforceAccuRevMercurialTeam Foundation Server,命令是注释

SubversionRCS,命令是blame

例如,使用 CVS:

cvs annotate foo.cc > foo_changes.txt

将创建 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:

cvs annotate foo.cc > foo_changes.txt

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 of foo.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.

夏见 2024-07-16 22:43:01

在 AccuRev 中,使用注释 +“版本滑块”功能更加智能,您可以选择浏览历史文件的注释版本:(

不仅谁更改了最新版本的内容,还包括 所有修订版)

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)

Accurev Version Slider
(source: accurev.com)

寂寞花火° 2024-07-16 22:43:01

对于 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文