Skip to content

Exclude lock files and generated files from diff animation #24

Closed

Description

@unhappychoice

Problem

Files like yarn.lock, package-lock.json, Cargo.lock, etc. can be extremely large and their diffs are not meaningful for human review. Currently, these files are processed the same as source code, which can:

  • Slow down the animation significantly
  • Consume excessive memory
  • Provide no useful information (diffs are auto-generated)

Proposed Solution

Exclude certain file patterns from diff animation, similar to how binary files are currently handled.

Files to Exclude

  • Lock files: yarn.lock, package-lock.json, pnpm-lock.yaml, Cargo.lock, Gemfile.lock, poetry.lock, composer.lock
  • Generated files: *.min.js, *.min.css, bundle files
  • Large data files: *.sql, database dumps
  • Vendored dependencies: vendor/, node_modules/ (if somehow included in diffs)

Implementation Options

Option 1: Hardcoded exclusion list

const EXCLUDED_FILES: &[&str] = &[
    "yarn.lock",
    "package-lock.json",
    "pnpm-lock.yaml",
    "Cargo.lock",
    "Gemfile.lock",
    "poetry.lock",
    "composer.lock",
];

fn should_exclude_file(path: &str) -> bool {
    let filename = path.rsplit('/').next().unwrap_or(path);
    EXCLUDED_FILES.contains(&filename)
}

Option 2: Pattern-based exclusion

const EXCLUDED_PATTERNS: &[&str] = &[
    "*.lock",
    "*.min.js",
    "*.min.css",
    "*-lock.json",
    "*-lock.yaml",
];

Option 3: Configuration file

Allow users to configure exclusions in .gitlogue.toml:

[exclude]
files = ["yarn.lock", "package-lock.json"]
patterns = ["*.min.js", "*.min.css"]

Display Behavior

When an excluded file is encountered:

  • Show a single line: 📦 package-lock.json (skipped - generated file)
  • Continue to next file immediately
  • No line-by-line animation

Acceptance Criteria

  • Lock files are automatically excluded from diff animation
  • Excluded files show a brief skip message
  • Performance improves for commits with large lock file changes
  • Users can understand why a file was skipped
  • (Optional) Users can configure additional exclusions

Related

  • Similar to binary file handling
  • Improves performance for typical development workflows

Activity

  1. linear commented on Nov 9, 2025

    @linear
  2. added this to the v0.1.0 milestone on Nov 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions