pub struct Comparison {Show 14 fields
pub base_commit: FullCommit,
pub merge_base_commit: FullCommit,
pub head_commit: FullCommit,
pub status: String,
pub ahead_by: u32,
pub behind_by: u32,
pub total_commits: u32,
pub commits: Vec<FullCommit>,
pub files: Vec<FileChange>,
pub html_url: String,
pub permalink_url: String,
pub diff_url: String,
pub patch_url: String,
pub url: String,
}Expand description
The result of comparing two Git refs (commits, branches, or tags).
Contains the full list of commits between the two refs and every file that changed, together with statistics useful for generating changelogs and release notes.
§Examples
let cmp = client.compare_commits("owner", "repo", "v1.0.0", "v1.1.0").await?;
println!("Status: {} ({} ahead, {} behind)",
cmp.status, cmp.ahead_by, cmp.behind_by);
println!("{} commits, {} files changed",
cmp.total_commits, cmp.files.len());Fields§
§base_commit: FullCommitThe base commit (starting point of the comparison).
merge_base_commit: FullCommitThe common ancestor (merge-base) of the two refs.
head_commit: FullCommitThe head commit (ending point of the comparison).
status: StringRelationship between base and head.
Possible values: "ahead", "behind", "identical", "diverged".
ahead_by: u32Number of commits the head is ahead of the base.
behind_by: u32Number of commits the head is behind the base.
total_commits: u32Total number of commits between base and head.
commits: Vec<FullCommit>All commits from base to head in chronological order (oldest first).
GitHub limits this to 250 commits.
files: Vec<FileChange>All files that changed between base and head.
html_url: StringWeb interface URL for this comparison.
permalink_url: StringPermalink URL for this comparison.
diff_url: StringURL for the diff view.
patch_url: StringURL for the patch view.
url: StringAPI URL for this comparison (machine-readable endpoint).
Trait Implementations§
Source§impl Clone for Comparison
impl Clone for Comparison
Source§fn clone(&self) -> Comparison
fn clone(&self) -> Comparison
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more