git_revision/
types.rs

1/// A revision specification without any bindings to a repository, useful for serialization or movement over thread boundaries.
2///
3/// Note that all [object ids][git_hash::ObjectId] should be a committish, but don't have to be.
4/// Unless the field name contains `_exclusive`, the respective objects are included in the set.
5#[derive(Copy, Clone, Debug, Ord, PartialOrd, Eq, PartialEq, Hash)]
6#[cfg_attr(feature = "serde1", derive(serde::Serialize, serde::Deserialize))]
7pub enum Spec {
8    /// Include commits reachable from this revision, i.e. `a` and its ancestors.
9    ///
10    /// The equivalent to [crate::spec::Kind::IncludeReachable], but with data.
11    Include(git_hash::ObjectId),
12    /// Exclude commits reachable from this revision, i.e. `a` and its ancestors. Example: `^a`.
13    ///
14    /// The equivalent to [crate::spec::Kind::ExcludeReachable], but with data.
15    Exclude(git_hash::ObjectId),
16    /// Every commit that is reachable from `from` to `to`, but not any ancestors of `from`. Example: `from..to`.
17    ///
18    /// The equivalent to [crate::spec::Kind::RangeBetween], but with data.
19    Range {
20        /// The starting point of the range, which is included in the set.
21        from: git_hash::ObjectId,
22        /// The end point of the range, which is included in the set.
23        to: git_hash::ObjectId,
24    },
25    /// Every commit reachable through either `theirs` or `ours`, but no commit that is reachable by both. Example: `theirs...ours`.
26    ///
27    /// The equivalent to [crate::spec::Kind::ReachableToMergeBase], but with data.
28    Merge {
29        /// Their side of the merge, which is included in the set.
30        theirs: git_hash::ObjectId,
31        /// Our side of the merge, which is included in the set.
32        ours: git_hash::ObjectId,
33    },
34    /// Include every commit of all parents of `a`, but not `a` itself. Example: `a^@`.
35    ///
36    /// The equivalent to [crate::spec::Kind::IncludeReachableFromParents], but with data.
37    IncludeOnlyParents(
38        /// Include only the parents of this object, but not the object itself.
39        git_hash::ObjectId,
40    ),
41    /// Exclude every commit of all parents of `a`, but not `a` itself. Example: `a^!`.
42    ///
43    /// The equivalent to [crate::spec::Kind::ExcludeReachableFromParents], but with data.
44    ExcludeParents(
45        /// Exclude the parents of this object, but not the object itself.
46        git_hash::ObjectId,
47    ),
48}