summaryrefslogtreecommitdiff
path: root/include/git2/graph.h
diff options
context:
space:
mode:
authorVicent Marti <tanoku@gmail.com>2013-04-16 17:46:41 +0200
committerVicent Marti <tanoku@gmail.com>2013-04-16 17:46:41 +0200
commita50086d174658914d4d6462afbc83b02825b1f5b (patch)
treee8daa1c7bf678222cf351445179837bed7db3a72 /include/git2/graph.h
parent5b9fac39d8a76b9139667c26a63e6b3f204b3977 (diff)
parentf124ebd457bfbf43de3516629aaba5a279636e04 (diff)
downloadlibgit2-a50086d174658914d4d6462afbc83b02825b1f5b.tar.gz
Merge branch 'development'v0.18.0
Diffstat (limited to 'include/git2/graph.h')
-rw-r--r--include/git2/graph.h41
1 files changed, 41 insertions, 0 deletions
diff --git a/include/git2/graph.h b/include/git2/graph.h
new file mode 100644
index 000000000..a2710219e
--- /dev/null
+++ b/include/git2/graph.h
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) the libgit2 contributors. All rights reserved.
+ *
+ * This file is part of libgit2, distributed under the GNU GPL v2 with
+ * a Linking Exception. For full terms see the included COPYING file.
+ */
+#ifndef INCLUDE_git_graph_h__
+#define INCLUDE_git_graph_h__
+
+#include "common.h"
+#include "types.h"
+#include "oid.h"
+
+/**
+ * @file git2/graph.h
+ * @brief Git graph traversal routines
+ * @defgroup git_revwalk Git graph traversal routines
+ * @ingroup Git
+ * @{
+ */
+GIT_BEGIN_DECL
+
+/**
+ * Count the number of unique commits between two commit objects
+ *
+ * There is no need for branches containing the commits to have any
+ * upstream relationship, but it helps to think of one as a branch and
+ * the other as its upstream, the `ahead` and `behind` values will be
+ * what git would report for the branches.
+ *
+ * @param ahead number of unique from commits in `upstream`
+ * @param behind number of unique from commits in `local`
+ * @param repo the repository where the commits exist
+ * @param local the commit for local
+ * @param upstream the commit for upstream
+ */
+GIT_EXTERN(int) git_graph_ahead_behind(size_t *ahead, size_t *behind, git_repository *repo, const git_oid *local, const git_oid *upstream);
+
+/** @} */
+GIT_END_DECL
+#endif