How to use DIFF on command line?

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

Moderator: SourceGear

Post Reply
Tate
Posts: 3
Joined: Wed Nov 24, 2004 7:17 pm

How to use DIFF on command line?

Post by Tate » Tue Nov 30, 2004 6:56 pm

Not sure what to specify for "Object1" and "Object2" on the command line for the vault.exe DIFF command.

All the other parameters are well documented except for these objects. Seems that the objects specified depend on the "-compareto" specified, but I don't seem to be guessing right atm :)
TIA, tate.

jclausius
Posts: 3706
Joined: Tue Dec 16, 2003 1:17 pm
Location: SourceGear
Contact:

Post by jclausius » Tue Nov 30, 2004 7:10 pm

If you wish to compare to the current version in the repository or the last get, use the repository path for OBJECT_1 and do not specify OBJECT_2

If you wish to compare a repository object against a label or a different file on disk use OBJECT_1 for repository object and OBJECT_2 as the corresponding object to diff.

Also note, if you are using a Windows based system, you will need to set the VAULTDIFF environment variable to point to the diff program of your choice, as Windows does not have a built in diff utility.
Jeff Clausius
SourceGear

Tate
Posts: 3
Joined: Wed Nov 24, 2004 7:17 pm

Post by Tate » Tue Nov 30, 2004 9:54 pm

Is the VAULTDIFF environment variable set by default to the built in vault diffmerge program? (or can it be set to this?)

jclausius
Posts: 3706
Joined: Tue Dec 16, 2003 1:17 pm
Location: SourceGear
Contact:

Post by jclausius » Wed Dec 01, 2004 9:18 am

Currently, this is not set by anything, and has to be done manually. I've logged a request to modify the installer to set the environment variable.
Jeff Clausius
SourceGear

jclausius
Posts: 3706
Joined: Tue Dec 16, 2003 1:17 pm
Location: SourceGear
Contact:

Post by jclausius » Wed Dec 01, 2004 9:19 am

Please note, the option -VAULTDIFF <absolute_path_to_diff_utlility> can also be used in the the command line client's DIFF command.
Jeff Clausius
SourceGear

anony

Post by anony » Wed Aug 24, 2005 12:44 pm

i'm a little confused, is there a way to get the command line vault tool to acutally perform a diff and return some result to the command line? Do i need to use a third party tool to do the diff? Am i missing something?

currently i'm trying something like this:
vault.exe DIFF -user blah -password blah -host blah -repository blah -compareto $/path1 $/path2

i'm using vault. 2.0.6

lbauer
Posts: 9736
Joined: Tue Dec 16, 2003 1:25 pm
Location: SourceGear

Post by lbauer » Wed Aug 24, 2005 12:59 pm

Here's the documentation for the Vault 2.0.6 Command Line diff:
usage: vault.exe DIFF [options] OBJECT_1 OBJECT2

{0} will run the two objects through a 'diff' program.

Server and authentication information is specified by:
-host host
Hostname of the vault server to connect to - also see SERVER
-ssl
Enables SSL for server connection
-user username
Username to use when connecting to server - also see USERNAME
Password to use when connecting to server
-repository repositoryname
Repository to connect to

his is a list of possible options:
-compareto [current|label|lastget|local|repository]
Type of comparison should be made against your local working version.

current - the current repository item
label - the version found within the given label
lastget - the last version retrieved from the repository
local - any local file system item
repository- any item within the repository
-norecursive
Do not act recursively on folders
-vaultdiff [absolute path to comparison utility]
Use this comparison utility for differences.
-vaultdiff_options "[any options]"
Options for the comparison utility.
Use double quotes for multiple options.
Your command is missing info on the location of the diff tool:

example -vaultdiff "C:\Program Files\SourceGear\Vault Client\sgdm.exe"
Linda Bauer
SourceGear
Technical Support Manager

annony

Post by annony » Wed Aug 24, 2005 1:20 pm

thx for the speed reply.

i have a few more questsions.

Is there a way to get sgdm ( or another vault tool ) to return the difference between two branches in a textual format?

How do i get the detailed usage for a command as you've pasted? if there isn't a way for me to do it, could you please post the usage for the HISTORY command as wel?

lbauer
Posts: 9736
Joined: Tue Dec 16, 2003 1:25 pm
Location: SourceGear

Post by lbauer » Wed Aug 24, 2005 3:16 pm

SGDM.exe is a GUI tool. SourceGear doesn't have command line diff tool, but you might be able to find a third party command line tool that would work with Vault.

For documentation on the Vault Command Line Client, cd to the Vault Client directory from a command prompt and type "vault help". Or for help on a specific command, type "vault help <commandname>", as in "vault help diff".
Linda Bauer
SourceGear
Technical Support Manager

Post Reply