libgit2sharp solve file conflict using theirs - libgit2sharp

I use the libgit2sharp library and I have a question:
how to solve file conflict "using theirs"?
I need to do that only for one file.
Thanks in advance for any help!

You can try the conflict resolve strategy Theirs:
MergeOptions opts = new MergeOptions() { FileConflictStrategy = CheckoutFileConflictStrategy.Theirs };
repo.Merge(branch, this._signature, opts);

Related

How to check SPM repo link in xcode?

I am trying to check repo link for my existing project already added SPM.
I want to know the repo link for github/bitbuckect etc etc.
Why i wanted to know this - I have one existing project in which lots of SPMs are there. and I want to add all that SPM in my new project but I don’t know git links for those SPM.
Is there any way to do that?
Thank you for help.
If you have a Package.swift file in the root of your repo, that should also contain the links, if not, try the below one:
On the left pane, each of the dependencies will have a .podspec file with a s.source specification. You can find the URL there.
The root source of this information can be found inside the project file (./<project_name>.xcodeproj/project.pbxproj). Just open it with text editor and search for occurrences of XCRemoteSwiftPackageReference. You should be able to find sections like this one:
/* Begin XCRemoteSwiftPackageReference section */
A1BFE4BB2779F1410015B840 /* XCRemoteSwiftPackageReference "swift-atomics" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/apple/swift-atomics.git";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 1.0.0;
};
};
/* End XCRemoteSwiftPackageReference section */

How do I prevent make clean deleting a certain file in a qmake project

I'm not sure if I did everything right, but I managed to make lupdate be run by make by adding this to my qmake project file
lupdate.name = updating ts translation files
lupdate.depends = $$_PRO_FILE_
lupdate.input = _PRO_FILE_ $$HEADERS $$SOURCES qml/*.qml
lupdate.output = $$PWD/translations/myproject_hu.ts
lupdate.commands = $$[QT_INSTALL_BINS]/lupdate ${QMAKE_FILE_IN}
lupdate.CONFIG += no_link target_predeps combine
now the downside of this is that translations/myproject_hu.ts gets deleted by make clean (and needs to be checked out from git again)
is there a better way to do this? Is there a way to prevent make from deleting my translations/myproject_hu.ts file?
I already have my ts files listed as DISTFILES as well, it doesn't help.
Thank you for your reply in advance.
I've just figured out (I think) after several months of struggling.
The answer is
lupdate.CONFIG += no_link target_predeps combine no_clean

How to use HMAC in Lua - Lightroom plugin

First thing I have to mention is I'm really really new to Lua and please be patient if you think my question is too dumb
Here is my requirement
I need to use HMAC-sha256 for Lightroom plugin development as I'm using that for security.
I was trying to use this but with no luck
https://code.google.com/p/lua-files/wiki/hmac
These are the steps I followed
Got the code of
https://code.google.com/p/lua-files/source/browse/hmac.lua and saved
as 'hmac.lua' file in my plugin directory
Got the code from this
https://code.google.com/p/lua-files/source/browse/sha2.lua and saved
as 'sha2.lua' file
Now in the file I use it like this
local hmac = require'hmac'
local sha2 = require'sha2'
--somewhere doend the line inside a function
local hashvalue = hmac.sha2('key', 'message')
but unfortunately this does not work and I'm not sure what I'm doing wrong.
Can anyone advice me what I'm doing wrong here? Or is there an easier and better way of doing this with a good example.
EDIT:
I'm doing this to get the result. When I include that code the plugin does stops working. I cannot get the output string when I do this
hashvalue = hmac.sha2('key', 'message')
local LrLogger = import 'LrLogger'
myLogger = LrLogger('FlaggedFiles')
myLogger:enable("logfile")
myLogger:trace ("=========================================\n")
myLogger:trace ('Winter is coming, ' .. hashvalue)
myLogger:trace ("=========================================\n")
and the Lightroom refuses to load the plugin and there is nothing on the log as well
Thank you very much for your help
I'd first make sure your code works outside of Lightroom. It seems that HMAC module you referenced has some other dependencies: it requires "glue", "bit", and "ffi" modules. Of these, bit and ffi are binary modules and I'm not sure you will be able to load them into Lightroom (unless they are already available there). In any case, you probably won't be able to make it run in LR if you don't have required modules and can't make it run without issues outside of LR.
If you just need to get SHA256 hash there is a way to do it Lightroom
I posted my question here and was able to get an answer. But there there was no reference of this on SDK documentation (Lightroom SDK)
local sha = import 'LrDigest'
d = sha.SHA256.digest ("Hello world")
but unfortunately there was no HMAC so I decided to use md5 with a salt because this was taking too much of my time
Spent quite some time trying to find a solution :-/
LrDigest is not documented, thanks Adobe!
Solution:
local LrDigest = import "LrDigest"
LrDigest.HMAC.digest(string, 'SHA256', key)

Emgucv + SURF feature

I am using emgucv2.3.
When I type the line MCvSURFParams surfParam = new MCvSURFParams(500, false); , I get the error The type or namespace name 'MCvSURFParams' could not be found (are you missing a using directive or an assembly reference?) . But I have included all necessary references. Can anyone tell where I am wrong ?
Thanks in advance
I believe your using an old call to the code it should now be:
SURFDetector surfParam = new SURFDetector(500, false);
Assuming you have the correct references and using statements this will work, refere to the SurfFeature example in 2.3.0 to check your code.
Cheers,
Chris

How do you SetMaxAttachmentSize in TFS 2010?

I want to set the maximum work item attachment size. From old blogs I have found that it is possible by calling SetMaxAttachmentSize, but the blogs are for older versions of TFS. I have found the new webservice path for TFS 2010.
http://localhost:8080/tfs/_tfs_resources/WorkItemTracking/v1.0/ConfigurationSettingsService.asmx/SetMaxAttachmentSize
Unfortunately when I call it like that I receive this error: This request can only be made against a project collection. The (.asmx) file should be located in the project directory (usually _tfs_resources under the application root).
I don't know how to format the call via a browser to target a specific project collection. Any thoughts?
Apparently SetMaxAttachmentSize web service was not leveraged on TFS 2010 therefore you need to do this programmatically, try running the following code:
TeamFoundationServer tfs = TeamFoundationServerFactory.GetServer(#"http://yourtfsserver:8080/tfs/DefaultCollection");
ITeamFoundationRegistry rw = tfs.GetService<ITeamFoundationRegistry>();
RegistryEntryCollection rc = rw.ReadEntries(#"/Service/WorkItemTracking/Settings/MaxAttachmentSize");
RegistryEntry re = new RegistryEntry(#"/Service/WorkItemTracking/Settings/MaxAttachmentSize", "20971520"); //20MB
if (rc.Count != 0)
{
re = rc.First();
re.Value = "20971520";
}
rw.WriteEntries(new List<RegistryEntry>() { re });
I hope it works for you
Regards,
Randall Rosales
I have found that this works. It is easier than writing code.
Go to this url replacing <Collection> with your project collection: http://localhost:8080/tfs/<Collection>/WorkItemTracking/v1.0/ConfigurationSettingsService.asmx
Choose SetMaxAttachmentSize
You can test to make sure you set it correctly by going to the same url above and then selecting GetMaxAttachmentSize.

Resources