UNPKG

git-tweezers

Version:

Advanced git staging tool with hunk and line-level control

24 lines (23 loc) 916 B
import type { ParsedHunk } from './diff-parser.js'; /** * Generate a stable content-based fingerprint for a hunk * Based on O3's suggestion: normalize content to be independent of +/- prefixes * This ensures the same content has the same ID whether staged or unstaged */ export declare function generateContentFingerprint(hunk: ParsedHunk, filePath: string): string; /** * Generate a stable ID for a hunk based on its content * Uses content-based fingerprint to ensure stability across staging operations */ export declare function generateHunkId(hunk: ParsedHunk, filePath: string, existingIds?: Set<string>): string; /** * Extract a summary from hunk changes for better identification */ export declare function getHunkSummary(hunk: ParsedHunk): string; /** * Get change statistics for a hunk */ export declare function getHunkStats(hunk: ParsedHunk): { additions: number; deletions: number; };