{"id":15725453,"url":"https://github.com/ericmeyer/vcprompt","last_synced_at":"2025-07-02T02:04:12.549Z","repository":{"id":1471773,"uuid":"1713311","full_name":"ericmeyer/vcprompt","owner":"ericmeyer","description":null,"archived":false,"fork":false,"pushed_at":"2017-03-20T08:52:37.000Z","size":356,"stargazers_count":11,"open_issues_count":2,"forks_count":3,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-05-13T12:49:10.409Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ericmeyer.png","metadata":{"files":{"readme":"README.txt","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2011-05-06T20:57:00.000Z","updated_at":"2021-12-10T06:28:30.000Z","dependencies_parsed_at":"2022-07-29T15:09:44.460Z","dependency_job_id":null,"html_url":"https://github.com/ericmeyer/vcprompt","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ericmeyer/vcprompt","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericmeyer%2Fvcprompt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericmeyer%2Fvcprompt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericmeyer%2Fvcprompt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericmeyer%2Fvcprompt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ericmeyer","download_url":"https://codeload.github.com/ericmeyer/vcprompt/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericmeyer%2Fvcprompt/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263061405,"owners_count":23407606,"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-03T22:21:08.174Z","updated_at":"2025-07-02T02:04:12.528Z","avatar_url":"https://github.com/ericmeyer.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"vcprompt\n========\n\nvcprompt is a little C program that prints a short string, designed to\nbe included in your prompt, with barebones information about the current\nworking directory for various version control systems.  It is designed\nto be small and lightweight rather than comprehensive.\n\nCurrently, it has varying degrees of recognition for Mercurial, Git,\nCVS, and Subversion working copies.\n\nvcprompt has no external dependencies: it does everything with the\nstandard C library and POSIX calls.  It should work on any\nPOSIX-compliant system with a C99 compiler.\n\nTo compile vcprompt:\n\n  make\n\nTo install it:\n\n  make install PREFIX=$HOME\n\nTo use it with bash, just call it in PS1:\n\n  PS1='\\u@\\h:\\w $(vcprompt)\\$'\n\nTo use it with zsh, you need to enable shell option PROMPT_SUBST, and\nthen do similarly to bash:\n\n  setopt prompt_subst\n  PROMPT='[%n@%m] [%~] $(vcprompt)'\n\nvcprompt prints nothing if the current directory is not managed by a\nrecognized VC system.\n\n\nFormat Strings\n==============\n\nYou can customize the output of vcprompt using format strings, which can\nbe specified either on the command line or in the VCPROMPT_FORMAT\nenvironment variable.  For example:\n\n  vcprompt -f \"%b\"\n\nand\n\n  VCPROMPT_FORMAT=\"%b\" vcprompt\n\nare equivalent.\n\nFormat strings use printf-like \"%\" escape sequences:\n\n  %n  name of the VC system managing the current directory\n      (e.g. \"cvs\", \"hg\", \"git\", \"svn\")\n  %b  current branch name\n  %r  current revision\n  %u  ? if there are any unknown files\n  %m  + if there are any uncommitted changes (added, modified, or\n      removed files)\n  %%  a single % character\n\nAll other characters are expanded as-is.\n\nThe default format string is\n\n  [%n:%b]\n\nwhich is notable because it works with every supported VC system.  In\nfact, some features are meaningless with some systems: there is no\nsingle current revision with CVS, for example.  (And there is no good\nway to quickly find out if there are any uncommitted changes or unknown\nfiles, for that matter.)\n\n\nContributing\n============\n\nPatches are welcome.  Please follow these guidelines:\n\n  * Ensure that the tests pass before and after your patch.\n    If you cannot run the tests on a POSIX-compliant system,\n    that is a bug: please let me know.\n\n  * If at all possible, add a test whenever you fix a bug or implement a\n    feature.  If you can write a test that has no dependencies (e.g. no\n    need to execute \"git\" or \"hg\" or whatever), add it to\n    tests/test-simple.  Otherwise, add it to the appropriate VC-specific\n    test script, e.g. tests/test-git if it needs to be able to run git.\n\n  * Keep the dependencies minimal: preferably just C99 and POSIX.\n    If you need to run an external executable, make sure it makes\n    sense: e.g. it's OK to run \"git\" in a git working directory, but\n    *only* if we already know we are in a git working directory.\n\n  * Performance matters!  I wrote vcprompt so that people wouldn't have\n    to spawn and initialize and entire Python or Perl interpreter every\n    time they execute a new shell command.  Using system() to turn\n    around and spawn external commands -- especially ones that involve a\n    relatively large runtime penalty like Python scripts -- misses the\n    point of vcprompt.\n\n    In fact, you'll find that vcprompt contains hacky little\n    reimplementations of select bits and pieces of Mercurial, git,\n    Subversion, and CVS precisely in order to avoid running external\n    commands.  (And, in the case of Subversion, to avoid depending on a\n    large, complex library.)\n\n  * Stick with my coding style:\n    - 4 space indents\n    - no tabs\n    - curly braces on the same line *except* when defining a function\n    - C99 comments and variable declarations are OK, at least until\n      someone complains that their compiler cannot handle them\n\n  * Feel free to add yourself to the contributors list below.\n    (If you don't do it, I'll probably forget.)\n\n  \nAuthor Contact\n==============\n\nvcprompt was written by Greg Ward \u003cgreg at gerg dot ca\u003e.\n\nThe latest version is available from either of my public Mercurial\nrepositories:\n\n  http://hg.gerg.ca/vcprompt/\n  http://bitbucket.org/gward/vcprompt/overview\n\n\nOther Contributors\n==================\n\nIn chronological order:\n\n  Daniel Serpell\n  Jannis Leidel\n  Yuya Nishihara\n  KOIE Hidetaka\n  Armin Ronacher\n\nThanks to all!\n\n\nCopyright \u0026 License\n===================\n\nCopyright (C) 2009, 2010, Gregory P. Ward and contributors.\n\nThis program is free software; you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation; either version 2 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License along\nwith this program; if not, write to the Free Software Foundation, Inc.,\n51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fericmeyer%2Fvcprompt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fericmeyer%2Fvcprompt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fericmeyer%2Fvcprompt/lists"}