{"id":21896628,"url":"https://github.com/dmeybohm/editorconfig-git-preserve-history","last_synced_at":"2026-04-06T04:06:17.021Z","repository":{"id":29593012,"uuid":"122159577","full_name":"dmeybohm/editorconfig-git-preserve-history","owner":"dmeybohm","description":"Rewrite files in git to follow editorconfig, while preserving history and without force commits.","archived":false,"fork":false,"pushed_at":"2025-06-18T23:45:01.000Z","size":158,"stargazers_count":0,"open_issues_count":4,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-19T00:27:42.022Z","etag":null,"topics":["editorconfig","git"],"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/dmeybohm.png","metadata":{"files":{"readme":"README.rst","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}},"created_at":"2018-02-20T05:35:17.000Z","updated_at":"2025-06-18T23:44:57.000Z","dependencies_parsed_at":"2023-01-14T15:15:53.301Z","dependency_job_id":"fc36fca7-8e38-4665-83e7-cd3a7fc72245","html_url":"https://github.com/dmeybohm/editorconfig-git-preserve-history","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dmeybohm/editorconfig-git-preserve-history","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmeybohm%2Feditorconfig-git-preserve-history","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmeybohm%2Feditorconfig-git-preserve-history/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmeybohm%2Feditorconfig-git-preserve-history/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmeybohm%2Feditorconfig-git-preserve-history/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dmeybohm","download_url":"https://codeload.github.com/dmeybohm/editorconfig-git-preserve-history/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmeybohm%2Feditorconfig-git-preserve-history/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264677359,"owners_count":23648124,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["editorconfig","git"],"created_at":"2024-11-28T13:46:51.945Z","updated_at":"2026-04-06T04:06:16.982Z","avatar_url":"https://github.com/dmeybohm.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"editorconfig-git-preserve-history\n=================================\n\nThis tool is a script that runs on a git repository that contains `editorconfig`_ files.\nThis rewrites all the text files in the repository to update the whitespace in accordance with\nthe editorconfig, but preserves history by writing new commits with the original authorship and\ncommit date.\n\nThe purpose of this is twofold: to maintain the original authorship of changes as reported\nby git blame, thus making the original authorship information more accessible even\nwhen using editorconfig, and also to avoid the hassle of having to handle large\nnumbers of changes due to files that are drastically different from what's\nconfigured in an .editorconfig.\n\nBy rewriting all the whitespace at once with this tool, you can keep your\neditorconfig plugin in your editor enabled, avoid unnecessary whitespace changes\nin other, more important code changes, and at the same time preserve the usefulness\nof git blame on files that have drastically different whitespace from your editorconfig\nfiles.\n\nInstallation\n------------\n\nPython 3.5 or later is required. On macOS, you can install `homebrew` first and then:\n\n.. code:: sh\n\n    brew install python3\n\nWith pip\n--------\n\nAfter installing Python 3\n\n.. code:: sh\n\n    pip3 install EditorConfigGitPreserveHistory\n\n\n\nRunning\n-------\n\n.. code:: sh\n\n    editorconfig-git-preserve-history\n\nThe script will write commits into your current branch that reformat according\nto the `.editorconfig` that applies to each file in your repository. It will\nalso add \"Impersonator:\" and \"Original-Commit:\" lines to the commit message of each\ncommit to reference back to the previous commit and inform whoever looks at the\nlog who created this whitespace commit. It looks like this:\n\n.. code::\n\n    commit 0e5f0feb7f9453b2fc8595f3db7835dbfe57db0e\n    Author: Original Author \u003coriginalauthor@example.com\u003e\n    Date:   Mon Feb 19 20:33:06 2018 -0500\n\n    Add editorconfig module to requirements.txt\n    \n    Original-Commit: 0e9d1d4bd3fe4cb278ed785bdb229e519eccc857\n    Impersonator: New Author \u003cnewauthor@example.com\u003e\n\nYou can then put those commits up on github and issue a pull request to change all the whitespace in\nyour project, but preserve the original authorship.\n\nThis way, if you do `git blame` you will still see the original author\nof each line, but the whitespace will also be updated.\n\nDeveloping\n----------\n\nCreate a virtual environment with the venv module:\n\n.. code:: sh\n\n    python3 -m venv venv\n\nThen activate the environment and install the requirements from the `requirements.txt` file:\n\n.. code:: sh\n\n    . venv/bin/activate\n    pip install -r requirements.txt\n\nBe sure to run the tests with nosetests before issuing a PR:\n\n.. code:: sh\n\n    nosetests\n\nYou can also run `mypy`, the Python static analyzer, to check for typing errors:\n\n.. code:: sh\n\n    mypy --ignore-missing-imports -p editorconfig_git_preserve_history\n\n.. _editorconfig: http://editorconfig.org","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmeybohm%2Feditorconfig-git-preserve-history","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdmeybohm%2Feditorconfig-git-preserve-history","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmeybohm%2Feditorconfig-git-preserve-history/lists"}