libgit2

git_merge_driver_register

Version:

Register a merge driver under a given name.

As mentioned elsewhere, the initialize callback will not be invoked immediately. It is deferred until the driver is used in some way.

Currently the merge driver registry is not thread safe, so any registering or deregistering of merge drivers must be done outside of any possible usage of the drivers (i.e. during application setup or shutdown).

Signature

int git_merge_driver_register(const char *name, git_merge_driver *driver);

Parameters

const char *
In
name

The name of this driver to match an attribute. Attempting to register with an in-use name will return GIT_EEXISTS.

In
driver

The merge driver definition. This pointer will be stored as is by libgit2 so it must be a durable allocation (either static or on the heap).

Returns

int

0 on successful registry, error code < 0 on failure

Versions