Showing the changes to git-commitgraph/src/file/mod.rs (1 of 6 files). Show all
Unified · Split
| @@ -1,12 +1,17 @@ | |||
| 1 | //! Operations on a single commit-graph file. | 1 | //! Operations on a single commit-graph file. |
| 2 | |||
| 2 | mod access; | 3 | mod access; |
| 4 | |||
| 5 | /// | ||
| 3 | pub mod commit; | 6 | pub mod commit; |
| 7 | pub use commit::Commit; | ||
| 8 | |||
| 4 | mod init; | 9 | mod init; |
| 10 | /// | ||
| 5 | pub mod verify; | 11 | pub mod verify; |
| 6 | 12 | ||
| 7 | pub use init::Error; | 13 | pub use init::Error; |
| 8 | 14 | ||
| 9 | pub use commit::Commit; | ||
| 10 | use filebuffer::FileBuffer; | 15 | use filebuffer::FileBuffer; |
| 11 | use git_hash::SIZE_OF_SHA1_DIGEST as SHA1_SIZE; | 16 | use git_hash::SIZE_OF_SHA1_DIGEST as SHA1_SIZE; |
| 12 | use std::{ | 17 | use 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 multiple | 29 | /// 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]. |
| 26 | pub struct File { | 31 | pub 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 position | 44 | /// 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 commits | 45 | /// 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 across | 46 | /// 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 unique | 47 | /// 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 graph | 48 | /// 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)] |
| 46 | pub struct Position(pub u32); | 51 | pub struct Position(pub u32); |