{"id":16935892,"url":"https://github.com/knu/zsh-git-escape-magic","last_synced_at":"2025-07-18T19:33:02.131Z","repository":{"id":1528997,"uuid":"1806479","full_name":"knu/zsh-git-escape-magic","owner":"knu","description":"zle tweak for git command line arguments","archived":false,"fork":false,"pushed_at":"2024-09-11T09:15:43.000Z","size":8,"stargazers_count":73,"open_issues_count":4,"forks_count":8,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-04-06T22:02:48.924Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"caskroom/homebrew-cask","license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/knu.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},"funding":{"github":"knu"}},"created_at":"2011-05-26T20:30:09.000Z","updated_at":"2025-02-11T09:10:49.000Z","dependencies_parsed_at":"2024-11-26T12:23:11.181Z","dependency_job_id":"9cc928dd-46f5-47c6-8ee9-10754b708cfa","html_url":"https://github.com/knu/zsh-git-escape-magic","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/knu/zsh-git-escape-magic","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knu%2Fzsh-git-escape-magic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knu%2Fzsh-git-escape-magic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knu%2Fzsh-git-escape-magic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knu%2Fzsh-git-escape-magic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/knu","download_url":"https://codeload.github.com/knu/zsh-git-escape-magic/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knu%2Fzsh-git-escape-magic/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265820091,"owners_count":23833561,"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":[],"created_at":"2024-10-13T20:55:35.546Z","updated_at":"2025-07-18T19:33:02.091Z","avatar_url":"https://github.com/knu.png","language":null,"funding_links":["https://github.com/sponsors/knu"],"categories":[],"sub_categories":[],"readme":"git-escape-magic for zsh\n========================\n\nSynopsis\n--------\n\n* git-escape-magic - zle tweak for git command line arguments\n\nDescription\n-----------\n\nIf you are a hard-core zsh user that takes `extended_glob` seriously\nfor granted, you must be annoyed with git's refspec (notation to point\na commit, tree, etc.) that goes like `HEAD^` or `blahblah~3` because\nthe signs like `[^~{}]` are globbing meta-characters for zsh that\nrequire escaping to be passed through to the git command.\n\nHere is what this tweak is about.  It eliminates the need for manually\nescaping those meta-characters.  The zle function it provides is\ncontext aware and recognizes the characteristics of each subcommand of\ngit.  Every time you type one of these meta-characters on a git\ncommand line, it automatically escapes the meta-character with a\nbackslash as necessary and as appropriate.\n\nExamples:\n\n\t% git reset HEAD [Hit \u003c^\u003e]\n\t% git reset HEAD\\^\n\n\n\t# Escaping takes place only if necessary\n\t% git reset HEAD\\ [Hit \u003c^\u003e]\n\t% git reset HEAD\\^\n\n\n\t% git reset HEAD@ [Hit \u003c{\u003e]\n\t% git reset HEAD@\\{\n\n\n\t% git checkout HEAD [Hit \u003c~\u003e]\n\t% git checkout HEAD\\~\n\n\n\t# Only pathspec follows after a double hyphen\n\t% git checkout -- * [Hit \u003c~\u003e]\n\t% git checkout -- *~\n\n\n\t# The add subcommand takes no refspec\n\t% git add * [Hit \u003c~\u003e]\n\t% git add *~\n\nHow to set up\n-------------\n\nPut the file `git-escape-magic` somewhere in your `$fpath` and add\nthese lines to your `.zshrc`:\n\n\tautoload -Uz git-escape-magic\n\tgit-escape-magic\n\nIf you are enabling `url-quote-magic`, make sure to load it first and\nthen load `git-escape-magic`.\n\nLicense\n-------\n\nCopyright (c) 2011, 2012, 2014 Akinori MUSHA\n\nLicensed under the 2-clause BSD license.\nSee `LICENSE` for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fknu%2Fzsh-git-escape-magic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fknu%2Fzsh-git-escape-magic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fknu%2Fzsh-git-escape-magic/lists"}