Skip to content

Commit 5cf08ce

Browse files
committed
move 'mailmap' up one level (#331)
1 parent 0ed65da commit 5cf08ce

File tree

2 files changed

+24
-26
lines changed

2 files changed

+24
-26
lines changed

Diff for: src/plumbing/main.rs

+11-13
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use git_repository::bstr::io::BufReadExt;
1313
use gitoxide_core as core;
1414
use gitoxide_core::pack::verify;
1515

16-
use crate::plumbing::options::{commit, odb, revision, tree};
16+
use crate::plumbing::options::{commit, mailmap, odb, revision, tree};
1717
use crate::{
1818
plumbing::options::{free, repo, Args, Subcommands},
1919
shared::pretty::prepare_and_run,
@@ -599,6 +599,16 @@ pub fn main() -> Result<()> {
599599
move |_progress, out, err| core::repository::odb::info(repository()?.into(), format, out, err),
600600
),
601601
},
602+
Subcommands::Mailmap { cmd } => match cmd {
603+
mailmap::Subcommands::Entries => prepare_and_run(
604+
"repository-mailmap-entries",
605+
verbose,
606+
progress,
607+
progress_keep_open,
608+
None,
609+
move |_progress, out, err| core::repository::mailmap::entries(repository()?.into(), format, out, err),
610+
),
611+
},
602612
Subcommands::Repository(repo::Platform { cmd }) => match cmd {
603613
repo::Subcommands::Exclude { cmd } => match cmd {
604614
repo::exclude::Subcommands::Query {
@@ -635,18 +645,6 @@ pub fn main() -> Result<()> {
635645
},
636646
),
637647
},
638-
repo::Subcommands::Mailmap { cmd } => match cmd {
639-
repo::mailmap::Subcommands::Entries => prepare_and_run(
640-
"repository-mailmap-entries",
641-
verbose,
642-
progress,
643-
progress_keep_open,
644-
None,
645-
move |_progress, out, err| {
646-
core::repository::mailmap::entries(repository()?.into(), format, out, err)
647-
},
648-
),
649-
},
650648
},
651649
}?;
652650
Ok(())

Diff for: src/plumbing/options.rs

+13-13
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,26 @@ pub enum Subcommands {
7676
#[clap(subcommand)]
7777
cmd: revision::Subcommands,
7878
},
79+
/// Interact with the mailmap.
80+
Mailmap {
81+
#[clap(subcommand)]
82+
cmd: mailmap::Subcommands,
83+
},
7984
/// Subcommands for interacting with entire git repositories
8085
Repository(repo::Platform),
8186
/// Subcommands that need no git repository to run.
8287
#[clap(subcommand)]
8388
Free(free::Subcommands),
8489
}
8590

91+
pub mod mailmap {
92+
#[derive(Debug, clap::Subcommand)]
93+
pub enum Subcommands {
94+
/// Print all entries in configured mailmaps, inform about errors as well.
95+
Entries,
96+
}
97+
}
98+
8699
pub mod odb {
87100
#[derive(Debug, clap::Subcommand)]
88101
pub enum Subcommands {
@@ -579,11 +592,6 @@ pub mod repo {
579592
#[derive(Debug, clap::Subcommand)]
580593
#[clap(visible_alias = "repo")]
581594
pub enum Subcommands {
582-
/// Interact with the mailmap.
583-
Mailmap {
584-
#[clap(subcommand)]
585-
cmd: mailmap::Subcommands,
586-
},
587595
/// Interact with the exclude files like .gitignore.
588596
Exclude {
589597
#[clap(subcommand)]
@@ -616,12 +624,4 @@ pub mod repo {
616624
},
617625
}
618626
}
619-
620-
pub mod mailmap {
621-
#[derive(Debug, clap::Subcommand)]
622-
pub enum Subcommands {
623-
/// Print all entries in configured mailmaps, inform about errors as well.
624-
Entries,
625-
}
626-
}
627627
}

0 commit comments

Comments
 (0)