summaryrefslogtreecommitdiff
path: root/contrib
AgeCommit message (Collapse)Author
2007-01-10git.el: Define the propertize function if needed, for XEmacs compatibility.Alexandre Julliard
Also use `concat' instead of `format' in the pretty-printer since format doesn't preserve properties under XEmacs. Signed-off-by: Alexandre Julliard <julliard@winehq.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-06git.el: Avoid setting font lock keywords before entering log-edit mode.Alexandre Julliard
Instead, reinitialize the keywords after the fact. This avoids conflicts with other users of log-edit mode, like pcl-cvs. Signed-off-by: Alexandre Julliard <julliard@winehq.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-06git.el: Don't use --info-only when resolving a file.Alexandre Julliard
It doesn't make a difference for git.el, but it helps when interacting with git-rebase and friends. Signed-off-by: Alexandre Julliard <julliard@winehq.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-28UTF-8: introduce i18n.logoutputencoding.Junio C Hamano
It is plausible for somebody to want to view the commit log in a different encoding from i18n.commitencoding -- the project's policy may be UTF-8 and the user may be using a commit message hook to run iconv to conform to that policy (and either not have i18n.commitencoding to default to UTF-8 or have it explicitly set to UTF-8). Even then, Latin-1 may be more convenient for the usual pager and the terminal the user uses. The new variable i18n.logoutputencoding is used in preference to i18n.commitencoding to decide what encoding to recode the log output in when git-log and friends formats the commit log message. Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-23vc-git: Ignore errors caused by a non-existent directory in vc-git-registered.Alexandre Julliard
Signed-off-by: Alexandre Julliard <julliard@winehq.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-18vim syntax: follow recent changes to commit templateJeff King
This patch changes the syntax highlighting to correctly match the new text of the commit message introduced by 82dca84871637ac9812c0dec27f56d07cfba524c Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-16Teach bash the new features of 'git show'.Shawn O. Pearce
Now that 'git show' accepts ref:path as an argument to specify a tree or blob we should use the same completion logic as we support for cat-file's object identifier. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-13Allow subcommand.color and color.subcommand color configurationAndy Parkins
While adding colour to the branch command it was pointed out that a config option like "branch.color" conflicts with the pre-existing "branch.something" namespace used for specifying default merge urls and branches. The suggested solution was to flip the order of the components to "color.branch", which I did for colourising branch. This patch does the same thing for - git-log (color.diff) - git-status (color.status) - git-diff (color.diff) - pager (color.pager) I haven't removed the old config options; but they should probably be deprecated and eventually removed to prevent future namespace collisions. I've done this deprecation by changing the documentation for the config file to match the new names; and adding the "color.XXX" options to contrib/completion/git-completion.bash. Unfortunately git-svn reads "diff.color" and "pager.color"; which I don't like to change unilaterally. Signed-off-by: Andy Parkins <andyparkins@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-28Fix broken bash completion of local refs.Shawn O. Pearce
Commit 35e65ecc broke completion of local refs, e.g. "git pull . fo<tab>" no longer would complete to "foo". Instead it printed out an internal git error ("fatal: Not a git repository: '.'"). The break occurred when I tried to improve performance by switching from git-peek-remote to git-for-each-ref. Apparently git-peek-remote will drop into directory "$1/.git" (where $1 is its first parameter) if it is given a repository with a working directory. This allowed the bash completion code to work properly even though it was not handing over the true repository directory. So now we do a stat in bash to see if we need to add "/.git" to the path string before running any command with --git-dir. I also tried to optimize away two "git rev-parse --git-dir" invocations in common cases like "git log fo<tab>" as typically the user is in the top level directory of their project and therefore the .git subdirectory is in the current working directory. This should make a difference on systems where fork+exec might take a little while. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-28Teach bash how to complete long options for git-commit.Shawn O. Pearce
Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-27Teach bash about git-am/git-apply and their whitespace options.Shawn O. Pearce
Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-27Cache the list of merge strategies and available commands during load.Shawn O. Pearce
Since the user's git installation is not likely to grow a new command or merge strategy in the lifespan of the current shell process we can save time during completion operations by caching these lists during sourcing of the completion support. If the git executable is not available or we run into errors while caching at load time then we defer these to runtime and generate the list on the fly. This might happen if the user doesn't put git into their PATH until after the completion script gets sourced. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-27Support --strategy=x completion in addition to --strategy x.Shawn O. Pearce
Because git-merge and git-rebase both accept -s, --strategy or --strategy= we should recognize all three formats in the bash completion functions and issue back all merge strategies on demand. I also moved the prior word testing to be before the current word testing, as the current word cannot be completed with -- if the prior word was an option which requires a parameter, such as -s or --strategy. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-27Teach bash about git-repo-config.Shawn O. Pearce
This is a really ugly completion script for git-repo-config, but it has some nice properties. I've added all of the documented configuration parameters from Documentation/config.txt to the script, allowing the user to complete any standard configuration parameter name. We also have some intelligence for the remote.*.* and branch.*.* keys by completing not only the key name (e.g. remote.origin) but also the values (e.g. remote.*.fetch completes to the branches available on the corresponding remote). Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-27Support bash completion of refs/remote.Shawn O. Pearce
Now that people are really likely to start using separate remotes (due to the default in git-clone changing) we should support ref completion for these refs in as many commands as possible. While we are working on this routine we should use for-each-ref to obtain a list of local refs, as this should run faster than peek-remote as it does not need to dereference tag objects in order to produce the list of refs back to us. It should also be more friendly to users of StGIT as we won't generate a list of the StGIT metadata refs. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-27Teach bash about git log/show/whatchanged options.Shawn O. Pearce
Typing out options to git log/show/whatchanged can take a while, but we can easily complete them with bash. So list the most common ones, especially --pretty=online|short|medium|... so that users don't need to type everything out. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-27Teach bash how to complete git-rebase.Shawn O. Pearce
As git-rebase is a popular command bash should know how to complete reference names and its long options. We only support completions which make sense given the current state of the repository, that way users don't get shown --continue/--skip/--abort on the first execution. Also added support for long option --strategy to git-merge, as I missed that option earlier and just noticed it while implementing git-rebase. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-27Teach bash how to complete git-cherry-pick.Shawn O. Pearce
Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-27Teach bash how to complete git-format-patch.Shawn O. Pearce
Provide completion for currently known long options supported by git-format-patch as well as the revision list specification argument, which is generally either a refname or in the form a..b. Since _git_log was the only code that knew how to complete a..b, but we want to start adding option support to _git_log also refactor the a..b completion logic out into its own function. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-27Add current branch in PS1 support to git-completion.bash.Shawn O. Pearce
Many users want to display the current branch name of the current git repository as part of their PS1 prompt, much as their PS1 prompt might also display the current working directory name. We don't force our own PS1 onto the user. Instead we let them craft their own PS1 string and offer them the function __git_ps1 which they can invoke to obtain either "" (when not in a git repository) or "(%s)" where %s is the name of the current branch, as read from HEAD, with the leading refs/heads/ removed. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-27Teach bash how to complete options for git-name-rev.Shawn O. Pearce
Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-27Hide plumbing/transport commands from bash completion.Shawn O. Pearce
Users generally are not going to need to invoke plumbing-level commands from within one line shell commands. If they are invoking these commands then it is likely that they are glueing them together into a shell script to perform an action, in which case bash completion for these commands is of relatively little use. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-27Teach git-completion.bash how to complete git-merge.Shawn O. Pearce
Now that git-merge is high-level Porcelain users are going to expect to be able to use it from the command line, in which case we really should also be able to complete ref names as parameters. I'm also including completion support for the merge strategies that are supported by git-merge.sh, should the user wish to use a different strategy than their default. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-25git-shortlog: make common repository prefix configurable with .mailmapJunio C Hamano
The code had "/pub/scm/linux/kernel/git/" hardcoded which was too specific to the kernel project. With this, a line in the .mailmap file: # repo-abbrev: /pub/scm/linux/kernel/git/ can be used to cause the substring to be abbreviated to /.../ on the title line of the commit message. Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-20shortlog: read mailmap from ./.mailmap againJohannes Schindelin
While at it, remove the linux specific mailmap into contrib/mailmap.linux. Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-05Remove more sed invocations from within bash completion.Shawn O. Pearce
This change removes between 1 and 4 sed invocations per completion entered by the user. In the case of cat-file the 4 invocations per completion can take a while on Cygwin; running these replacements directly within bash saves some time for the end user. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-05Support bash completion on symmetric difference operator.Shawn O. Pearce
Now that log, whatchanged, rev-list, etc. support the symmetric difference operator '...' we should provide bash completion for it just like we do for '..'. While we are at it we can remove two sed invocations during the interactive prompt and replace them with internal bash operations. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-05Take --git-dir into consideration during bash completion.Shawn O. Pearce
If the user has setup a command line of "git --git-dir=baz" then anything we complete must be performed within the scope of "baz" and not the current working directory. This is useful with commands such as "git --git-dir=git.git log m" to complete out "master" and view the log for the master branch of the git.git repository. As a nice side effect this also works for aliases within the target repository, just as git would honor them. Unfortunately because we still examine arguments by absolute position in most of the more complex commands (e.g. git push) using --git-dir with those commands will probably still cause completion to fail. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-05Bash completion support for remotes in .git/config.Shawn O. Pearce
Now that Git natively supports remote specifications within the config file such as: [remote "origin"] url = ... we should provide bash completion support "out of the box" for these remotes, just like we do for the .git/remotes directory. Also cleaned up the __git_aliases expansion to use the same form of querying and filtering repo-config as this saves two fork/execs in the middle of a user prompted completion. Finally also forced the variable 'word' to be local within __git_aliased_command. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-05Only load .exe suffix'd completions on Cygwin.Shawn O. Pearce
The only platform which actually needs to define .exe suffixes as part of its completion set is Cygwin. So don't define them on any other platform. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-05Added missing completions for show-branch and merge-base.Shawn O. Pearce
The show-branch and merge-base commands were partially supported when it came to bash completions as they were only specified in one form another. Now we specify them in both forms. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-05Added bash completion support for git-reset.Shawn O. Pearce
Completion for the --hard/--soft/--mixed modes of operation as well as a ref name for <commit-ish> can be very useful and save some fingers. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-05Added completion support for git-branch.exe.Shawn O. Pearce
On Cygwin a user might complete the new git-branch builtin as git-branch.exe, at which point bash requires a new completion registration for the command. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-04git.el: Include MERGE_MSG in the log-edit buffer even when not committing a ↵Alexandre Julliard
merge. This lets us take advantage of the fact that git-cherry-pick now saves the message in MERGE_MSG too. Signed-off-by: Alexandre Julliard <julliard@winehq.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-04git.el: Move point after the log message header when entering log-edit mode.Alexandre Julliard
Suggested by Han-Wen Nienhuys. Signed-off-by: Alexandre Julliard <julliard@winehq.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-04git.el: Added a function to open the current file in another window.Alexandre Julliard
Bound to 'o' by default, compatible with pcl-cvs and buffer-mode. Suggested by Han-Wen Nienhuys. Signed-off-by: Alexandre Julliard <julliard@winehq.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-04git.el: Added functions for moving to the next/prev unmerged file.Alexandre Julliard
This is useful when doing a merge that changes many files with only a few conflicts here and there. Signed-off-by: Alexandre Julliard <julliard@winehq.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-28Bash completion support for aliasesDennis Stosberg
- Add aliases to the list of available git commands. - Make completion work for aliased commands. Signed-off-by: Dennis Stosberg <dennis@stosberg.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-23ignore-errors requires clKarl Hasselström
vc-git complains that it can't find the definition of ignore-errors unless I (require 'cl). So I guess the correct place to do that is in the file itself. Signed-off-by: Karl Hasselström <kha@treskal.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-22git-vc: better installation instructionsKarl Hasselström
Provide some more detailed installation instructions, for the elisp-challenged among us. Signed-off-by: Karl Hasselström <kha@treskal.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-05vc-git.el: Switch to using git-blame instead of git-annotate.Alexandre Julliard
Signed-off-by: Alexandre Julliard <julliard@winehq.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-05git.el: Fixed inverted "renamed from/to" message.Alexandre Julliard
The deleted file should be labeled "renamed to" and the added file "renamed from", not the other way around (duh!) Signed-off-by: Alexandre Julliard <julliard@winehq.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-09-28Contributed bash completion support for core Git tools.Junio C Hamano
This is a set of bash completion routines for many of the popular core Git tools. I wrote these routines from scratch after reading the git-compl and git-compl-lib routines available from the gitcompletion package at http://gitweb.hawaga.org.uk/ and found those to be lacking in functionality for some commands. Consequently there may be some similarities but many differences. Since these are completion routines only for tools shipped with core Git and since bash is a popular shell on many of the native core Git platforms (Linux, Mac OS X, Solaris, BSD) including these routines as part of the stock package would probably be convienent for many users. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-09-13contrib/vim: add syntax highlighting file for commitsJeff King
Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-26gitview.txt: improve asciidoc markupJonas Fonseca
Signed-off-by: Jonas Fonseca <fonseca@diku.dk> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-17Be nicer if git executable is not installedVille Skyttä
This patch avoids problems if vc-git.el is installed and activated, but the git executable is not available, for example http://list-archive.xemacs.org/xemacs-beta/200608/msg00062.html Signed-off-by: Ville Skyttä <scop@xemacs.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-26Merge branch 'pb/configure'Junio C Hamano
* pb/configure: Rename man1 and man7 variables to man1dir and man7dir Allow INSTALL, bindir, mandir to be set in main Makefile
2006-07-24git.el: Put the git customize group in the 'tools' parent group.Alexandre Julliard
Signed-off-by: Alexandre Julliard <julliard@winehq.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-24git.el: Try to reuse an existing buffer when running git-status.Alexandre Julliard
By default, running git-status again will now reuse an existing buffer that displays the same directory. The old behavior of always creating a new buffer can be obtained by customizing the git-reuse-status-buffer option. Signed-off-by: Alexandre Julliard <julliard@winehq.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-24git.el: Prepend a slash to the file name when adding to .gitignore.Alexandre Julliard
This way the ignore command will really only ignore the marked files and not files with the same name in subdirectories. Signed-off-by: Alexandre Julliard <julliard@winehq.org> Signed-off-by: Junio C Hamano <junkio@cox.net>