History

all docs for git-commitgraph::file

Sebastian Thiel committed 5 years ago

Commit 8b262011 parent 23bba1c6 files · +54 −20Browse files

Showing the changes to git-commitgraph/src/file/mod.rs (1 of 6 files). Show all

Unified · Split

git-commitgraph/src/file/mod.rs+9−4
@@ -1,12 +1,17 @@
1//! Operations on a single commit-graph file.1//! Operations on a single commit-graph file.
2
2mod access;3mod access;
4
5///
3pub mod commit;6pub mod commit;
7pub use commit::Commit;
8
4mod init;9mod init;
10///
5pub mod verify;11pub mod verify;
6 12
7pub use init::Error;13pub use init::Error;
8 14
9pub use commit::Commit;
10use filebuffer::FileBuffer;15use filebuffer::FileBuffer;
11use git_hash::SIZE_OF_SHA1_DIGEST as SHA1_SIZE;16use git_hash::SIZE_OF_SHA1_DIGEST as SHA1_SIZE;
12use std::{17use std::{
@@ -22,7 +27,7 @@ const SIGNATURE: &[u8] = b"CGPH"; · 9 unmodified lines
22/// A single commit-graph file.27/// A single commit-graph file.
23///28///
24/// All operations on a `File` are local to that graph file. Since a commit graph can span multiple29/// All operations on a `File` are local to that graph file. Since a commit graph can span multiple
25/// files, all interesting graph operations belong on `Graph`.30/// files, all interesting graph operations belong on [`Graph`][crate::Graph].
26pub struct File {31pub struct File {
27 base_graph_count: u8,32 base_graph_count: u8,
28 base_graphs_list_offset: Option<usize>,33 base_graphs_list_offset: Option<usize>,
@@ -39,8 +44,8 @@ pub struct File { · 10 unmodified lines
39/// Commits within a graph file are sorted in lexicographical order by OID; a commit's lexigraphical position44/// Commits within a graph file are sorted in lexicographical order by OID; a commit's lexigraphical position
40/// is its position in this ordering. If a commit graph spans multiple files, each file's commits45/// is its position in this ordering. If a commit graph spans multiple files, each file's commits
41/// start at lexigraphical position 0, so it is unique across a single file but is not unique across46/// start at lexigraphical position 0, so it is unique across a single file but is not unique across
42/// the whole commit graph. Each commit also has a graph position (`graph::Position`), which is unique47/// the whole commit graph. Each commit also has a graph position ([`graph::Position`][crate::graph::Position]),
43/// across the whole commit graph. In order to avoid accidentally mixing lexigraphical positions with graph48/// which is unique /// across the whole commit graph. In order to avoid accidentally mixing lexigraphical positions with graph
44/// positions, distinct types are used for each.49/// positions, distinct types are used for each.
45#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]50#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
46pub struct Position(pub u32);51pub struct Position(pub u32);