{"id":21806809,"url":"https://github.com/roguh/fix_fish_history","last_synced_at":"2026-05-18T11:36:33.147Z","repository":{"id":211668163,"uuid":"729680700","full_name":"roguh/fix_fish_history","owner":"roguh","description":"Fix a fish_history file or merge many fish_history files","archived":false,"fork":false,"pushed_at":"2023-12-10T04:40:26.000Z","size":10,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-04-07T06:36:27.794Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/roguh.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":"2023-12-10T02:01:16.000Z","updated_at":"2023-12-10T03:59:59.000Z","dependencies_parsed_at":"2023-12-10T04:27:00.053Z","dependency_job_id":"1700df87-ee97-426e-90d2-962535563405","html_url":"https://github.com/roguh/fix_fish_history","commit_stats":null,"previous_names":["roguh/fix_fish_history"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/roguh/fix_fish_history","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roguh%2Ffix_fish_history","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roguh%2Ffix_fish_history/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roguh%2Ffix_fish_history/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roguh%2Ffix_fish_history/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/roguh","download_url":"https://codeload.github.com/roguh/fix_fish_history/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roguh%2Ffix_fish_history/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33177283,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-18T09:27:30.708Z","status":"ssl_error","status_checked_at":"2026-05-18T09:27:28.300Z","response_time":71,"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":[],"created_at":"2024-11-27T12:30:01.206Z","updated_at":"2026-05-18T11:36:33.125Z","avatar_url":"https://github.com/roguh.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fix_fish_history.py\n\nRunning this fixer on a fish_history file converts it into valid YAML.\nThis makes it easy to run any standard YAML parser on the output.\n\nFor example, this allows easily querying or sorting the YAML output.\n\nNo guarantee that fish can read the transformed YAML.\n(TODO) In this case, this script should log and remove the unparseable lines instead of attempting to fix them.\n\n(TODO) Does not work with DOS `\\r\\n` newlines yet.\n\n## Fix some unparseable YAML lines and sort history\n\n```bash\n$ ./fix_fish_history.py file1 -o outputfile\n```\n\n## Merge N fish history files\n\nThey need to be sorted so that fish will parse the output correctly.\n\n```bash\n$ ./fix_fish_history.py file1 file2 file3 -o outputfile\n```\n\n## Usage\n\n```bash\n$ fix_fish_history --help\nusage: fix_fish_history.py [-h] [--run-pytests] [--lint] [--verbose]\n                           [--nosort] [--noparsefix] [--append]\n                           [--out-fname OUT_FNAME]\n                           fish_history_files [fish_history_files ...]\n\nFix or lint a fish_history file in various ways. Unparseable YAML and unsorted\nhistory is detected and fixed. The output should be a valid YAML file.\n\npositional arguments:\n  fish_history_files    The fish_history file to fix\n\noptions:\n  -h, --help            show this help message and exit\n  --run-pytests         Just run the unit tests for this script if pytest is\n                        installed.\n  --lint                Just count the number of fixes, do not actually fix\n                        them. This includes number of unsorted history entries\n                        and number of YAML parse errors found.\n  --verbose             Enable debug logging. This shows YAML parse error\n                        details.\n  --nosort              Do not sort lines in the history file\n  --noparsefix          Do not try to fix parse errors\n  --append, -a          Append to the output filename --out-fname do not\n                        overwrite\n  --out-fname OUT_FNAME, -o OUT_FNAME\n                        Write fixed output to this file. Incompatible with\n                        --lint\n\n```\n\n## Related\n\nThis fixes some bad YAML output in the fish_history file, which prevented me from sorting multiple fish_history files easily to merge them into one.\n\nSee this issue related to some old fish yaml syntax errors: https://github.com/fish-shell/fish-shell/issues/2759\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froguh%2Ffix_fish_history","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Froguh%2Ffix_fish_history","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froguh%2Ffix_fish_history/lists"}