mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-30 15:11:33 +00:00
s/git_revp/git_revpool/
git_revp is something I personally can't stop pronouncing "rev pointer". I'm sure others would suffer the same problem. Also, rename the git_revp_ sub-api "gitrp_". This is the first of many such renames, primarily done to prevent extreme inflation in the "git_" namespace, which we'd like to reserve for a higher-level API. While we're at it, we remove the noise-char "c" from a lot of functions. Since revision walking is all about commits, the common case should be that we're dealing with commits. Exceptions can get a more mnemonic description as needed. Signed-off-by: Andreas Ericsson <ae@op5.se> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
This commit is contained in:
parent
dff79e27d3
commit
1b9e92c73b
@ -58,7 +58,7 @@ struct git_commit {
|
|||||||
* pool's git_odb, or if the commit is present but is
|
* pool's git_odb, or if the commit is present but is
|
||||||
* too malformed to be parsed successfully.
|
* too malformed to be parsed successfully.
|
||||||
*/
|
*/
|
||||||
GIT_EXTERN(git_commit*) git_commit_parse(git_revp *pool, const git_oid *id);
|
GIT_EXTERN(git_commit*) git_commit_parse(git_revpool *pool, const git_oid *id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the id of a commit.
|
* Get the id of a commit.
|
||||||
|
@ -85,7 +85,7 @@
|
|||||||
GIT_BEGIN_DECL
|
GIT_BEGIN_DECL
|
||||||
|
|
||||||
/** A revision traversal pool. */
|
/** A revision traversal pool. */
|
||||||
typedef struct git_revp git_revp;
|
typedef struct git_revpool git_revpool;
|
||||||
|
|
||||||
/** @} */
|
/** @} */
|
||||||
GIT_END_DECL
|
GIT_END_DECL
|
||||||
|
@ -50,40 +50,40 @@ GIT_BEGIN_DECL
|
|||||||
* @param db the database objects are read from.
|
* @param db the database objects are read from.
|
||||||
* @return the new traversal handle; NULL if memory is exhausted.
|
* @return the new traversal handle; NULL if memory is exhausted.
|
||||||
*/
|
*/
|
||||||
GIT_EXTERN(git_revp*) git_revp_alloc(git_odb *db);
|
GIT_EXTERN(git_revpool*) gitrp_alloc(git_odb *db);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reset the traversal machinary for reuse.
|
* Reset the traversal machinary for reuse.
|
||||||
* @param pool traversal handle to reset.
|
* @param pool traversal handle to reset.
|
||||||
*/
|
*/
|
||||||
GIT_EXTERN(void) git_revp_reset(git_revp *pool);
|
GIT_EXTERN(void) gitrp_reset(git_revpool *pool);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Mark an object to start traversal from.
|
* Mark an object to start traversal from.
|
||||||
* @param pool the pool being used for the traversal.
|
* @param pool the pool being used for the traversal.
|
||||||
* @param commit the commit the commit to start from.
|
* @param commit the commit the commit to start from.
|
||||||
*/
|
*/
|
||||||
GIT_EXTERN(void) git_revp_pushc(git_revp *pool, git_commit *commit);
|
GIT_EXTERN(void) gitrp_push(git_revpool *pool, git_commit *commit);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Mark a commit (and its ancestors) uninteresting for the output.
|
* Mark a commit (and its ancestors) uninteresting for the output.
|
||||||
* @param pool the pool being used for the traversal.
|
* @param pool the pool being used for the traversal.
|
||||||
* @param commit the commit the commit to start from.
|
* @param commit the commit the commit to start from.
|
||||||
*/
|
*/
|
||||||
GIT_EXTERN(void) git_revp_hidec(git_revp *pool, git_commit *commit);
|
GIT_EXTERN(void) gitrp_hide(git_revpool *pool, git_commit *commit);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the next commit from the revision traversal.
|
* Get the next commit from the revision traversal.
|
||||||
* @param pool the pool to pop the commit from.
|
* @param pool the pool to pop the commit from.
|
||||||
* @return next commit; NULL if there is no more output.
|
* @return next commit; NULL if there is no more output.
|
||||||
*/
|
*/
|
||||||
GIT_EXTERN(git_commit*) git_revp_nextc(git_revp *pool);
|
GIT_EXTERN(git_commit*) gitrp_next(git_revpool *pool);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Free a revwalk previously allocated.
|
* Free a revwalk previously allocated.
|
||||||
* @param pool traversal handle to close. If NULL nothing occurs.
|
* @param pool traversal handle to close. If NULL nothing occurs.
|
||||||
*/
|
*/
|
||||||
GIT_EXTERN(void) git_revp_free(git_revp *pool);
|
GIT_EXTERN(void) gitrp_free(git_revpool *pool);
|
||||||
|
|
||||||
/** @} */
|
/** @} */
|
||||||
GIT_END_DECL
|
GIT_END_DECL
|
||||||
|
@ -26,13 +26,13 @@
|
|||||||
#include "git/revwalk.h"
|
#include "git/revwalk.h"
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
struct git_revp {
|
struct git_revpool {
|
||||||
git_odb *db;
|
git_odb *db;
|
||||||
};
|
};
|
||||||
|
|
||||||
git_revp *git_revp_alloc(git_odb *db)
|
git_revpool *git_revpool_alloc(git_odb *db)
|
||||||
{
|
{
|
||||||
git_revp *walk = malloc(sizeof(*walk));
|
git_revpool *walk = malloc(sizeof(*walk));
|
||||||
if (!walk)
|
if (!walk)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
@ -40,7 +40,7 @@ git_revp *git_revp_alloc(git_odb *db)
|
|||||||
return walk;
|
return walk;
|
||||||
}
|
}
|
||||||
|
|
||||||
void git_revp_free(git_revp *walk)
|
void git_revpool_free(git_revpool *walk)
|
||||||
{
|
{
|
||||||
free(walk);
|
free(walk);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user