summaryrefslogtreecommitdiff
path: root/include/git2/rebase.h
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@microsoft.com>2015-03-17 15:53:04 -0400
committerEdward Thomson <ethomson@microsoft.com>2015-04-20 16:22:54 -0400
commitf3a199dd9952a885621848c82b7b68c78723a9ed (patch)
tree7f9f044bba14fc6575f467b4b66b53c03bfa9e11 /include/git2/rebase.h
parent5ae38538c6dd88cca058fac1b84e29df4fed60e4 (diff)
downloadlibgit2-f3a199dd9952a885621848c82b7b68c78723a9ed.tar.gz
rebase: init and open take a rebase_options
`git_rebase_init` and `git_rebase_open` should take a `git_rebase_options` and use it for future rebase operations on that `rebase` object.
Diffstat (limited to 'include/git2/rebase.h')
-rw-r--r--include/git2/rebase.h54
1 files changed, 30 insertions, 24 deletions
diff --git a/include/git2/rebase.h b/include/git2/rebase.h
index 8171682e4..370792f58 100644
--- a/include/git2/rebase.h
+++ b/include/git2/rebase.h
@@ -30,19 +30,32 @@ typedef struct {
unsigned int version;
/**
- * Provide a quiet rebase experience; unused by libgit2 but provided for
- * interoperability with other clients.
+ * Used by `git_rebase_init`, this will instruct other clients working
+ * on this rebase that you want a quiet rebase experience, which they
+ * may choose to provide in an application-specific manner. This has no
+ * effect upon libgit2 directly, but is provided for interoperability with
+ * other clients.
*/
int quiet;
/**
- * Canonical name of the notes reference used to rewrite notes for
- * rebased commits when finishing the rebase; if NULL, the contents of
- * the coniguration option `notes.rewriteRef` is examined, unless the
- * configuration option `notes.rewrite.rebase` is set to false. If
- * `notes.rewriteRef` is NULL, notes will not be rewritten.
+ * Used by `git_rebase_finish`, this is the canonical name of the notes
+ * reference used to rewrite notes for rebased commits when finishing the
+ * rebase; if NULL, the contents of the coniguration option
+ * `notes.rewriteRef` is examined, unless the configuration option
+ * `notes.rewrite.rebase` is set to false. If `notes.rewriteRef` is also
+ * NULL, notes will not be rewritten.
*/
const char *rewrite_notes_ref;
+
+ /**
+ * Options to control how files are written during `git_rebase_init`,
+ * `git_checkout_next` and `git_checkout_abort`. Note that a minimum
+ * strategy of `GIT_CHECKOUT_SAFE` is defaulted in `init` and `next`,
+ * and a minimum strategy of `GIT_CHECKOUT_FORCE` is defaulted in
+ * `abort` to match git semantics.
+ */
+ git_checkout_options *checkout_options;
} git_rebase_options;
/**
@@ -142,9 +155,7 @@ GIT_EXTERN(int) git_rebase_init_options(
* reachable commits
* @param onto The branch to rebase onto, or NULL to rebase onto the given
* upstream
- * @param opts Options to specify how rebase is performed
- * @param checkout_opts Options to specify how the checkout to the `onto`
- * branch is performed
+ * @param opts Options to specify how rebase is performed, or NULL
* @return Zero on success; -1 on failure.
*/
GIT_EXTERN(int) git_rebase_init(
@@ -153,8 +164,7 @@ GIT_EXTERN(int) git_rebase_init(
const git_annotated_commit *branch,
const git_annotated_commit *upstream,
const git_annotated_commit *onto,
- const git_rebase_options *opts,
- const git_checkout_options *checkout_opts);
+ const git_rebase_options *opts);
/**
* Opens an existing rebase that was previously started by either an
@@ -162,9 +172,13 @@ GIT_EXTERN(int) git_rebase_init(
*
* @param out Pointer to store the rebase object
* @param repo The repository that has a rebase in-progress
+ * @param opts Options to specify how rebase is performed
* @return Zero on success; -1 on failure.
*/
-GIT_EXTERN(int) git_rebase_open(git_rebase **out, git_repository *repo);
+GIT_EXTERN(int) git_rebase_open(
+ git_rebase **out,
+ git_repository *repo,
+ const git_rebase_options *opts);
/**
* Gets the count of rebase operations that are to be applied.
@@ -205,13 +219,11 @@ GIT_EXTERN(git_rebase_operation *) git_rebase_operation_byindex(
*
* @param operation Pointer to store the rebase operation that is to be performed next
* @param rebase The rebase in progress
- * @param checkout_opts Options to specify how the patch should be checked out
* @return Zero on success; -1 on failure.
*/
GIT_EXTERN(int) git_rebase_next(
git_rebase_operation **operation,
- git_rebase *rebase,
- git_checkout_options *checkout_opts);
+ git_rebase *rebase);
/**
* Commits the current patch. You must have resolved any conflicts that
@@ -248,14 +260,10 @@ GIT_EXTERN(int) git_rebase_commit(
* and working directory to their state before rebase began.
*
* @param rebase The rebase that is in-progress
- * @param checkout_opts The checkout options that will be used to influence a
- * hard reset of the working directory.
* @return Zero on success; GIT_ENOTFOUND if a rebase is not in progress,
* -1 on other errors.
*/
-GIT_EXTERN(int) git_rebase_abort(
- git_rebase *rebase,
- const git_checkout_options *checkout_opts);
+GIT_EXTERN(int) git_rebase_abort(git_rebase *rebase);
/**
* Finishes a rebase that is currently in progress once all patches have
@@ -263,13 +271,11 @@ GIT_EXTERN(int) git_rebase_abort(
*
* @param rebase The rebase that is in-progress
* @param signature The identity that is finishing the rebase (optional)
- * @param opts Options to specify how rebase is finished
* @return Zero on success; -1 on error
*/
GIT_EXTERN(int) git_rebase_finish(
git_rebase *rebase,
- const git_signature *signature,
- const git_rebase_options *opts);
+ const git_signature *signature);
/**
* Frees the `git_rebase` object.