diff options
author | Russell Belfer <rb@github.com> | 2014-02-07 16:14:17 -0800 |
---|---|---|
committer | Russell Belfer <rb@github.com> | 2014-02-07 16:14:17 -0800 |
commit | 2d9291943c253e9e1520f87b13abb1e81cffdb29 (patch) | |
tree | 653489f8d29124bb0a6d32d14dfed9d9974bc267 /include | |
parent | 57c47af107b45b73a46a1d157f8f758edd536bc7 (diff) | |
parent | db55bb73ff4bccbaccbb4c3a7f6b1fcf09498df7 (diff) | |
download | libgit2-2d9291943c253e9e1520f87b13abb1e81cffdb29.tar.gz |
Merge pull request #2099 from libgit2/bs/more-reflog-stuff
More reflogness
Diffstat (limited to 'include')
-rw-r--r-- | include/git2/push.h | 8 | ||||
-rw-r--r-- | include/git2/remote.h | 17 | ||||
-rw-r--r-- | include/git2/repository.h | 6 | ||||
-rw-r--r-- | include/git2/reset.h | 13 |
4 files changed, 39 insertions, 5 deletions
diff --git a/include/git2/push.h b/include/git2/push.h index 12f0e7f2c..67702aca2 100644 --- a/include/git2/push.h +++ b/include/git2/push.h @@ -103,10 +103,16 @@ GIT_EXTERN(int) git_push_add_refspec(git_push *push, const char *refspec); * Update remote tips after a push * * @param push The push object + * @param signature The identity to use when updating reflogs + * @param reflog_message The message to insert into the reflogs. If NULL, the + * default is "update by push". * * @return 0 or an error code */ -GIT_EXTERN(int) git_push_update_tips(git_push *push); +GIT_EXTERN(int) git_push_update_tips( + git_push *push, + const git_signature *signature, + const char *reflog_message); /** * Actually push all given refspecs diff --git a/include/git2/remote.h b/include/git2/remote.h index eba6ca7f9..238b6fd4f 100644 --- a/include/git2/remote.h +++ b/include/git2/remote.h @@ -355,9 +355,16 @@ GIT_EXTERN(void) git_remote_free(git_remote *remote); * Update the tips to the new state * * @param remote the remote to update + * @param signature The identity to use when updating reflogs + * @param reflog_message The message to insert into the reflogs. If NULL, the + * default is "fetch <name>", where <name> is the name of + * the remote (or its url, for in-memory remotes). * @return 0 or an error code */ -GIT_EXTERN(int) git_remote_update_tips(git_remote *remote); +GIT_EXTERN(int) git_remote_update_tips( + git_remote *remote, + const git_signature *signature, + const char *reflog_message); /** * Download new data and update tips @@ -366,9 +373,15 @@ GIT_EXTERN(int) git_remote_update_tips(git_remote *remote); * disconnect and update the remote-tracking branches. * * @param remote the remote to fetch from + * @param signature The identity to use when updating reflogs + * @param reflog_message The message to insert into the reflogs. If NULL, the + * default is "fetch" * @return 0 or an error code */ -GIT_EXTERN(int) git_remote_fetch(git_remote *remote); +GIT_EXTERN(int) git_remote_fetch( + git_remote *remote, + const git_signature *signature, + const char *reflog_message); /** * Return whether a string is a valid remote URL diff --git a/include/git2/repository.h b/include/git2/repository.h index 648667cd6..bf12c7a69 100644 --- a/include/git2/repository.h +++ b/include/git2/repository.h @@ -615,11 +615,15 @@ GIT_EXTERN(int) git_repository_set_head_detached( * Otherwise, the HEAD will be detached and point to the peeled Commit. * * @param repo Repository pointer + * @param signature The identity that will used to populate the reflog entry + * @param log_message The one line long message to be appended to the reflog * @return 0 on success, GIT_EUNBORNBRANCH when HEAD points to a non existing * branch or an error code */ GIT_EXTERN(int) git_repository_detach_head( - git_repository* repo); + git_repository* repo, + const git_signature *signature, + const char *reflog_message); typedef enum { GIT_REPOSITORY_STATE_NONE, diff --git a/include/git2/reset.h b/include/git2/reset.h index c36781722..1759cc036 100644 --- a/include/git2/reset.h +++ b/include/git2/reset.h @@ -48,10 +48,21 @@ typedef enum { * * @param reset_type Kind of reset operation to perform. * + * @param signature The identity that will used to populate the reflog entry + * + * @param log_message The one line long message to be appended to the reflog. + * The reflog is only updated if the affected direct reference is actually + * changing. If NULL, the default is "reset: moving"; if you want something more + * useful, provide a message. + * * @return 0 on success or an error code */ GIT_EXTERN(int) git_reset( - git_repository *repo, git_object *target, git_reset_t reset_type); + git_repository *repo, + git_object *target, + git_reset_t reset_type, + git_signature *signature, + const char *log_message); /** * Updates some entries in the index from the target commit tree. |