Command Line Client question
Moderator: SourceGear
Command Line Client question
Vault 5.0.1
Hello,
I am trying to do a DIFF using the Command Line tool but it doesn't seem to be working, it gives a successful run but shows no differences while I know there are some. Then after searching here it seems that the command line client just launches the DiffMerge UI program by default, is this correct? This is for an automated process that would then email a report to people which is why I'm looking for a non-UI DIFF.
Thanks,
J
Hello,
I am trying to do a DIFF using the Command Line tool but it doesn't seem to be working, it gives a successful run but shows no differences while I know there are some. Then after searching here it seems that the command line client just launches the DiffMerge UI program by default, is this correct? This is for an automated process that would then email a report to people which is why I'm looking for a non-UI DIFF.
Thanks,
J
Re: Command Line Client question
In order to get results without pulling up the DiffMerge window, you need to use the -diff= switch and specify a file for it to send the results to.
For example:My results will be in the DiffOutput.txt file.
For example:
Code: Select all
diffmerge -diff="C:\somefolder\DiffOutput.txt" "C:\path to file\Diff1.txt" "C:\path to file\Diff2.txt"
Beth Kieler
SourceGear Technical Support
SourceGear Technical Support
Re: Command Line Client question
So there isn't a way for me to do this using the Vault.exe command line client?
I tried doing sort of what you said but it didn't work here is the test run I am doing:
vault.exe DIFF -vaultdiff "C:\Program Files\SourceGear\Vault Client\sgdm.exe" -vaultdiff_options "-diff testdiff.txt" -compareto current $/main/TPI $/main/TPI
If I leave out the -vaultdiff_options section then I get the UI correctly showing the diff.
Thanks,
J
I tried doing sort of what you said but it didn't work here is the test run I am doing:
vault.exe DIFF -vaultdiff "C:\Program Files\SourceGear\Vault Client\sgdm.exe" -vaultdiff_options "-diff testdiff.txt" -compareto current $/main/TPI $/main/TPI
If I leave out the -vaultdiff_options section then I get the UI correctly showing the diff.
Thanks,
J
Re: Command Line Client question
Sorry for the confusion. You can also use sgdm.exe. That is found in the same folder that the Vault client is installed to. That should be able to take some of the same options as our separate Diff/Merge tool.
I don't have a way to do the same thing using Vault.exe.
I don't have a way to do the same thing using Vault.exe.
Beth Kieler
SourceGear Technical Support
SourceGear Technical Support
Re: Command Line Client question
Thanks.
So then there is no way at all for me to DIFF via a batch script to compare a file on the system with a file within the Vault source, correct?
If not could you please add a feature request for the command line client to output that diff to a file or at the least be able to get the sgdm to do it when you pass the option via the -vaultdiff_options, since the UI works from that it would seem that I should be able to get that -diff option to work as well to output to a file if I pass it in that options field.
Thanks,
J
So then there is no way at all for me to DIFF via a batch script to compare a file on the system with a file within the Vault source, correct?
If not could you please add a feature request for the command line client to output that diff to a file or at the least be able to get the sgdm to do it when you pass the option via the -vaultdiff_options, since the UI works from that it would seem that I should be able to get that -diff option to work as well to output to a file if I pass it in that options field.
Thanks,
J
Re: Command Line Client question
What might make sense is to perform a Get from Vault in your script and then use the sgdm.exe to diff the two files on disk and output the results to a file.
I tried using Vault and rerouting the results to a file, but all that gives is the results of
<result>
<success>True</success>
</result>
</vault>
Only a call to the diff tool itself can do that.
I tried using Vault and rerouting the results to a file, but all that gives is the results of
<result>
<success>True</success>
</result>
</vault>
Code: Select all
Vault DIFF -host localhost -user xxx -password "xxxxx" -repository "Initial Repository" -compareto current -vaultdiff "C:\Program Files\SourceGear\Vault Client\sgdm.exe" $/FOLDER1/Diff1.txt >> "E:\somefolder\DiffResults.txt"
Beth Kieler
SourceGear Technical Support
SourceGear Technical Support
Re: Command Line Client question
That's what I was trying to avoid but I guess I can't.
Seems like something is wrong in Vault.exe or Sgdm.exe, if I use
'vault.exe DIFF -vaultdiff "C:\Program Files\SourceGear\Vault Client\sgdm.exe" -vaultdiff_options "-diff testdiff.txt" -compareto current $/main/TPI $/main/TPI'
but put some other param like /u or even put -d without anything after it I end up with an error from DiffMerge that says "Unexpected characters following option 'u'" for example. So the ability to send options to the Diff program isn't working correctly via the -vaultdiff_options param, or at least that is how it seems.
Thanks,
J
Seems like something is wrong in Vault.exe or Sgdm.exe, if I use
'vault.exe DIFF -vaultdiff "C:\Program Files\SourceGear\Vault Client\sgdm.exe" -vaultdiff_options "-diff testdiff.txt" -compareto current $/main/TPI $/main/TPI'
but put some other param like /u or even put -d without anything after it I end up with an error from DiffMerge that says "Unexpected characters following option 'u'" for example. So the ability to send options to the Diff program isn't working correctly via the -vaultdiff_options param, or at least that is how it seems.
Thanks,
J
Re: Command Line Client question
Beth,
I realized that your examples were File Diff's while I am looking to do a Folder Diff. Upon looking further at Diff Merge I found it doesn't seem to support doing a Folder Diff on the command line or rather outputting the diff to a file, is this correct or am I just missing something?
If not then Diff Merge won't work for me at all as I do need to be able to do this.
Thanks,
J
I realized that your examples were File Diff's while I am looking to do a Folder Diff. Upon looking further at Diff Merge I found it doesn't seem to support doing a Folder Diff on the command line or rather outputting the diff to a file, is this correct or am I just missing something?
If not then Diff Merge won't work for me at all as I do need to be able to do this.
Thanks,
J
-
- Posts: 534
- Joined: Tue Jun 05, 2007 11:37 am
- Location: SourceGear
- Contact:
Re: Command Line Client question
RIght, DiffMerge doesn't currently have a "compare 2 folders and report to a file" mode.
You can open a folder window and save the differences to a CSV, but currently there's
no way to get it to do the folder comparision without a window. Sorry.
I want/need to add this feature.
In the mean time, if you have cygwin installed, you can use gnu-diff to compare 2 folders.
I don't remember the args right now, but when given 2 folders, it will print "only in..." messages
for the peerless files and then either display the file diffs or give a summary for each matching
pair.
Hope that helps,
jeff
15127
You can open a folder window and save the differences to a CSV, but currently there's
no way to get it to do the folder comparision without a window. Sorry.
I want/need to add this feature.
In the mean time, if you have cygwin installed, you can use gnu-diff to compare 2 folders.
I don't remember the args right now, but when given 2 folders, it will print "only in..." messages
for the peerless files and then either display the file diffs or give a summary for each matching
pair.
Hope that helps,
jeff
15127
Re: Command Line Client question
I have worked it out using a 3rd party program but yes that would be a good feature for Diff Merge/Vault.
Thanks for the info.
J
Thanks for the info.
J
Re: Command Line Client question
Thank you for your feedback.
Beth Kieler
SourceGear Technical Support
SourceGear Technical Support