git_log
Trace when and why code changes happened by querying commit history with filters for paths, authors, dates, messages, and diffs. Get authorship context and intent signals for a specific module or identifier.
Instructions
Use this tool to investigate when a code/configuration change happened and infer why it happened from commit history. Choose it when you need commit timelines, authorship context, or intent signals from commit messages and diffs for a specific module or identifier. It is not for repository file content reads or branch manipulation; it is for history analysis and change attribution.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rev | No | Revision selector or range, such as HEAD, main..feature, or A...B. Use this to narrow history to the branch, comparison window, or ancestry span relevant to your investigation before adding deeper filters. | HEAD |
| grep | No | Commit-message regex filters used to match intent cues such as ticket IDs, feature terms, bug labels, or 'revert'. Use this after path scoping to infer why changes happened; if results are still noisy, add author or date limits, then refine regex specificity. | |
| skip | No | Number of matching commits to skip before returning results. Use this for pagination when reviewing long histories in batches without changing your filter strategy. | |
| paths | No | Pathspec list (files, directories, or glob patterns) used to scope commits to relevant code areas. Use this first to reduce noise; if results are noisy, add or tighten paths (for example `src/service/**` or `*.py`) before applying grep or diff filters. | |
| since | No | Lower date bound (newer than) for commit traversal. Use this to focus on known release windows or incident periods after applying path/message filters. | |
| until | No | Upper date bound (older than) for commit traversal. Use this with since to bracket a time window when narrowing investigations to specific milestones. | |
| author | No | Author name/email pattern matched against commit identity metadata. Use this when ownership is known or suspected and you need to isolate one contributor after path/message filtering. | |
| all_match | No | Require all identity/message filters to match instead of allowing partial matches. Use this to tighten precision when combining author and grep filters that otherwise return overly broad results. | |
| grep_diff | No | Pickaxe regex filter that finds commits whose added/removed lines match a structural code pattern. Use this when you know shape changes (signature edits, condition rewrites, renames) but not an exact token, and pair it with paths for precision. | |
| max_count | No | Maximum number of commits to return. Use smaller values for iterative investigation loops and increase only after filters are well scoped. | |
| repo_path | No | Path to the git repository to query. Use this to point history analysis at the correct project root when your current working directory is not the target repo. | . |
| with_patch | No | Include the patch/diff for each listed commit. Enabling this increases output volume; use it when you need to inspect the actual code changes in commits. It is also useful for viewing changes in a single commit when paired with rev and max_count=1. To reduce output size, limit scope with paths and, whenever possible, pickaxe filters (search_string/grep_diff). | |
| fixed_strings | No | Treats grep patterns as literal strings rather than regex. Use this for exact tokens (for example a ticket key) when regex interpretation adds accidental matches. | |
| search_string | No | Pickaxe string filter that returns commits where the occurrence count of the exact text changed in the diff. Use this to track introduction/removal of a stable identifier after scoping by paths; if too broad, add date/author filters. | |
| extended_regexp | No | Enables POSIX extended regex behavior for message grep patterns. Use this when grep patterns need richer regex constructs beyond basic matching semantics. | |
| regexp_ignore_case | No | Controls whether message grep matching ignores case differences. Use true for exploratory searches across inconsistent commit message style, and disable it when exact case carries meaning. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||