History

Hookup explain command (#427)

Sebastian Thiel committed 4 years ago

Commit 1049b001 parent 12e62774 files · +25 −1Browse files

Unified · Split

4 files
  1. gitoxide-core/src/repository/mod.rs +2 −0
  2. gitoxide-core/src/repository/revision/explain.rs +11 −0
  3. gitoxide-core/src/repository/revision/mod.rs +2 −0
  4. src/plumbing/main.rs +10 −1
gitoxide-core/src/repository/mod.rs+2−0
@@ -12,6 +12,8 @@ pub mod tree; · 11 unmodified lines
12 12
13pub mod commit;13pub mod commit;
14 14
15pub mod revision;
16
15pub mod verify;17pub mod verify;
16 18
17pub mod odb;19pub mod odb;
gitoxide-core/src/repository/revision/explain.rs+11−0
@@ -0,0 +1,11 @@
1use git_repository as git;
2use std::ffi::OsString;
3
4pub fn explain(
5 _repo: git::Repository,
6 _spec: OsString,
7 mut _out: impl std::io::Write,
8 mut _err: impl std::io::Write,
9) -> anyhow::Result<()> {
10 Ok(())
11}
gitoxide-core/src/repository/revision/mod.rs+2−0
@@ -0,0 +1,2 @@
1mod explain;
2pub use explain::explain;
src/plumbing/main.rs+10−1
@@ -161,7 +161,16 @@ pub fn main() -> Result<()> { · 160 unmodified lines
161 let repository = git::ThreadSafeRepository::discover(repository)?;161 let repository = git::ThreadSafeRepository::discover(repository)?;
162 match cmd {162 match cmd {
163 repo::Subcommands::Revision { cmd } => match cmd {163 repo::Subcommands::Revision { cmd } => match cmd {
164 repo::revision::Subcommands::Explain { spec: _ } => todo!("describe spec"),164 repo::revision::Subcommands::Explain { spec } => prepare_and_run(
165 "repository-commit-describe",
166 verbose,
167 progress,
168 progress_keep_open,
169 None,
170 move |_progress, out, err| {
171 core::repository::revision::explain(repository.into(), spec, out, err)
172 },
173 ),
165 },174 },
166 repo::Subcommands::Commit { cmd } => match cmd {175 repo::Subcommands::Commit { cmd } => match cmd {
167 repo::commit::Subcommands::Describe {176 repo::commit::Subcommands::Describe {