pub struct GitContextUpdate {
pub github_repo: Option<String>,
pub github_issue: Option<i32>,
pub github_pr: Option<i32>,
pub git_additions: Option<i32>,
pub git_deletions: Option<i32>,
pub worktree_path: Option<String>,
pub worktree_branch: Option<String>,
pub git_branch: Option<String>,
}Expand description
Git and GitHub context update derived from a Bash tool event.
This struct captures both git-related context (branch, worktree) and GitHub-specific context (repo, issue, PR) extracted from shell commands and their output.
Each field is Some only if the parsing found a new value.
Use with COALESCE semantics to update session fields.
Fields§
§github_repo: Option<String>GitHub repository in owner/repo format
github_issue: Option<i32>GitHub issue number
github_pr: Option<i32>GitHub PR number
git_additions: Option<i32>Lines added (from git diff –shortstat or gh pr view)
git_deletions: Option<i32>Lines deleted (from git diff –shortstat or gh pr view)
worktree_path: Option<String>Absolute path to git worktree
worktree_branch: Option<String>Branch name in the worktree
git_branch: Option<String>Current git branch (set when capturing PR from gh pr create)
Implementations§
Source§impl GitContextUpdate
impl GitContextUpdate
Sourcepub fn has_values(&self) -> bool
pub fn has_values(&self) -> bool
Returns true if this update has any values
Sourcepub fn merge(&mut self, other: GitContextUpdate)
pub fn merge(&mut self, other: GitContextUpdate)
Merge another update into this one (other values take precedence)
Trait Implementations§
Source§impl Clone for GitContextUpdate
impl Clone for GitContextUpdate
Source§fn clone(&self) -> GitContextUpdate
fn clone(&self) -> GitContextUpdate
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for GitContextUpdate
impl Debug for GitContextUpdate
Source§impl Default for GitContextUpdate
impl Default for GitContextUpdate
Source§fn default() -> GitContextUpdate
fn default() -> GitContextUpdate
Returns the “default value” for a type. Read more
Source§impl PartialEq for GitContextUpdate
impl PartialEq for GitContextUpdate
impl Eq for GitContextUpdate
impl StructuralPartialEq for GitContextUpdate
Auto Trait Implementations§
impl Freeze for GitContextUpdate
impl RefUnwindSafe for GitContextUpdate
impl Send for GitContextUpdate
impl Sync for GitContextUpdate
impl Unpin for GitContextUpdate
impl UnwindSafe for GitContextUpdate
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