Skip to content
This repository has been archived by the owner on Nov 8, 2024. It is now read-only.

YunKukPark/diff-rettier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

diff-tree (이름은 변경될 수 있음)

A CLI tool for analyzing and visualizing differences between branches, tags, and commits. Especially useful for managing code synchronization in projects with delayed deployments.

Key Features

  • 🔍 Diff Analysis: Analyze differences between branches, tags, and commits
  • 📊 Multiple Visualizations: View results in various formats including Tree, Plain, and JSON
  • 🌳 Folder Structure Visualization: Display changes hierarchically according to folder structure
  • 💡 Interactive Interface: Step-by-step analysis through an intuitive CLI
  • 🎯 Pattern-based Filtering: Selective analysis of specific files or directories

Installation

Local Install

  1. Clone this repository
git clone
cd diff-tree
  1. Install dependencies
pnpm install --frozen-lockfile
  1. Build
pnpm run build
  1. Link
pnpm link --global

Coming Soon...

(NPM publication planned)

npm install -g diff-tree
# or
yarn global add diff-tree
# or
pnpm add -g diff-tree

Usage

Basic Commands

# Run in interactive mode
git diff-tree compare -i

# Specify references directly
git diff-tree compare -f  -t

# Filter files by pattern
git diff-tree compare -f main -t develop -p "src/**/*.ts"

Output Format Options

# Tree view (default)
git diff-tree compare -f main -t develop --format tree

# Plain text
git diff-tree compare -f main -t develop --format plain

# JSON format
git diff-tree compare -f main -t develop --format json

Command Options

Option Description
-i, --interactive Run in interactive mode
-f, --from <ref> Starting reference (branch/tag/commit)
-t, --to <ref> Ending reference (branch/tag/commit)
-p, --pattern <pattern> File filtering pattern
--format <type> Output format (tree/plain/json)
--no-colors Disable colored output
--no-icons Disable icons in display

Usage Examples

Code Synchronization Analysis in Monorepo

  1. Analyzing differences between main project and delayed deployment project:
git diff-tree compare -f main-proj:v1.0.0 -t delayed-proj:v1.0.0
  1. Check changes in specific directory:
git diff-tree compare -i
# Specify directory pattern in interactive mode: "apps/specific-app/**"

Output Example

╔══════════════════════╤═════════════╤══════════╗
║ Path                 │ Type        │ Changes  ║
╟──────────────────────┼─────────────┼──────────╢
║ 📁 src               │             │ +457/-87 ║
║   📁 components      │             │ +315/-81 ║
║     📄 Button.tsx    │ 📝 modified │ +30/-10  ║
║     📄 Input.tsx     │ ✨ added    │ +45      ║
╚══════════════════════╧═════════════╧══════════╝
tree format output example

Important Notes

  • Must be run within a Git repository
  • Analysis may take time in large repositories
  • Filter patterns support regular expressions

내가 안잊어버리려고 적는 구조

graph TB
    CLI["CLI (Entry Point)"]
    CMD["Commander
    (Command Parser)"]
    IC["InteractiveCommand"]
    DC["DirectCommand"]
    CTX["CommandContext"]
    STORE["Store
    (State Management)"]
    EMIT["EventEmitter"]
    ROUTE["RouteManager"]
    GIT["GitAnalyzer"]
    FORM["DiffFormatter"]

    CLI --> CMD
    CMD --> IC
    CMD --> DC

    IC --> CTX
    DC --> CTX

    CTX --> STORE
    CTX --> EMIT
    CTX --> GIT
    CTX --> FORM

    IC --> ROUTE
    ROUTE --> CTX

    subgraph Formatters
        FORM --> TREE["TreeFormatter"]
        FORM --> PLAIN["PlainFormatter"]
        FORM --> JSON["JSONFormatter"]
    end

    subgraph State Management
        STORE --> STATE["AppState
        - Analysis
        - UI State"]
    end

    subgraph Git Operations
        GIT --> EXEC["Git Command
        Executor"]
        GIT --> PARSE["Diff Parser"]
        GIT --> ANAL["Analysis
        Generator"]
    end

    style CLI fill:#f9f,stroke:#333,stroke-width:4px
    style CTX fill:#bbf,stroke:#333,stroke-width:2px
    style STORE fill:#bfb,stroke:#333,stroke-width:2px
    style GIT fill:#fbb,stroke:#333,stroke-width:2px
Loading

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published