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>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107
diff --git a/include/git/commit.h b/include/git/commit.h
index 160148d..8cb3e7d 100644
--- a/include/git/commit.h
+++ b/include/git/commit.h
@@ -58,7 +58,7 @@ struct git_commit {
* pool's git_odb, or if the commit is present but is
* 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.
diff --git a/include/git/common.h b/include/git/common.h
index ca65c74..47ee6e2 100644
--- a/include/git/common.h
+++ b/include/git/common.h
@@ -85,7 +85,7 @@
GIT_BEGIN_DECL
/** A revision traversal pool. */
-typedef struct git_revp git_revp;
+typedef struct git_revpool git_revpool;
/** @} */
GIT_END_DECL
diff --git a/include/git/revwalk.h b/include/git/revwalk.h
index cd87489..5c0b005 100644
--- a/include/git/revwalk.h
+++ b/include/git/revwalk.h
@@ -50,40 +50,40 @@ GIT_BEGIN_DECL
* @param db the database objects are read from.
* @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.
* @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.
* @param pool the pool being used for the traversal.
* @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.
* @param pool the pool being used for the traversal.
* @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.
* @param pool the pool to pop the commit from.
* @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.
* @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
diff --git a/src/revwalk.c b/src/revwalk.c
index 2c9eb23..91822c5 100644
--- a/src/revwalk.c
+++ b/src/revwalk.c
@@ -26,13 +26,13 @@
#include "git/revwalk.h"
#include <stdlib.h>
-struct git_revp {
+struct git_revpool {
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)
return NULL;
@@ -40,7 +40,7 @@ git_revp *git_revp_alloc(git_odb *db)
return walk;
}
-void git_revp_free(git_revp *walk)
+void git_revpool_free(git_revpool *walk)
{
free(walk);
}