From ac250c56c7d7bb11691c9dfbcd0dbf580d85e177 Mon Sep 17 00:00:00 2001 From: Ben Straub Date: Wed, 25 Apr 2012 16:24:22 -0700 Subject: First stab at implementation of rev-parse. This version supports refspecs of these kinds: - Full & partial SHAs - Output from "git describe" - "/refs/heads/master" (full ref names) - "master" (partial ref names) - "FETCH_HEAD" (named heads) --- include/git2/revparse.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 include/git2/revparse.h (limited to 'include/git2/revparse.h') diff --git a/include/git2/revparse.h b/include/git2/revparse.h new file mode 100644 index 000000000..3fd69d91d --- /dev/null +++ b/include/git2/revparse.h @@ -0,0 +1,22 @@ +/* + * Copyright (C) 2012 the libgit2 contributors + * + * 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_revparse_h__ +#define INCLUDE_git_revparse_h__ + +#include "common.h" +#include "types.h" + + +GIT_BEGIN_DECL + +GIT_EXTERN(int) git_revparse_single(git_object **out, git_repository *repo, const char *spec); + +//GIT_EXTERN(int) git_revparse_multi(TODO); + +GIT_END_DECL + +#endif -- cgit v1.2.1 From bfc13e7985a9368f7932115bc3d395dd1379b03d Mon Sep 17 00:00:00 2001 From: Ben Straub Date: Mon, 30 Apr 2012 09:58:43 -0700 Subject: Adding comment documentation for rev-parse api. --- include/git2/revparse.h | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'include/git2/revparse.h') diff --git a/include/git2/revparse.h b/include/git2/revparse.h index 3fd69d91d..4567027e5 100644 --- a/include/git2/revparse.h +++ b/include/git2/revparse.h @@ -11,12 +11,26 @@ #include "types.h" +/** + * @file git2/revparse.h + * @brief Git revision parsing routines + * @defgroup git_revparse Git revision parsing routines + * @ingroup Git + * @{ + */ GIT_BEGIN_DECL +/** + * Find an object, as specified by a revision string. See `man gitrevisions`, or the documentation + * for `git rev-parse` for information on the syntax accepted. + * + * @param out pointer to output object + * @param repo the repository to search in + * @param spec the textual specification for an object + * @return on success, GIT_ERROR otherwise (use git_error_last for information about the error) + */ GIT_EXTERN(int) git_revparse_single(git_object **out, git_repository *repo, const char *spec); -//GIT_EXTERN(int) git_revparse_multi(TODO); - +/** @} */ GIT_END_DECL - #endif -- cgit v1.2.1