1 /* 2 * Copyright (C) the libgit2 contributors. All rights reserved. 3 * 4 * This file is part of libgit2, distributed under the GNU GPL v2 with 5 * a Linking Exception. For full terms see the included COPYING file. 6 */ 7 module libgit2_d.graph; 8 9 10 private static import libgit2_d.oid; 11 private static import libgit2_d.types; 12 13 /** 14 * @file git2/graph.h 15 * @brief Git graph traversal routines 16 * @defgroup git_revwalk Git graph traversal routines 17 * @ingroup Git 18 * @{ 19 */ 20 extern (C): 21 nothrow @nogc: 22 public: 23 24 /** 25 * Count the number of unique commits between two commit objects 26 * 27 * There is no need for branches containing the commits to have any 28 * upstream relationship, but it helps to think of one as a branch and 29 * the other as its upstream, the `ahead` and `behind` values will be 30 * what git would report for the branches. 31 * 32 * @param ahead number of unique from commits in `upstream` 33 * @param behind number of unique from commits in `local` 34 * @param repo the repository where the commits exist 35 * @param local the commit for local 36 * @param upstream the commit for upstream 37 */ 38 //GIT_EXTERN 39 int git_graph_ahead_behind(size_t* ahead, size_t* behind, libgit2_d.types.git_repository* repo, const (libgit2_d.oid.git_oid)* local, const (libgit2_d.oid.git_oid)* upstream); 40 41 /** 42 * Determine if a commit is the descendant of another commit. 43 * 44 * Note that a commit is not considered a descendant of itself, in contrast 45 * to `git merge-base --is-ancestor`. 46 * 47 * @param commit a previously loaded commit. 48 * @param ancestor a potential ancestor commit. 49 * @return 1 if the given commit is a descendant of the potential ancestor, 50 * 0 if not, error code otherwise. 51 */ 52 //GIT_EXTERN 53 int git_graph_descendant_of(libgit2_d.types.git_repository* repo, const (libgit2_d.oid.git_oid)* commit, const (libgit2_d.oid.git_oid)* ancestor); 54 55 /** @} */