Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
168e9d74
Commit
168e9d74
authored
Feb 05, 2013
by
Ben Straub
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change API based on @arrbee's feedback
parent
2532c903
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
13 deletions
+33
-13
include/git2/blame.h
+33
-13
No files found.
include/git2/blame.h
View file @
168e9d74
...
...
@@ -51,11 +51,11 @@ typedef enum {
* associate those lines with the parent commit. The default value is 20.
* This value only takes effect if any of the `GIT_BLAME_TRACK_COPIES_*`
* flags are specified.
* - `newest_commit
ish
` is a rev-parse spec that resolves to the most recent
* - `newest_commit` is a rev-parse spec that resolves to the most recent
* commit to consider. The default is HEAD.
* - `
oldest_commitish` is a rev-parse spec that resolves to the oldest commit
*
to consider. The default is the first commit encountered with a NULL
* parent.
* - `
newest_commit` is the newest commit to consider. The default is HEAD.
*
- `oldest_commit` is the oldest commit to consider. The default is the
*
first commit encountered with a NULL
parent.
* - `min_line` is the first line in the file to blame. The default is 1 (line
* numbers start with 1).
* - `max_line` is the last line in the file to blame. The default is the last
...
...
@@ -67,8 +67,8 @@ typedef struct git_blame_options {
uint32_t
flags
;
uint16_t
min_match_characters
;
const
char
*
newest_commitish
;
const
char
*
oldest_commitish
;
const
git_commit
*
newest_commit
;
const
git_commit
*
oldest_commit
;
uint32_t
min_line
;
uint32_t
max_line
;
}
git_blame_options
;
...
...
@@ -105,21 +105,40 @@ typedef struct git_blame_hunk {
}
git_blame_hunk
;
typedef
struct
git_blame_results
git_blame_results
;
/**
* Gets the number of hunks that exist in the results structure.
*/
GIT_EXTERN
(
uint32_t
)
git_blame_results_hunk_count
(
git_blame_results
*
results
);
/**
* Gets the blame hunk at the given index.
*
* @param results the results structure to query
* @param index index of the hunk to retrieve
* @return the hunk at the given index, or NULL on error
*/
GIT_EXTERN
(
const
git_blame_hunk
*
)
git_blame_results_hunk_byindex
(
git_blame_results
*
results
,
uint32_t
index
);
/**
*
Results structure for git_blame
.
*
Gets the hunk that relates to the given line number in the newest commit
.
*
* - `hunks` is an array of hunks.
* - `hunk_count` is the number of hunk structures in `hunks`.
* @param results the results structure to query
* @param lineno the (1-based) line number to find a hunk for
* @return the hunk that contains the given line, or NULL on error
*/
typedef
struct
git_blame_results
{
const
git_blame_hunk
*
const
hunks
;
uint32_t
hunk_count
;
}
git_blame_results
;
GIT_EXTERN
(
const
git_blame_hunk
*
)
git_blame_results_hunk_byline
(
git_blame_results
*
results
,
uint32_t
lineno
);
/**
* Get the blame for a single file.
*
* @param out pointer that will receive the results object
* @param repo repository whose history is to be walked
* @param path path to file to consider
* @param options options for the blame operation. If NULL, this is treated as
* though GIT_BLAME_OPTIONS_INIT were passed.
...
...
@@ -128,6 +147,7 @@ typedef struct git_blame_results {
*/
GIT_EXTERN
(
int
)
git_blame_file
(
git_blame_results
**
out
,
git_repository
*
repo
,
const
char
*
path
,
git_blame_options
*
options
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment