{"id":43267208,"url":"https://github.com/jftuga/git-file-history","last_synced_at":"2026-02-01T15:14:33.339Z","repository":{"id":329811611,"uuid":"1024561509","full_name":"jftuga/git-file-history","owner":"jftuga","description":"Extract and compare different file versions from git repo history","archived":false,"fork":false,"pushed_at":"2025-12-22T02:54:03.000Z","size":29,"stargazers_count":1,"open_issues_count":3,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-23T08:45:30.673Z","etag":null,"topics":["command-line","command-line-tool","diff","git","python3","repository"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jftuga.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-07-22T22:46:42.000Z","updated_at":"2025-12-21T20:11:44.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/jftuga/git-file-history","commit_stats":null,"previous_names":["jftuga/git-file-history"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/jftuga/git-file-history","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jftuga%2Fgit-file-history","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jftuga%2Fgit-file-history/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jftuga%2Fgit-file-history/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jftuga%2Fgit-file-history/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jftuga","download_url":"https://codeload.github.com/jftuga/git-file-history/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jftuga%2Fgit-file-history/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28980861,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-01T13:38:33.235Z","status":"ssl_error","status_checked_at":"2026-02-01T13:38:32.912Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["command-line","command-line-tool","diff","git","python3","repository"],"created_at":"2026-02-01T15:14:32.606Z","updated_at":"2026-02-01T15:14:33.332Z","avatar_url":"https://github.com/jftuga.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# git-file-history\n\nA collection of Python tools for extracting and comparing different\nversions of files from git repository history. These scripts make\nit easy to analyze how files have evolved over time by extracting\nhistorical versions and providing interactive diff comparisons.\n\n## Overview\n\nThis project consists of two complementary scripts:\n\n- **`git-version-extractor.py`** - Extracts different versions of a file from git history, saving each version with timestamp-based filenames\n- **`delta-compare.py`** - Provides interactive comparison of file versions using the delta diff tool\n- **`space-cleaner.py`** - Removes trailing whitespace from source code files while automatically backing up original to `/tmp`\n\nThese tools work together to provide a complete workflow for analyzing file evolution in git repositories.\n\n## Requirements\n\n- Python 3.12+\n- Git repository\n- [delta](https://github.com/dandavison/delta) (for diff comparisons)\n\n## Installation\n\nClone this repository:\n\n```bash\ngit clone https://github.com/jftuga/git-file-history.git\ncd git-file-history\n```\n\nInstall delta (required for `delta-compare.py`):\n\n```bash\n# macOS\nbrew install git-delta\n\n# Ubuntu/Debian\n\n# change to most current version...\nwget https://github.com/dandavison/delta/releases/download/0.18.2/git-delta_0.18.2_amd64.deb\nsudo dpkg -i git-delta_0.18.2_amd64.deb\n\n# Other platforms: see https://dandavison.github.io/delta/installation.html\n```\n\n## Usage\n\n### git-version-extractor.py\n\nExtracts historical versions of a file from git history.\n\n```bash\npython git-version-extractor.py [OPTIONS] FILEPATH\n```\n\n**Options:**\n- `--after-date YYYY-MM-DD` - Extract versions after specified date\n- `--max-versions N` - Limit to N most recent versions\n- `-v, --verbose` - Show git commands being executed\n\n**Output Format:**\nFiles are saved with timestamp-based names: `filename-YYYYmmdd.HHMMSS.ext`\n\n### delta-compare.py\n\nInteractive comparison of file versions using delta.\n\n```bash\npython delta-compare.py [OPTIONS] FILENAME\n```\n\n**Options:**\n- `-c, --clear` - Clear screen before each delta comparison\n- `-n, --no-current` - Don't include current working file in comparison\n\n**Interactive Controls:**\n- `n` - Next comparison (toward older versions)\n- `p` - Previous comparison (toward newer versions)\n- `g` - Jump to beginning (first comparison)\n- `G` - Jump to end (last comparison)\n- `q` - Quit\n\n## Examples\n\n### Basic File Extraction\n\nExtract all versions of a configuration file:\n\n```bash\npython git-version-extractor.py config/settings.json\n```\n\nOutput:\n```\nExtracted: config/settings-20250722.143022.json (commit: abc12345)\nExtracted: config/settings-20250715.091503.json (commit: def67890)\nExtracted: config/settings-20250708.165432.json (commit: ghi11121)\n\nSuccessfully extracted 3 versions of 'config/settings.json'\n```\n\n### Date-Filtered Extraction\n\nExtract versions from the last month:\n\n```bash\npython git-version-extractor.py src/main.py --after-date 2025-06-22\n```\n\n### Limited Version Extraction\n\nGet only the 5 most recent versions:\n\n```bash\npython git-version-extractor.py README.md --max-versions 5\n```\n\n### Verbose Extraction\n\nSee git commands being executed:\n\n```bash\npython git-version-extractor.py -v package.json --max-versions 3\n```\n\nOutput:\n```\nRunning: git rev-parse --git-dir\nRunning: git log --pretty=format:%H|%ci --max-count=3 --follow package.json\nRunning: git show a1b2c3d4:package.json\nExtracted: package-20250722.143022.json (commit: a1b2c3d4)\n```\n\n### Interactive File Comparison\n\nCompare all versions of a file including current working version:\n\n```bash\npython delta-compare.py popup.html\n```\n\nInteractive session:\n```\nFound 4 files to compare\nControls: 'n' for next, 'p' for previous, 'g' for beginning, 'G' for end, 'q' to quit\n\nComparing: popup.html -\u003e popup-20250722.010203.html\n[delta diff output appears here]\n\nPress 'n' for next comparison (1/3) or 'q' to quit: n\n\nComparing: popup-20250722.010203.html -\u003e popup-20250721.143022.html\n[delta diff output appears here]\n\nPress 'n' for next, 'p' for previous, 'g' for beginning, 'G' for end (2/3), or 'q' to quit: G\n\nJumped to end\n\nComparing: popup-20250720.091503.html -\u003e popup-20250719.165432.html\n[delta diff output appears here]\n\nPress 'p' for previous, 'g' for beginning (3/3), or 'q' to quit: g\n\nJumped to beginning\n\nComparing: popup.html -\u003e popup-20250722.010203.html\n[delta diff output appears here]\n```\n\n### Clean Screen Comparisons\n\nClear screen before each diff for focused viewing:\n\n```bash\npython delta-compare.py -c src/lambda/index.py\n```\n\n### Compare Only Historical Versions\n\nExclude current working file from comparison:\n\n```bash\npython delta-compare.py -n config.yml\n```\n\n## Typical Workflow\n\n1. **Extract versions** of a file you want to analyze:\n   ```bash\n   python git-version-extractor.py src/app.py --max-versions 10\n   ```\n\n2. **Compare versions** interactively:\n   ```bash\n   python delta-compare.py -c src/app.py\n   ```\n\n3. Navigate through the history using `n` (next) and `p` (previous) to understand how the file evolved over time. Use `g` and `G` to quickly jump to the beginning or end of the file history.\n\n## File Naming Convention\n\nExtracted files use the format: `{filename}-{YYYYmmdd.HHMMSS}.{extension}`\n\nExamples:\n- `index.html` -\u003e `index-20250722.143022.html`\n- `main.py` -\u003e `main-20250715.091503.py`\n- `config.json` -\u003e `config-20250708.165432.json`\n\nThe timestamp represents the commit date/time in the commit's\noriginal timezone.\n\n## Disclosure Notification\n\nThis program is my own original idea and was completely developed\non my own personal time, for my own personal benefit, and on my\npersonally owned equipment.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjftuga%2Fgit-file-history","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjftuga%2Fgit-file-history","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjftuga%2Fgit-file-history/lists"}