Git Blame - Authorship par ligne

VérifiéSûr

Affiche pour chaque ligne d'un fichier le dernier commiteur, le hash du commit et la date. Permet de retrouver l'origine d'un bug, identifier le responsable d'une ligne, ou comprendre l'évolution d'un fichier.

Spar Skills Guide Bot
DeveloppementIntermédiaire
5002/06/2026
Claude CodeCursorWindsurf
#git#blame#authorship#code-history#version-control

Recommandé pour

Notre avis

Cette compétence affiche les informations d'attribution ligne par ligne pour un fichier, révélant qui a modifié chaque ligne pour la dernière fois et quand.

Points forts

  • Identifie rapidement l'auteur de chaque ligne de code
  • Facilite le suivi de l'origine des bogues
  • Simple à utiliser avec ou sans plage de lignes
  • Fonctionne dans tout dépôt Git

Limites

  • Ne montre que la dernière modification, pas l'historique complet
  • Peut être lent sur de très gros fichiers
  • Nécessite un dépôt Git local
Quand l'utiliser

Utilisez cette compétence lorsque vous avez besoin de savoir qui a modifié une ligne spécifique ou de retrouver l'origine d'une modification.

Quand l'éviter

Ne l'utilisez pas si vous avez besoin de l'historique complet des modifications d'une ligne ou si le fichier se trouve en dehors d'un dépôt Git.

Analyse de sécurité

Sûr
Score qualité90/100

The skill runs git blame, a read-only git command that shows file authorship. It does not involve destructive operations, data exfiltration, or execution of untrusted code.

Aucun point d'attention détecté

Exemples

Blame entire file
Show blame for /src/main.go
Blame specific lines
Show blame for lines 10-20 of /src/auth.go
Blame with summary statistics
Show blame for /app/utils.py and include summary statistics

name: git-blame description: Show line-by-line authorship information for a file. Returns the commit hash, author, and date for each line. allowed-tools: Bash metadata: category: git version: 1.0.0

Git Blame Skill

This skill shows line-by-line authorship information for a file, revealing who last modified each line and when.

Usage

The git-blame skill analyzes a file and returns authorship information for each line, with optional line range filtering.

Parameters

| Parameter | Type | Required | Default | Description | |-----------|------|----------|---------|-------------| | path | string | Yes | - | File path to blame | | start_line | int | No | 1 | Starting line number (1-indexed) | | end_line | int | No | - | Ending line number (inclusive) |

Example Usage

Blame an entire file:

Show blame for /src/main.go

Blame specific lines:

Show blame for lines 10-20 of /src/auth.go

Result Format

The blame result includes:

For each line:

  • Line number (1-indexed)
  • Commit hash that last modified this line
  • Author name
  • Author email
  • Timestamp of the modification
  • Line content

Summary statistics:

  • Unique authors count
  • Unique commits count

Line Information Fields

| Field | Description | |-------|-------------| | line_number | 1-indexed line number | | commit_hash | Hash of commit that last changed this line | | author | Name of the author | | author_email | Author's email address | | author_time | When the line was last modified | | content | The actual line content |

Use Cases

  1. Find code ownership: Identify who wrote specific code
  2. Track bug origins: Find when a problematic line was introduced
  3. Review history: Understand how code evolved
  4. Contact experts: Find who to ask about specific code
  5. Code review: See recent changes in context

Best Practices

  1. Use line ranges for large files to focus on relevant sections
  2. Cross-reference commit hashes with git-log for full context
  3. Check unique authors to understand code ownership patterns
  4. Use for debugging to find when issues were introduced
  5. Combine with git-log to trace the full history of changes

Interpreting Results

  • Multiple unique commits suggests the code evolved over time
  • Single commit for all lines indicates recently added code
  • Single author suggests concentrated ownership
  • Many authors suggests collaborative development
Skills similaires