Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
This repository was archived by the owner on Dec 10, 2019. It is now read-only.
/vcpromptPublic archive

Version control information in your prompt

License

NotificationsYou must be signed in to change notification settings

djl/vcprompt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Version control information in your prompt.

This project is not under active development. Forks are encouraged!

INSTALL

Download vcprompt, make it executable and add it to your prompt:

$ curl -sL https://github.com/djl/vcprompt/raw/master/bin/vcprompt > ~/bin/vcprompt$ chmod 755 ~/bin/vcprompt

For bash, you'll want to do something like this:

$ export PS1='\u@\h:\w \$(vcprompt)\$'

ZSH users should be aware that they will have to set thePROMPT_SUBST option first:

$ setopt prompt_subst$ export PS1='%n@%m:%~ $(vcprompt)$ '

OPTIONS

  • -f, --format FORMAT

    Passes a custom output format tovcprompt. Defaults to%s:%b.See below for more details.

  • -p, --path PATH

    The path on which to runvcprompt. Defaults to the currentdirectory.

  • -n, --no-newline

    Do not print a trailing newline character.

  • -s, --systems

    Prints all available version control systems to standard out.

  • -t, --timeout

    The maximum execution time in milliseconds.

  • -h, --help

    Prints the help message and exists.

  • -v, --version

    Prints the current version number and exits.

Each version control system also has it's own formatting option.The options take the form of--format-SYSTEM.The available options are currently:

  • --format-bzr
  • --format-cvs
  • --format-darcs
  • --format-fossil
  • --format-git
  • --format-hg
  • --format-svn

You can customise the status symbols used with the following options:

  • -A, --staged

    The symbol to print when changes have been staged. Defaults to*

  • -M, --modified

    The symbol to print when files have been modified. Defaults to+

  • -U, --untracked

    The symbol to print when there are untracked files. Defaults to?

FORMATS

vcprompt comes with a number of formatting tokens. What follows is alist of all the available tokens:

  • %s,%n

    The "short name" of the version control system currently inuse. E.g.git,hg,svn

  • %h

    The hash of the repository. If no hash is available it will show therevision number instead.

  • %r

    The revision number of the repository. If no revision number isavailable it will return the hash instead.

  • %b

    The current branch (or basename of the repository if the branch nameis unavailable).

  • %m

    Displays a plus symbol (+) if there are any changes (which are notstaged for commit, in systems that make such a distinction, i.e. git).

  • %a

    Displays an asterisk (*) if there are any changes staged for commit(in systems that make such a distinction, i.e. git).

  • %u

    Displays a question mark (?) if there are any untracked files.

  • %P

    The name of the repository root directory (typically a project name).

  • %p

    The relative path from the repository root directory to the currentdirectory (or the directory specified by--path).

REQUIREMENTS

  • Python 2.4 or later (including Python 3).

  • Support for Subversion >= 1.7 and Fossil requires the SQLite3 Pythonmodule to be installed (built in on Python 2.5+).

NOTES

vcprompt was heavily inspired by Greg Ward's originalimplementation in C.

This version of vcprompt attempts to stay mostly compatible with theoriginal although there may be some notable differences.

About

Version control information in your prompt

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp