Answering the question: Who changed this line of code?

If you are having a problem using Vault, post a message here.

Moderator: SourceGear

Post Reply
Saturn

Answering the question: Who changed this line of code?

Post by Saturn » Mon Jul 04, 2005 11:44 pm

My company uses Vault 3.x along side Visual Studio (C# and C++ projects, sans integration). Every once in a while a question comes up like - who changed/added/commented this line of code and when? Finding the answer usually involves noting the area in the code and doing multiple diffs on the history of the file until the culprit is found.

Is there an easier way? The diff utility and Vault certainly have the power - take the current version/prompted line number and compare it against subsequently older versions until the the line doesn't match... I realize it wouldn't be perfect, but it could certainly save time in these searches.

Sometimes it is simply to blame the person that broke something, but more often it is to find the person that made the change to ask them if they remember WHY the change was made...

jeremy_sg
Posts: 1821
Joined: Thu Dec 18, 2003 11:39 am
Location: Sourcegear
Contact:

Post by jeremy_sg » Tue Jul 05, 2005 5:36 am

You already have the power. In the Vault GUI client, you can select the file in the repository and select the View menu and the Show Blame menu item. This will bring up a web browser to the Vault web client (you'll have to login again) and the Blame page. By default, only the last 20 versions are included in the blame. You can go further back by editing the number in the URL.

Also note that Blame is available from the command line client as well. You can use the following statement to answer the question

Code: Select all

vault.exe -host BLAH -user BLAH -password BLAH -repository BLAH blame $/path/to/file LINENUMBER
That should return who changed that line, when and their comment at the time.

Guest

Post by Guest » Tue Jul 05, 2005 12:29 pm

Ah. Very cool. I never saw it because it isn't on the right-click menu when you click on a file...

Post Reply