diff --git a/userland/git/src/lib.rs b/userland/git/src/lib.rs index 8d0e2ec..0a0a8dd 100644 --- a/userland/git/src/lib.rs +++ b/userland/git/src/lib.rs @@ -131,6 +131,9 @@ enum Command { all: bool, #[arg(long)] allow_empty: bool, + /// Accepted for compatibility. This git never signs commits. + #[arg(long)] + no_gpg_sign: bool, }, Log { #[arg(long)] @@ -340,6 +343,7 @@ pub fn run(cli: Cli) -> Result { message, all, allow_empty, + .. } => { let before = head_info(&repository)?; if !allow_empty && merge::pending_parent(&repository)?.is_none() { diff --git a/userland/git/src/main.rs b/userland/git/src/main.rs index df32fca..b520446 100644 --- a/userland/git/src/main.rs +++ b/userland/git/src/main.rs @@ -1,6 +1,10 @@ //! Parse Git CLI arguments and return Git-compatible usage and operation exit codes. use clap::{Parser, error::ErrorKind}; fn main() { + if matches!(std::env::args().nth(1).as_deref(), Some("--version" | "version")) { + println!("git version {}.sausage", env!("CARGO_PKG_VERSION")); + exit(0); + } let cli = match git::Cli::try_parse() { Ok(cli) => cli, Err(error) => {