Blame include/git2/graph.h

Packit Service 20376f
/*
Packit Service 20376f
 * Copyright (C) the libgit2 contributors. All rights reserved.
Packit Service 20376f
 *
Packit Service 20376f
 * This file is part of libgit2, distributed under the GNU GPL v2 with
Packit Service 20376f
 * a Linking Exception. For full terms see the included COPYING file.
Packit Service 20376f
 */
Packit Service 20376f
#ifndef INCLUDE_git_graph_h__
Packit Service 20376f
#define INCLUDE_git_graph_h__
Packit Service 20376f
Packit Service 20376f
#include "common.h"
Packit Service 20376f
#include "types.h"
Packit Service 20376f
#include "oid.h"
Packit Service 20376f
Packit Service 20376f
/**
Packit Service 20376f
 * @file git2/graph.h
Packit Service 20376f
 * @brief Git graph traversal routines
Packit Service 20376f
 * @defgroup git_revwalk Git graph traversal routines
Packit Service 20376f
 * @ingroup Git
Packit Service 20376f
 * @{
Packit Service 20376f
 */
Packit Service 20376f
GIT_BEGIN_DECL
Packit Service 20376f
Packit Service 20376f
/**
Packit Service 20376f
 * Count the number of unique commits between two commit objects
Packit Service 20376f
 *
Packit Service 20376f
 * There is no need for branches containing the commits to have any
Packit Service 20376f
 * upstream relationship, but it helps to think of one as a branch and
Packit Service 20376f
 * the other as its upstream, the `ahead` and `behind` values will be
Packit Service 20376f
 * what git would report for the branches.
Packit Service 20376f
 *
Packit Service 20376f
 * @param ahead number of unique from commits in `upstream`
Packit Service 20376f
 * @param behind number of unique from commits in `local`
Packit Service 20376f
 * @param repo the repository where the commits exist
Packit Service 20376f
 * @param local the commit for local
Packit Service 20376f
 * @param upstream the commit for upstream
Packit Service 20376f
 */
Packit Service 20376f
GIT_EXTERN(int) git_graph_ahead_behind(size_t *ahead, size_t *behind, git_repository *repo, const git_oid *local, const git_oid *upstream);
Packit Service 20376f
Packit Service 20376f
Packit Service 20376f
/**
Packit Service 20376f
 * Determine if a commit is the descendant of another commit.
Packit Service 20376f
 *
Packit Service 20376f
 * @param commit a previously loaded commit.
Packit Service 20376f
 * @param ancestor a potential ancestor commit.
Packit Service 20376f
 * @return 1 if the given commit is a descendant of the potential ancestor,
Packit Service 20376f
 * 0 if not, error code otherwise.
Packit Service 20376f
 */
Packit Service 20376f
GIT_EXTERN(int) git_graph_descendant_of(
Packit Service 20376f
	git_repository *repo,
Packit Service 20376f
	const git_oid *commit,
Packit Service 20376f
	const git_oid *ancestor);
Packit Service 20376f
Packit Service 20376f
/** @} */
Packit Service 20376f
GIT_END_DECL
Packit Service 20376f
#endif