Class: RubynCode::Tools::GitLog

Inherits:
Base
  • Object
show all
Defined in:
lib/rubyn_code/tools/git_log.rb

Constant Summary collapse

TOOL_NAME =
'git_log'
DESCRIPTION =
'Show recent git commit history.'
PARAMETERS =
{
  count: { type: :integer, required: false, default: 20, description: 'Number of commits to show (default: 20)' },
  branch: { type: :string, required: false, description: 'Branch name to show log for (default: current branch)' }
}.freeze
RISK_LEVEL =
:read
REQUIRES_CONFIRMATION =
false

Instance Attribute Summary

Attributes inherited from Base

#project_root

Instance Method Summary collapse

Methods inherited from Base

description, #initialize, parameters, requires_confirmation?, risk_level, #safe_path, summarize, to_schema, tool_name, #truncate

Constructor Details

This class inherits a constructor from RubynCode::Tools::Base

Instance Method Details

#execute(count: 20, branch: nil) ⇒ Object



19
20
21
22
23
# File 'lib/rubyn_code/tools/git_log.rb', line 19

def execute(count: 20, branch: nil)
  validate_git_repo!
  stdout = run_git_log(count.to_i.clamp(1, 200), branch)
  format_log_output(stdout, branch)
end