1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#[macro_use]
extern crate error_chain;
mod errors;
//pub use errors::*;
use serde::{Deserialize, Serialize};
use std::collections::HashSet;
use std::path::PathBuf;

mod convert;
mod git;

struct Paths;
mod paths;

/// A structure represent a git remote url
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
pub struct Remote {
    url: String,
}
mod remote;

// region struct Remotes
/// A unique collection of Remotes
#[derive(Serialize, Deserialize)]
pub struct Remotes {
    origins: HashSet<String>,
    #[serde(skip_serializing)]
    filename: PathBuf,
}
mod remotes;
// endregion struct Remotes

/// A structure representing a git repository
#[derive(Serialize, Deserialize, Debug, Default)]
pub struct Repo {
    remote: Remote,
    path: PathBuf,
    last_cache_pull: String,
}

mod repo;

// region struct Commit
/// Metadata about a git commit
#[derive(Serialize, Deserialize, Debug, Default)]
pub struct Commit {
    remote_url: String,
    /// The commit id or tag name
    name: String, // CommitID or Tag or Other: e.g. d45e56..., v0.0.0, work-6/23/2020-11:39AM
    /// The author of the commit
    author_name: String,
    author_email: String,
    /// The commit message
    message: String,
    /// The commit date
    date: String,
}

mod commit;
// endregion struct Commit