pub struct HooksManager { /* private fields */ }Expand description
Git hooks integration for Cascade CLI
Implementations§
Source§impl HooksManager
impl HooksManager
pub fn new(repo_path: &Path) -> Result<Self>
Sourcepub fn install_all(&self) -> Result<()>
pub fn install_all(&self) -> Result<()>
Install all recommended Cascade hooks
Sourcepub fn install_essential(&self) -> Result<()>
pub fn install_essential(&self) -> Result<()>
Install only essential hooks (for setup) - excludes post-commit
Sourcepub fn install_with_options(&self, options: &InstallOptions) -> Result<()>
pub fn install_with_options(&self, options: &InstallOptions) -> Result<()>
Install hooks with smart validation options
Sourcepub fn install_hook(&self, hook_type: &HookType) -> Result<()>
pub fn install_hook(&self, hook_type: &HookType) -> Result<()>
Install a specific hook
Sourcepub fn uninstall_all(&self) -> Result<()>
pub fn uninstall_all(&self) -> Result<()>
Remove all Cascade hooks
Sourcepub fn uninstall_hook(&self, hook_type: &HookType) -> Result<()>
pub fn uninstall_hook(&self, hook_type: &HookType) -> Result<()>
Remove a specific hook
Sourcepub fn list_installed_hooks(&self) -> Result<()>
pub fn list_installed_hooks(&self) -> Result<()>
List all installed hooks and their status
Sourcepub fn generate_hook_script(&self, hook_type: &HookType) -> Result<String>
pub fn generate_hook_script(&self, hook_type: &HookType) -> Result<String>
Generate hook script content
Sourcepub fn generate_chaining_hook_script(
&self,
hook_type: &HookType,
) -> Result<String>
pub fn generate_chaining_hook_script( &self, hook_type: &HookType, ) -> Result<String>
Generate hook script that chains to original hooks
Sourcepub fn detect_repository_type(&self) -> Result<RepositoryType>
pub fn detect_repository_type(&self) -> Result<RepositoryType>
Detect repository type from remote URLs
Sourcepub fn detect_branch_type(&self) -> Result<BranchType>
pub fn detect_branch_type(&self) -> Result<BranchType>
Detect current branch type
Sourcepub fn validate_prerequisites(&self) -> Result<()>
pub fn validate_prerequisites(&self) -> Result<()>
Validate prerequisites for hook installation
Sourcepub fn validate_branch_suitability(&self) -> Result<()>
pub fn validate_branch_suitability(&self) -> Result<()>
Validate branch suitability for hooks
Sourcepub fn confirm_installation(&self) -> Result<()>
pub fn confirm_installation(&self) -> Result<()>
Confirm installation with user
Auto Trait Implementations§
impl Freeze for HooksManager
impl RefUnwindSafe for HooksManager
impl Send for HooksManager
impl Sync for HooksManager
impl Unpin for HooksManager
impl UnwindSafe for HooksManager
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more