Skip to main content

Command

Enum Command 

Source
pub enum Command {
    Push {
        advance_bookmarks: bool,
        stage: StageArg,
        push: PushArgs,
        dry_run: bool,
        no_retry_after_fixup: bool,
    },
    Run {
        stage: StageArg,
        revset: String,
        no_retry_after_fixup: bool,
        all_files: bool,
    },
    PushTags {
        tags: Vec<String>,
        all: bool,
        force: bool,
        dry_run: bool,
        remote: String,
    },
    Init,
    Completions {
        shell: Shell,
    },
}

Variants§

§

Push

Run hooks then push. Mirrors the flags jj git push accepts; any flags we don’t model can be passed through after --.

Fields

§advance_bookmarks: bool

Advance the local bookmark to the fixup commit when hooks modify files. Reads jj-hooks.advance-bookmarks config when not given.

§stage: StageArg

Hook stage to run. Defaults to pre-push.

§dry_run: bool

Only display what will change on the remote.

§no_retry_after_fixup: bool

Disable the post-fixup retry. By default, when hooks fail AND produce a fixup commit, jj-hooks re-runs the hook backend against the fixup; if the re-run is clean, the push proceeds and a warning is printed. Pass this flag to restore pre-0.3.0 behavior (any failure aborts immediately).

§

Run

Run hooks against a revset without pushing.

Fields

§stage: StageArg

Hook stage to run. Defaults to pre-commit.

§revset: String

Revset to check. Defaults to @.

§no_retry_after_fixup: bool

Disable the post-fixup retry. See push --no-retry-after-fixup.

§all_files: bool

Run hooks against every tracked file, ignoring the revset’s diff range. Each runner’s own equivalent flag is used: --all-files for pre-commit/prek/lefthook, --glob '*' for hk (its own -a/--all doesn’t actually override stage-hook ref bounds in v1.45.0). Useful when you want to lint everything once (e.g. after a refactor that touched a lot) without crafting a revset that happens to cover every gated step. The setup pipeline still runs; the runner just sees no --from-ref/--to-ref.

§

PushTags

Push jj tags to a git remote. jj has no native jj git push --tag, so this exports refs to the colocated git repo and shells out to git push refs/tags/<tag> for each requested tag.

Fields

§tags: Vec<String>

Tag name(s) to push. Mutually exclusive with --all.

§all: bool

Push every local tag.

§force: bool

Force-push the tag refs (overwrites the remote). Use sparingly.

§dry_run: bool

Print the commands without running them.

§remote: String

Git remote to push to.

§

Init

Interactive setup: install jj push alias and configure defaults.

§

Completions

Print a shell completion script. Pipe into your shell rc, e.g. eval "$(jj-hp completions zsh)".

Fields

§shell: Shell

Shell to generate completions for.

Trait Implementations§

Source§

impl Debug for Command

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl FromArgMatches for Command

Source§

fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Source§

fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Source§

fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

fn update_from_arg_matches_mut<'b>( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

impl Subcommand for Command

Source§

fn augment_subcommands<'b>(__clap_app: Command) -> Command

Append to Command so it can instantiate Self via FromArgMatches::from_arg_matches_mut Read more
Source§

fn augment_subcommands_for_update<'b>(__clap_app: Command) -> Command

Append to Command so it can instantiate self via FromArgMatches::update_from_arg_matches_mut Read more
Source§

fn has_subcommand(__clap_name: &str) -> bool

Test whether Self can parse a specific subcommand

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more