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 * Params: 33 * ahead = number of unique from commits in `upstream` 34 * behind = number of unique from commits in `local` 35 * repo = the repository where the commits exist 36 * local = the commit for local 37 * upstream = the commit for upstream 38 */ 39 //GIT_EXTERN 40 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); 41 42 /** 43 * Determine if a commit is the descendant of another commit. 44 * 45 * Note that a commit is not considered a descendant of itself, in contrast 46 * to `git merge-base --is-ancestor`. 47 * 48 * Params: 49 * commit = a previously loaded commit. 50 * ancestor = a potential ancestor commit. 51 * 52 * Returns: 1 if the given commit is a descendant of the potential ancestor, 0 if not, error code otherwise. 53 */ 54 //GIT_EXTERN 55 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); 56 57 /** @} */