{"id":17242882,"url":"https://github.com/imcuttle/git-range-files","last_synced_at":"2026-04-27T23:39:21.386Z","repository":{"id":69113101,"uuid":"126185849","full_name":"imcuttle/git-range-files","owner":"imcuttle","description":"Get files by git commit range or hash","archived":false,"fork":false,"pushed_at":"2022-01-07T14:52:18.000Z","size":17,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-25T14:09:38.657Z","etag":null,"topics":["commit-range","git","staged"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/imcuttle.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}},"created_at":"2018-03-21T13:49:44.000Z","updated_at":"2018-11-04T11:37:09.000Z","dependencies_parsed_at":null,"dependency_job_id":"404313db-288d-415d-a8e2-828bbf1b50ad","html_url":"https://github.com/imcuttle/git-range-files","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/imcuttle/git-range-files","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imcuttle%2Fgit-range-files","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imcuttle%2Fgit-range-files/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imcuttle%2Fgit-range-files/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imcuttle%2Fgit-range-files/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/imcuttle","download_url":"https://codeload.github.com/imcuttle/git-range-files/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imcuttle%2Fgit-range-files/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32360116,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-27T20:07:02.737Z","status":"ssl_error","status_checked_at":"2026-04-27T20:07:00.910Z","response_time":128,"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":["commit-range","git","staged"],"created_at":"2024-10-15T06:14:19.466Z","updated_at":"2026-04-27T23:39:21.371Z","avatar_url":"https://github.com/imcuttle.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Git Range Files  [![Build Status](https://travis-ci.org/imcuttle/git-range-files.svg?branch=master)](https://travis-ci.org/imcuttle/git-range-files)\n\nThis module returns an array of git range files and their status acording to git.\n\nInspired By [staged-git-files](https://github.com/mcwhittemore/staged-git-files).\n\n## How it works?\n\n* git version \u003c 2.0.0 execute\n\n\t\tgit diff --name-status b8c40a94db582718...813f2c4911e926c0\n\n* git version \u003e= 2.0.0 execute\n\n\t\tgit -c core.quotepath=false diff --name-status b8c40a94db582718...813f2c4911e926c0\n\n## Usage\n\n`npm install git-range-files`\n\n```js\nvar grf = require('git-range-files');\ngrf(function(err, results) {\n\t// WHAT EVER YOU SO PLEASE\n});\n\ngrf({ head: 'f5f240fad3f6...e87900fad3f6' }, function(err, results){\n\t// WHAT EVER YOU SO PLEASE\n});\n```\n\n**Example Results**\n\n```json\n[\n\t{\n\t\t\"filename\": \"package.json\",\n\t\t\"status\": \"Added\"\n\t},\n\t{\n\t\t\"filename\": \"readme.md\",\n\t\t\"status\": \"Modified\"\n\t},\n\t{\n\t\t\"filename\": \"index.js\",\n\t\t\"status\": \"Renamed\"\n\t}\n]\n```\n\n## Usage as a cli\n\n```sh\n$ grf\nAdded package.json\nModified readme.md\nRenamed index.js\n```\n\n## API\n\n### grf({ filter, head, relative }, callback)\n\nGet a list of git range files from `head`\n\n* filter: string of git status codes. No spaces\n* relative: `string` or `boolean` (`true` by default)  \n  When run from a subdirectory of the project, it can be told to exclude changes outside the directory and\n  show pathnames relative to it with this option. When you are not in a subdirectory (e.g. in a bare\n  repository), you can name which subdirectory to make the output relative to by giving a \u003cpath\u003e as an\n  argument.\n* callback:\n\t* err: the error\n\t* results: file object array.\n\n### grf.getHead(callback)\n\nGet head that will be used in the diff to ID which files are waiting to be staged.\n\n* callback\n\t* err: the error\n\t* head: the git commit id which is aliased to head.\n\n### grf.readFile(filename, [options], callback)\n\nThis is a proxy for [fs.readFile](http://nodejs.org/api/fs.html#fs_fs_readfile_filename_options_callback) with one change. The filename will be relative to the `grf.cwd`\n\n### grf.debug\n\nBoolean that flips logging on and off. By default this is false. If true, all git commands will be console logged.\n\n### grf.includeContent\n\nIf true, include content will add a `content` or `err` param to the file object.\n\n* Default Value: false\n* Content Param: the content of the file staged\n* Err Param: the error message received while trying to read the file.\n\n### grf.cwd\n\nThe current working directory. AKA: where the .git folder you care about is.\n\n# Default Value: is equal to process.cwd() of your app.g\n\n## Statuses\n\n**SGF-Status (git status code)**\n\n* Added (A)\n* Copied (C)\n* Deleted (D)\n* Modified (M)\n* Renamed (R)\n* Type-Change (T) [i.e. regular file, symlink, submodule, etc.]\n* Unmerged (U)\n* Unknown (X)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimcuttle%2Fgit-range-files","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fimcuttle%2Fgit-range-files","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimcuttle%2Fgit-range-files/lists"}