History

move 'mailmap' up one level (#331)

Sebastian Thiel committed 4 years ago

Commit 5cf08ce1 parent 0ed65da2 files · +24 −26Browse files

Unified · Split

2 files
  1. src/plumbing/main.rs +11 −13
  2. src/plumbing/options.rs +13 −13
src/plumbing/main.rs+11−13
@@ -13,7 +13,7 @@ use git_repository::bstr::io::BufReadExt; · 12 unmodified lines
13use gitoxide_core as core;13use gitoxide_core as core;
14use gitoxide_core::pack::verify;14use gitoxide_core::pack::verify;
15 15
16use crate::plumbing::options::{commit, odb, revision, tree};16use crate::plumbing::options::{commit, mailmap, odb, revision, tree};
17use crate::{17use crate::{
18 plumbing::options::{free, repo, Args, Subcommands},18 plumbing::options::{free, repo, Args, Subcommands},
19 shared::pretty::prepare_and_run,19 shared::pretty::prepare_and_run,
@@ -599,6 +599,16 @@ pub fn main() -> Result<()> { · 579 unmodified lines
599 move |_progress, out, err| core::repository::odb::info(repository()?.into(), format, out, err),599 move |_progress, out, err| core::repository::odb::info(repository()?.into(), format, out, err),
600 ),600 ),
601 },601 },
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 },
602 Subcommands::Repository(repo::Platform { cmd }) => match cmd {612 Subcommands::Repository(repo::Platform { cmd }) => match cmd {
603 repo::Subcommands::Exclude { cmd } => match cmd {613 repo::Subcommands::Exclude { cmd } => match cmd {
604 repo::exclude::Subcommands::Query {614 repo::exclude::Subcommands::Query {
@@ -635,18 +645,6 @@ pub fn main() -> Result<()> { · 30 unmodified lines
635 },645 },
636 ),646 ),
637 },647 },
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 },
650 },648 },
651 }?;649 }?;
652 Ok(())650 Ok(())
src/plumbing/options.rs+13−13
@@ -76,6 +76,11 @@ pub enum Subcommands { · 75 unmodified lines
76 #[clap(subcommand)]76 #[clap(subcommand)]
77 cmd: revision::Subcommands,77 cmd: revision::Subcommands,
78 },78 },
79 /// Interact with the mailmap.
80 Mailmap {
81 #[clap(subcommand)]
82 cmd: mailmap::Subcommands,
83 },
79 /// Subcommands for interacting with entire git repositories84 /// Subcommands for interacting with entire git repositories
80 Repository(repo::Platform),85 Repository(repo::Platform),
81 /// Subcommands that need no git repository to run.86 /// Subcommands that need no git repository to run.
@@ -83,6 +88,14 @@ pub enum Subcommands { · 1 unmodified line
83 Free(free::Subcommands),88 Free(free::Subcommands),
84}89}
85 90
91pub 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
86pub mod odb {99pub mod odb {
87 #[derive(Debug, clap::Subcommand)]100 #[derive(Debug, clap::Subcommand)]
88 pub enum Subcommands {101 pub enum Subcommands {
@@ -579,11 +592,6 @@ pub mod repo { · 490 unmodified lines
579 #[derive(Debug, clap::Subcommand)]592 #[derive(Debug, clap::Subcommand)]
580 #[clap(visible_alias = "repo")]593 #[clap(visible_alias = "repo")]
581 pub enum Subcommands {594 pub enum Subcommands {
582 /// Interact with the mailmap.
583 Mailmap {
584 #[clap(subcommand)]
585 cmd: mailmap::Subcommands,
586 },
587 /// Interact with the exclude files like .gitignore.595 /// Interact with the exclude files like .gitignore.
588 Exclude {596 Exclude {
589 #[clap(subcommand)]597 #[clap(subcommand)]
@@ -616,12 +624,4 @@ pub mod repo { · 26 unmodified lines
616 },624 },
617 }625 }
618 }626 }
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 }
627}627}