RFC: Initial git save format

Linus Torvalds torvalds at linux-foundation.org
Thu Mar 6 14:40:43 PST 2014


On Thu, Mar 6, 2014 at 2:29 PM, Linus Torvalds
<torvalds at linux-foundation.org> wrote:
>
> I'll have to figure out the versioning, it is not obvious where that happens.
>
> Damn library authors that don't get the whole "you need to get versioning right"

This patch on top of the earlier one seems to make it compile both
with current HEAD of libgit2 and with libgit2-0.19.

               Linus
-------------- next part --------------
 save-git.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/save-git.c b/save-git.c
index 1f84bd0cfc27..6e0d989c0184 100644
--- a/save-git.c
+++ b/save-git.c
@@ -526,6 +526,17 @@ static int create_git_tree(git_repository *repo, struct dir *tree, bool select_o
 	return 0;
 }
 
+/*
+ * libgit2 revision 0.19 and earlier do not have the signature and
+ * message log arguments.
+ */
+#if !LIBGIT2_VER_MAJOR && LIBGIT2_VER_MINOR <= 19
+  #define git_branch_create(out,repo,branch_name,target,force,sig,msg) \
+	git_branch_create(out,repo,branch_name,target,force)
+  #define git_reference_set_target(out,ref,target,signature,log_message) \
+	git_reference_set_target(out,ref,target)
+#endif
+
 static int create_new_commit(git_repository *repo, const char *branch, git_oid *tree_id)
 {
 	int ret;


More information about the subsurface mailing list