summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2019-06-06 16:36:23 -0400
committerEdward Thomson <ethomson@edwardthomson.com>2019-06-14 09:57:00 +0100
commit0b5ba0d744e69da5dc8c08d167c83dd87ed83af2 (patch)
tree0dcca647cc9d9fe8080c2b0ea483dff5d74ee566 /include
parenta5ddae68f86b459ce53319c8af1e7b1ea7d21dd6 (diff)
downloadlibgit2-0b5ba0d744e69da5dc8c08d167c83dd87ed83af2.tar.gz
Rename opt init functions to `options_init`
In libgit2 nomenclature, when we need to verb a direct object, we name a function `git_directobject_verb`. Thus, if we need to init an options structure named `git_foo_options`, then the name of the function that does that should be `git_foo_options_init`. The previous names of `git_foo_init_options` is close - it _sounds_ as if it's initializing the options of a `foo`, but in fact `git_foo_options` is its own noun that should be respected. Deprecate the old names; they'll now call directly to the new ones.
Diffstat (limited to 'include')
-rw-r--r--include/git2/blame.h4
-rw-r--r--include/git2/checkout.h4
-rw-r--r--include/git2/cherrypick.h2
-rw-r--r--include/git2/clone.h4
-rw-r--r--include/git2/deprecated.h55
-rw-r--r--include/git2/describe.h8
-rw-r--r--include/git2/diff.h12
-rw-r--r--include/git2/indexer.h2
-rw-r--r--include/git2/merge.h10
-rw-r--r--include/git2/proxy.h2
-rw-r--r--include/git2/rebase.h2
-rw-r--r--include/git2/remote.h8
-rw-r--r--include/git2/repository.h2
-rw-r--r--include/git2/revert.h2
-rw-r--r--include/git2/stash.h4
-rw-r--r--include/git2/status.h2
-rw-r--r--include/git2/submodule.h4
-rw-r--r--include/git2/worktree.h10
18 files changed, 94 insertions, 43 deletions
diff --git a/include/git2/blame.h b/include/git2/blame.h
index eef863f9c..73f6cf979 100644
--- a/include/git2/blame.h
+++ b/include/git2/blame.h
@@ -53,7 +53,7 @@ typedef enum {
* Blame options structure
*
* Initialize with `GIT_BLAME_OPTIONS_INIT`. Alternatively, you can
- * use `git_blame_init_options`.
+ * use `git_blame_options_init`.
*
*/
typedef struct git_blame_options {
@@ -100,7 +100,7 @@ typedef struct git_blame_options {
* @param version The struct version; pass `GIT_BLAME_OPTIONS_VERSION`.
* @return Zero on success; -1 on failure.
*/
-GIT_EXTERN(int) git_blame_init_options(
+GIT_EXTERN(int) git_blame_options_init(
git_blame_options *opts,
unsigned int version);
diff --git a/include/git2/checkout.h b/include/git2/checkout.h
index e49111c5d..20fa6d647 100644
--- a/include/git2/checkout.h
+++ b/include/git2/checkout.h
@@ -256,7 +256,7 @@ typedef void GIT_CALLBACK(git_checkout_perfdata_cb)(
* Checkout options structure
*
* Initialize with `GIT_CHECKOUT_OPTIONS_INIT`. Alternatively, you can
- * use `git_checkout_init_options`.
+ * use `git_checkout_options_init`.
*
*/
typedef struct git_checkout_options {
@@ -318,7 +318,7 @@ typedef struct git_checkout_options {
* @param version The struct version; pass `GIT_CHECKOUT_OPTIONS_VERSION`.
* @return Zero on success; -1 on failure.
*/
-GIT_EXTERN(int) git_checkout_init_options(
+GIT_EXTERN(int) git_checkout_options_init(
git_checkout_options *opts,
unsigned int version);
diff --git a/include/git2/cherrypick.h b/include/git2/cherrypick.h
index ca6f72075..81784b4c8 100644
--- a/include/git2/cherrypick.h
+++ b/include/git2/cherrypick.h
@@ -46,7 +46,7 @@ typedef struct {
* @param version The struct version; pass `GIT_CHERRYPICK_OPTIONS_VERSION`.
* @return Zero on success; -1 on failure.
*/
-GIT_EXTERN(int) git_cherrypick_init_options(
+GIT_EXTERN(int) git_cherrypick_options_init(
git_cherrypick_options *opts,
unsigned int version);
diff --git a/include/git2/clone.h b/include/git2/clone.h
index 790a82832..2d6f68705 100644
--- a/include/git2/clone.h
+++ b/include/git2/clone.h
@@ -97,7 +97,7 @@ typedef int GIT_CALLBACK(git_repository_create_cb)(
* Clone options structure
*
* Initialize with `GIT_CLONE_OPTIONS_INIT`. Alternatively, you can
- * use `git_clone_init_options`.
+ * use `git_clone_options_init`.
*
*/
typedef struct git_clone_options {
@@ -178,7 +178,7 @@ typedef struct git_clone_options {
* @param version The struct version; pass `GIT_CLONE_OPTIONS_VERSION`.
* @return Zero on success; -1 on failure.
*/
-GIT_EXTERN(int) git_clone_init_options(
+GIT_EXTERN(int) git_clone_options_init(
git_clone_options *opts,
unsigned int version);
diff --git a/include/git2/deprecated.h b/include/git2/deprecated.h
index 177efa61a..09388cbb4 100644
--- a/include/git2/deprecated.h
+++ b/include/git2/deprecated.h
@@ -8,13 +8,29 @@
#define INCLUDE_git_deprecated_h__
#include "common.h"
+#include "blame.h"
#include "buffer.h"
+#include "checkout.h"
+#include "cherrypick.h"
+#include "clone.h"
+#include "describe.h"
+#include "diff.h"
#include "errors.h"
#include "index.h"
+#include "indexer.h"
+#include "merge.h"
#include "object.h"
+#include "proxy.h"
#include "refs.h"
+#include "rebase.h"
#include "remote.h"
#include "trace.h"
+#include "repository.h"
+#include "revert.h"
+#include "stash.h"
+#include "status.h"
+#include "submodule.h"
+#include "worktree.h"
/*
* Users can avoid deprecated functions by defining `GIT_DEPRECATE_HARD`.
@@ -316,6 +332,45 @@ typedef git_push_transfer_progress_cb git_push_transfer_progress;
/**@}*/
+/** @name Deprecated Options Initialization Functions
+ *
+ * These functions are retained for backward compatibility. The newer
+ * versions of these functions should be preferred in all new code.
+ *
+ * There is no plan to remove these backward compatibility functions at
+ * this time.
+ */
+/**@{*/
+
+GIT_EXTERN(int) git_blame_init_options(git_blame_options *opts, unsigned int version);
+GIT_EXTERN(int) git_checkout_init_options(git_checkout_options *opts, unsigned int version);
+GIT_EXTERN(int) git_cherrypick_init_options(git_cherrypick_options *opts, unsigned int version);
+GIT_EXTERN(int) git_clone_init_options(git_clone_options *opts, unsigned int version);
+GIT_EXTERN(int) git_describe_init_options(git_describe_options *opts, unsigned int version);
+GIT_EXTERN(int) git_describe_init_format_options(git_describe_format_options *opts, unsigned int version);
+GIT_EXTERN(int) git_diff_init_options(git_diff_options *opts, unsigned int version);
+GIT_EXTERN(int) git_diff_find_init_options(git_diff_find_options *opts, unsigned int version);
+GIT_EXTERN(int) git_diff_format_email_init_options(git_diff_format_email_options *opts, unsigned int version);
+GIT_EXTERN(int) git_diff_patchid_init_options(git_diff_patchid_options *opts, unsigned int version);
+GIT_EXTERN(int) git_fetch_init_options(git_fetch_options *opts, unsigned int version);
+GIT_EXTERN(int) git_indexer_init_options(git_indexer_options *opts, unsigned int version);
+GIT_EXTERN(int) git_merge_init_options(git_merge_options *opts, unsigned int version);
+GIT_EXTERN(int) git_merge_file_init_input(git_merge_file_input *input, unsigned int version);
+GIT_EXTERN(int) git_merge_file_init_options(git_merge_file_options *opts, unsigned int version);
+GIT_EXTERN(int) git_proxy_init_options(git_proxy_options *opts, unsigned int version);
+GIT_EXTERN(int) git_push_init_options(git_push_options *opts, unsigned int version);
+GIT_EXTERN(int) git_rebase_init_options(git_rebase_options *opts, unsigned int version);
+GIT_EXTERN(int) git_remote_create_init_options(git_remote_create_options *opts, unsigned int version);
+GIT_EXTERN(int) git_repository_init_init_options(git_repository_init_options *opts, unsigned int version);
+GIT_EXTERN(int) git_revert_init_options(git_revert_options *opts, unsigned int version);
+GIT_EXTERN(int) git_stash_apply_init_options(git_stash_apply_options *opts, unsigned int version);
+GIT_EXTERN(int) git_status_init_options(git_status_options *opts, unsigned int version);
+GIT_EXTERN(int) git_submodule_update_init_options(git_submodule_update_options *opts, unsigned int version);
+GIT_EXTERN(int) git_worktree_add_init_options(git_worktree_add_options *opts, unsigned int version);
+GIT_EXTERN(int) git_worktree_prune_init_options(git_worktree_prune_options *opts, unsigned int version);
+
+/**@}*/
+
/** @} */
GIT_END_DECL
diff --git a/include/git2/describe.h b/include/git2/describe.h
index 56f119b2d..1d2ca1496 100644
--- a/include/git2/describe.h
+++ b/include/git2/describe.h
@@ -37,7 +37,7 @@ typedef enum {
* Describe options structure
*
* Initialize with `GIT_DESCRIBE_OPTIONS_INIT`. Alternatively, you can
- * use `git_describe_init_options`.
+ * use `git_describe_options_init`.
*
*/
typedef struct git_describe_options {
@@ -79,13 +79,13 @@ typedef struct git_describe_options {
* @param version The struct version; pass `GIT_DESCRIBE_OPTIONS_VERSION`.
* @return Zero on success; -1 on failure.
*/
-GIT_EXTERN(int) git_describe_init_options(git_describe_options *opts, unsigned int version);
+GIT_EXTERN(int) git_describe_options_init(git_describe_options *opts, unsigned int version);
/**
* Describe format options structure
*
* Initialize with `GIT_DESCRIBE_FORMAT_OPTIONS_INIT`. Alternatively, you can
- * use `git_describe_format_init_options`.
+ * use `git_describe_format_options_init`.
*
*/
typedef struct {
@@ -126,7 +126,7 @@ typedef struct {
* @param version The struct version; pass `GIT_DESCRIBE_FORMAT_OPTIONS_VERSION`.
* @return Zero on success; -1 on failure.
*/
-GIT_EXTERN(int) git_describe_init_format_options(git_describe_format_options *opts, unsigned int version);
+GIT_EXTERN(int) git_describe_format_options_init(git_describe_format_options *opts, unsigned int version);
/**
* A struct that stores the result of a describe operation.
diff --git a/include/git2/diff.h b/include/git2/diff.h
index b920385ee..c89c32ffb 100644
--- a/include/git2/diff.h
+++ b/include/git2/diff.h
@@ -119,7 +119,7 @@ typedef enum {
/** Include unreadable files in the diff */
GIT_DIFF_INCLUDE_UNREADABLE = (1u << 16),
-
+
/** Include unreadable files in the diff */
GIT_DIFF_INCLUDE_UNREADABLE_AS_UNTRACKED = (1u << 17),
@@ -451,7 +451,7 @@ typedef struct {
* @param version The struct version; pass `GIT_DIFF_OPTIONS_VERSION`.
* @return Zero on success; -1 on failure.
*/
-GIT_EXTERN(int) git_diff_init_options(
+GIT_EXTERN(int) git_diff_options_init(
git_diff_options *opts,
unsigned int version);
@@ -784,7 +784,7 @@ typedef struct {
* @param version The struct version; pass `GIT_DIFF_FIND_OPTIONS_VERSION`.
* @return Zero on success; -1 on failure.
*/
-GIT_EXTERN(int) git_diff_find_init_options(
+GIT_EXTERN(int) git_diff_find_options_init(
git_diff_find_options *opts,
unsigned int version);
@@ -1448,7 +1448,7 @@ GIT_EXTERN(int) git_diff_commit_as_email(
* @param version The struct version; pass `GIT_DIFF_FORMAT_EMAIL_OPTIONS_VERSION`.
* @return Zero on success; -1 on failure.
*/
-GIT_EXTERN(int) git_diff_format_email_init_options(
+GIT_EXTERN(int) git_diff_format_email_options_init(
git_diff_format_email_options *opts,
unsigned int version);
@@ -1456,7 +1456,7 @@ GIT_EXTERN(int) git_diff_format_email_init_options(
* Patch ID options structure
*
* Initialize with `GIT_PATCHID_OPTIONS_INIT`. Alternatively, you can
- * use `git_patchid_init_options`.
+ * use `git_diff_patchid_options_init`.
*
*/
typedef struct git_diff_patchid_options {
@@ -1476,7 +1476,7 @@ typedef struct git_diff_patchid_options {
* @param version The struct version; pass `GIT_DIFF_PATCHID_OPTIONS_VERSION`.
* @return Zero on success; -1 on failure.
*/
-GIT_EXTERN(int) git_diff_patchid_init_options(
+GIT_EXTERN(int) git_diff_patchid_options_init(
git_diff_patchid_options *opts,
unsigned int version);
diff --git a/include/git2/indexer.h b/include/git2/indexer.h
index 47c0289fa..1442f5173 100644
--- a/include/git2/indexer.h
+++ b/include/git2/indexer.h
@@ -79,7 +79,7 @@ typedef struct git_indexer_options {
* @param version Version of struct; pass `GIT_INDEXER_OPTIONS_VERSION`
* @return Zero on success; -1 on failure.
*/
-GIT_EXTERN(int) git_indexer_init_options(
+GIT_EXTERN(int) git_indexer_options_init(
git_indexer_options *opts,
unsigned int version);
diff --git a/include/git2/merge.h b/include/git2/merge.h
index 862721370..d63800939 100644
--- a/include/git2/merge.h
+++ b/include/git2/merge.h
@@ -57,7 +57,7 @@ typedef struct {
* `GIT_MERGE_FILE_INPUT_VERSION` here.
* @return Zero on success; -1 on failure.
*/
-GIT_EXTERN(int) git_merge_file_init_input(
+GIT_EXTERN(int) git_merge_file_input_init(
git_merge_file_input *opts,
unsigned int version);
@@ -212,9 +212,7 @@ typedef struct {
* @param version The struct version; pass `GIT_MERGE_FILE_OPTIONS_VERSION`.
* @return Zero on success; -1 on failure.
*/
-GIT_EXTERN(int) git_merge_file_init_options(
- git_merge_file_options *opts,
- unsigned int version);
+GIT_EXTERN(int) git_merge_file_options_init(git_merge_file_options *opts, unsigned int version);
/**
* Information about file-level merging
@@ -310,9 +308,7 @@ typedef struct {
* @param version The struct version; pass `GIT_MERGE_OPTIONS_VERSION`.
* @return Zero on success; -1 on failure.
*/
-GIT_EXTERN(int) git_merge_init_options(
- git_merge_options *opts,
- unsigned int version);
+GIT_EXTERN(int) git_merge_options_init(git_merge_options *opts, unsigned int version);
/**
* The results of `git_merge_analysis` indicate the merge opportunities.
diff --git a/include/git2/proxy.h b/include/git2/proxy.h
index 5f9d27f30..8fdcaa31d 100644
--- a/include/git2/proxy.h
+++ b/include/git2/proxy.h
@@ -89,7 +89,7 @@ typedef struct {
* @param version The struct version; pass `GIT_PROXY_OPTIONS_VERSION`.
* @return Zero on success; -1 on failure.
*/
-GIT_EXTERN(int) git_proxy_init_options(git_proxy_options *opts, unsigned int version);
+GIT_EXTERN(int) git_proxy_options_init(git_proxy_options *opts, unsigned int version);
GIT_END_DECL
diff --git a/include/git2/rebase.h b/include/git2/rebase.h
index a97c16b05..011d3e119 100644
--- a/include/git2/rebase.h
+++ b/include/git2/rebase.h
@@ -156,7 +156,7 @@ typedef struct {
* @param version The struct version; pass `GIT_REBASE_OPTIONS_VERSION`.
* @return Zero on success; -1 on failure.
*/
-GIT_EXTERN(int) git_rebase_init_options(
+GIT_EXTERN(int) git_rebase_options_init(
git_rebase_options *opts,
unsigned int version);
diff --git a/include/git2/remote.h b/include/git2/remote.h
index f757f67ea..73c2482ea 100644
--- a/include/git2/remote.h
+++ b/include/git2/remote.h
@@ -56,7 +56,7 @@ typedef enum {
* Remote creation options structure
*
* Initialize with `GIT_REMOTE_CREATE_OPTIONS_INIT`. Alternatively, you can
- * use `git_remote_create_init_options`.
+ * use `git_remote_create_options_init`.
*
*/
typedef struct git_remote_create_options {
@@ -94,7 +94,7 @@ typedef struct git_remote_create_options {
* @param version The struct version; pass `GIT_REMOTE_CREATE_OPTIONS_VERSION`.
* @return Zero on success; -1 on failure.
*/
-GIT_EXTERN(int) git_remote_create_init_options(
+GIT_EXTERN(int) git_remote_create_options_init(
git_remote_create_options *opts,
unsigned int version);
@@ -700,7 +700,7 @@ typedef struct {
* @param version The struct version; pass `GIT_FETCH_OPTIONS_VERSION`.
* @return Zero on success; -1 on failure.
*/
-GIT_EXTERN(int) git_fetch_init_options(
+GIT_EXTERN(int) git_fetch_options_init(
git_fetch_options *opts,
unsigned int version);
@@ -750,7 +750,7 @@ typedef struct {
* @param version The struct version; pass `GIT_PUSH_OPTIONS_VERSION`.
* @return Zero on success; -1 on failure.
*/
-GIT_EXTERN(int) git_push_init_options(
+GIT_EXTERN(int) git_push_options_init(
git_push_options *opts,
unsigned int version);
diff --git a/include/git2/repository.h b/include/git2/repository.h
index 04c7300ce..7d48e9e8d 100644
--- a/include/git2/repository.h
+++ b/include/git2/repository.h
@@ -323,7 +323,7 @@ typedef struct {
* @param version The struct version; pass `GIT_REPOSITORY_INIT_OPTIONS_VERSION`.
* @return Zero on success; -1 on failure.
*/
-GIT_EXTERN(int) git_repository_init_init_options(
+GIT_EXTERN(int) git_repository_init_options_init(
git_repository_init_options *opts,
unsigned int version);
diff --git a/include/git2/revert.h b/include/git2/revert.h
index 260ad044b..331e90dff 100644
--- a/include/git2/revert.h
+++ b/include/git2/revert.h
@@ -46,7 +46,7 @@ typedef struct {
* @param version The struct version; pass `GIT_REVERT_OPTIONS_VERSION`.
* @return Zero on success; -1 on failure.
*/
-GIT_EXTERN(int) git_revert_init_options(
+GIT_EXTERN(int) git_revert_options_init(
git_revert_options *opts,
unsigned int version);
diff --git a/include/git2/stash.h b/include/git2/stash.h
index c4dcf6845..bee26f1dc 100644
--- a/include/git2/stash.h
+++ b/include/git2/stash.h
@@ -120,7 +120,7 @@ typedef int GIT_CALLBACK(git_stash_apply_progress_cb)(
* Stash application options structure
*
* Initialize with `GIT_STASH_APPLY_OPTIONS_INIT`. Alternatively, you can
- * use `git_stash_apply_init_options`.
+ * use `git_stash_apply_options_init`.
*
*/
typedef struct git_stash_apply_options {
@@ -153,7 +153,7 @@ typedef struct git_stash_apply_options {
* @param version The struct version; pass `GIT_STASH_APPLY_OPTIONS_VERSION`.
* @return Zero on success; -1 on failure.
*/
-GIT_EXTERN(int) git_stash_apply_init_options(
+GIT_EXTERN(int) git_stash_apply_options_init(
git_stash_apply_options *opts, unsigned int version);
/**
diff --git a/include/git2/status.h b/include/git2/status.h
index 06229ed2e..586d2cabb 100644
--- a/include/git2/status.h
+++ b/include/git2/status.h
@@ -200,7 +200,7 @@ typedef struct {
* @param version The struct version; pass `GIT_STATUS_OPTIONS_VERSION`.
* @return Zero on success; -1 on failure.
*/
-GIT_EXTERN(int) git_status_init_options(
+GIT_EXTERN(int) git_status_options_init(
git_status_options *opts,
unsigned int version);
diff --git a/include/git2/submodule.h b/include/git2/submodule.h
index efb3b75d6..62f250b2b 100644
--- a/include/git2/submodule.h
+++ b/include/git2/submodule.h
@@ -122,7 +122,7 @@ typedef int GIT_CALLBACK(git_submodule_cb)(
* Submodule update options structure
*
* Initialize with `GIT_SUBMODULE_UPDATE_OPTIONS_INIT`. Alternatively, you can
- * use `git_submodule_update_init_options`.
+ * use `git_submodule_update_options_init`.
*
*/
typedef struct git_submodule_update_options {
@@ -168,7 +168,7 @@ typedef struct git_submodule_update_options {
* @param version The struct version; pass `GIT_SUBMODULE_UPDATE_OPTIONS_VERSION`.
* @return Zero on success; -1 on failure.
*/
-GIT_EXTERN(int) git_submodule_update_init_options(
+GIT_EXTERN(int) git_submodule_update_options_init(
git_submodule_update_options *opts, unsigned int version);
/**
diff --git a/include/git2/worktree.h b/include/git2/worktree.h
index 925d85a69..049511da1 100644
--- a/include/git2/worktree.h
+++ b/include/git2/worktree.h
@@ -78,7 +78,7 @@ GIT_EXTERN(int) git_worktree_validate(const git_worktree *wt);
* Worktree add options structure
*
* Initialize with `GIT_WORKTREE_ADD_OPTIONS_INIT`. Alternatively, you can
- * use `git_worktree_add_init_options`.
+ * use `git_worktree_add_options_init`.
*
*/
typedef struct git_worktree_add_options {
@@ -101,7 +101,7 @@ typedef struct git_worktree_add_options {
* @param version The struct version; pass `GIT_WORKTREE_ADD_OPTIONS_VERSION`.
* @return Zero on success; -1 on failure.
*/
-GIT_EXTERN(int) git_worktree_add_init_options(git_worktree_add_options *opts,
+GIT_EXTERN(int) git_worktree_add_options_init(git_worktree_add_options *opts,
unsigned int version);
/**
@@ -174,7 +174,7 @@ GIT_EXTERN(const char *) git_worktree_name(const git_worktree *wt);
* is valid for the lifetime of the git_worktree.
*/
GIT_EXTERN(const char *) git_worktree_path(const git_worktree *wt);
-
+
/**
* Flags which can be passed to git_worktree_prune to alter its
* behavior.
@@ -192,7 +192,7 @@ typedef enum {
* Worktree prune options structure
*
* Initialize with `GIT_WORKTREE_PRUNE_OPTIONS_INIT`. Alternatively, you can
- * use `git_worktree_prune_init_options`.
+ * use `git_worktree_prune_options_init`.
*
*/
typedef struct git_worktree_prune_options {
@@ -214,7 +214,7 @@ typedef struct git_worktree_prune_options {
* @param version The struct version; pass `GIT_WORKTREE_PRUNE_OPTIONS_VERSION`.
* @return Zero on success; -1 on failure.
*/
-GIT_EXTERN(int) git_worktree_prune_init_options(
+GIT_EXTERN(int) git_worktree_prune_options_init(
git_worktree_prune_options *opts,
unsigned int version);