path: root/contrib
AgeCommit message (Collapse)Author
2010-08-18merge script: --ff-only to disallow true mergeJonathan Nieder
Port v1.6.6-rc0~62^2 (Teach 'git merge' and 'git pull' the option --ff-only, 2009-10-29) to the old merge script. Signed-off-by: Jonathan Nieder <> Signed-off-by: Junio C Hamano <>
2010-08-18merge script: handle many-way octopusJonathan Nieder
Based on v1.6.0-rc0~51^2~5 (Build in merge, 2008-07-07). Signed-off-by: Jonathan Nieder <> Signed-off-by: Junio C Hamano <>
2010-08-18merge script: handle -m --log correctlyJonathan Nieder
Based on v1.7.1.1~23^2 (merge: --log appends shortlog to message if specified, 2010-05-11). Without this change, the scripted (non-builtin) merge does not pass t7604. Cc: Tay Ray Chuan <> Signed-off-by: Jonathan Nieder <> Signed-off-by: Junio C Hamano <>
2010-08-18merge script: forbid merge -s indexJonathan Nieder
Some git-merge-* commands are not merge strategies. This is based on v1.6.1-rc1~294^2~7 (builtin-merge: allow using a custom strategy, 2008-07-30) but it is less smart: we just use a hard-coded list of forbidden strategy names. It is okay if this falls out of date, since the code is just an example. Signed-off-by: Jonathan Nieder <> Signed-off-by: Junio C Hamano <>
2010-08-18merge script: allow custom strategiesJonathan Nieder
The idea comes from v1.6.1-rc1~294^2~7 (builtin-merge: allow using a custom strategy, 2008-07-30). Signed-off-by: Jonathan Nieder <> Signed-off-by: Junio C Hamano <>
2010-08-18merge script: merge -X<option>Jonathan Nieder
Without this support, the scripted merge cannot pass t6037. Based on v1.7.0-rc0~55^2~5 (git merge -X<option>, 2009-11-25). Signed-off-by: Jonathan Nieder <> Signed-off-by: Junio C Hamano <>
2010-08-18merge script: improve log message subjectJonathan Nieder
- point out remote-tracking branches as "remote branch 'upstream/master'"; - avoid misleading log messages when a tag and branch share a name. This approximates the builtin merge command's behavior well enough to pass the relevant tests. Based roughly on v1.6.4.2~10^2 (merge: indicate remote tracking branches in merge message, 2009-08-09) and v1.6.4.2~10^2~1 (merge: fix incorrect merge message for ambiguous tag/branch, 2009-08-09). Cc: Jeff King <> Signed-off-by: Jonathan Nieder <> Signed-off-by: Junio C Hamano <>
2010-08-18merge script: refuse to merge during mergeJonathan Nieder
Check MERGE_HEAD and bail out if it exists. Based on v1.6.3.3~3^2 (refuse to merge during a merge, 2009-06-01). Without this change, the scripted merge does not pass t3030. Cc: Clemens Buchacher <> Signed-off-by: Jonathan Nieder <> Signed-off-by: Junio C Hamano <>
2010-08-18merge script: tweak unmerged files message to match builtinJonathan Nieder
Before: You are in the middle of a conflicted merge. After: Merge is not possible because you have unmerged files. I prefer the old message, but the new one is more consistent with other commands and tests expect it. In particular, without this change the scripted merge does not pass t3030. Based on v1.7.0-rc0~66^2 (Be more user-friendly when refusing to do something because of conflict., 2010-01-12). Cc: Matthieu Moy <> Signed-off-by: Jonathan Nieder <> Signed-off-by: Junio C Hamano <>
2010-08-18merge script: --squash, --ff from unborn branch are errorsJonathan Nieder
Port v1.6.1-rc1~319 (provide more errors for the "merge into empty head" case, 2008-08-21) to the example merge script. Noticed by comparison with builtin merge. Signed-off-by: Jonathan Nieder <> Signed-off-by: Junio C Hamano <>
2010-07-16Add a sample user for the svndump libraryJonathan Nieder
The svn-fe tool takes a Subversion dump file as input and produces a fast-import stream as output. This can be useful as a low-level tool in building other importers, or for debugging the vcs-svn library. make svn-fe make svn-fe.1 to test. Signed-off-by: Jonathan Nieder <> Signed-off-by: Ramkumar Ramachandra <> Signed-off-by: Junio C Hamano <>
2010-06-30Merge branch 'tr/rev-list-count'Junio C Hamano
* tr/rev-list-count: bash completion: Support "divergence from upstream" messages in __git_ps1 rev-list: introduce --count option Conflicts: contrib/completion/git-completion.bash
2010-06-30Merge branch 'as/maint-completion-set-u-fix'Junio C Hamano
* as/maint-completion-set-u-fix: bash-completion: Fix __git_ps1 to work with "set -u"
2010-06-24bash completion: Support "divergence from upstream" messages in __git_ps1Andrew Sayers
Add a notification in the command prompt specifying whether (and optionally how far) your branch has diverged from its upstream. This is especially helpful in small teams that very frequently (forget to) push to each other. Support git-svn upstream detection as a special case, as migrators from centralised version control systems are especially likely to forget to push. Support for other types of upstream than SVN should be easy to add if anyone is so inclined. Signed-off-by: Andrew Sayers <> Acked-by: Shawn O. Pearce <> Signed-off-by: Junio C Hamano <>
2010-06-22Merge branch 'sb/format-patch-signature'Junio C Hamano
* sb/format-patch-signature: completion: Add --signature and format.signature format-patch: Add a signature option (--signature)
2010-06-21Merge branch 'em/checkout-orphan'Junio C Hamano
* em/checkout-orphan: log_ref_setup: don't return stack-allocated array bash completion: add --orphan to 'git checkout' t3200: test -l with core.logAllRefUpdates options checkout --orphan: respect -l option always refs: split log_ref_write logic into log_ref_setup Documentation: alter checkout --orphan description
2010-06-18bash-completion: Fix __git_ps1 to work with "set -u"Andrew Sayers
Define several variables in __git_ps1 to avoid errors under "set -u" semantics. __git_ps1 seems to have been missed when the rest of the file was fixed in 25a31f8. Signed-off-by: Andrew Sayers <> Signed-off-by: Junio C Hamano <>
2010-06-16completion: Add --signature and format.signatureStephen Boyd
Cc: Shawn O. Pearce <> Signed-off-by: Stephen Boyd <> Signed-off-by: Junio C Hamano <>
2010-06-03bash completion: add --orphan to 'git checkout'Erick Mattos
Update git-completion.bash with new --orphan option to 'git checkout'. Signed-off-by: Erick Mattos <> Signed-off-by: Junio C Hamano <>
2010-05-28Merge branch 'maint'Junio C Hamano
* maint: Makefile: reenable install with NO_CURL completion: --set-upstream option for git-branch get_cwd_relative(): do not misinterpret suffix as subdirectory
2010-05-28completion: --set-upstream option for git-branchMichael J Gruber
Signed-off-by: Michael J Gruber <> Signed-off-by: Junio C Hamano <>
2010-05-21Merge branch 'st/remote-tags-no-tags'Junio C Hamano
* st/remote-tags-no-tags: remote add: add a --[no-]tags option Honor "tagopt = --tags" configuration option
2010-05-21Merge branch 'jn/request-pull'Junio C Hamano
* jn/request-pull: tests: chmod +x t5150 adapt request-pull tests for new pull request format t5150: protect backslash with backslash in shell request-pull: protect against OPTIONS_KEEPDASHDASH from environment tests for request-pull
2010-05-20post-receive-email: document command-line modeJonathan Nieder
According to the default hooks/post-receive file, the hook is called with three arguments on stdin: <oldrev> <newrev> <refname> In command-line mode, the arguments come in a different order, because the email hook instead calls: generate_email $2 $3 $1 Add a comment to explain why, based on comments from the mailing list and the commit message to v1.5.1~9. Thanks to Andy for the explanation. Requested-by: martin f. krafft <> Cc: Andy Parkins <> Signed-off-by: Jonathan Nieder <> Signed-off-by: Junio C Hamano <>
2010-05-08Merge branch 'jn/maint-request-pull' into jn/request-pullJunio C Hamano
2010-05-01request-pull: protect against OPTIONS_KEEPDASHDASH from environmentJonathan Nieder
Like most git commands, request-pull supports a -- delimiter to allow callers to pass arguments that would otherwise be treated as an option afterwards. The internal OPTIONS_KEEPDASHDASH variable is passed empty to git-sh-setup to indicate that request-pull itself does not care about the position of the -- delimiter. But if the user has that variable in her environment, request-pull will see the “--” and fail. Empty it explicitly to guard against this. While at it, make the corresponding fix to git-resurrect, too (all other scripts in git.git already protect themselves). Acked-by: Thomas Rast <> Acked-by: Miklos Vajna <> Signed-off-by: Jonathan Nieder <> Signed-off-by: Junio C Hamano <>
2010-04-19Honor "tagopt = --tags" configuration optionSamuel Tardieu
If the "tagopt = --tags" option of a remote is set, all tags will be fetched as in "git fetch --tags". Signed-off-by: Samuel Tardieu <> Signed-off-by: Junio C Hamano <>
2010-04-06Merge branch 'sg/bash-completion'Junio C Hamano
* sg/bash-completion: bash: completion for gitk aliases bash: support user-supplied completion scripts for aliases bash: support user-supplied completion scripts for user's git commands bash: improve aliased command recognition
2010-04-03Merge branch 'rb/maint-python-path'Junio C Hamano
* rb/maint-python-path: Correct references to /usr/bin/python which does not exist on FreeBSD
2010-04-02Integrate version 3 ciabot scripts into contrib/.Eric Raymond
These have been extensively live-tested in the last week. The version 2 maintainer has passed the baton to me; is original. Signed-off-by: Eric S. Raymond <> Signed-off-by: Junio C Hamano <>
2010-03-24Correct references to /usr/bin/python which does not exist on FreeBSDR. Tyler Ballance
On FreeBSD, Python does not ship as part of the base system but is available via the ports system, which install the binary in /usr/local/bin. Signed-off-by: R. Tyler Ballance <> Signed-off-by: Junio C Hamano <>
2010-03-20Fix a spelling mistake in a git-p4 console messageBenjamin C Meyer
Signed-off-by: Benjamin C Meyer <> Signed-off-by: Junio C Hamano <>
2010-03-17Merge branch 'maint'Junio C Hamano
* maint: Documentation: receive.denyCurrentBranch defaults to 'refuse' bash: complete *_HEAD refs if present
2010-03-17bash: complete *_HEAD refs if presentIan Ward Comfort
We already complete HEAD, of course, and might as well complete the other common refs mentioned in the rev-parse man page: FETCH_HEAD, ORIG_HEAD, and MERGE_HEAD. Signed-off-by: Ian Ward Comfort <> Acked-by: Shawn O. Pearce <> Signed-off-by: Junio C Hamano <>
2010-03-15Merge branch 'jh/notes'Junio C Hamano
* jh/notes: (33 commits) Documentation: fix a few typos in git-notes.txt notes: fix malformed tree entry builtin-notes: Minor (mostly parse_options-related) fixes builtin-notes: Add "copy" subcommand for copying notes between objects builtin-notes: Misc. refactoring of argc and exit value handling builtin-notes: Add -c/-C options for reusing notes builtin-notes: Refactor handling of -F option to allow combining -m and -F builtin-notes: Deprecate the -m/-F options for "git notes edit" builtin-notes: Add "append" subcommand for appending to note objects builtin-notes: Add "add" subcommand for adding notes to objects builtin-notes: Add --message/--file aliases for -m/-F options builtin-notes: Add "list" subcommand for listing note objects Documentation: Generalize git-notes docs to 'objects' instead of 'commits' builtin-notes: Add "prune" subcommand for removing notes for missing objects Notes API: prune_notes(): Prune notes that belong to non-existing objects t3305: Verify that removing notes triggers automatic fanout consolidation builtin-notes: Add "remove" subcommand for removing existing notes Teach builtin-notes to remove empty notes Teach notes code to properly preserve non-notes in the notes tree t3305: Verify that adding many notes with git-notes triggers increased fanout ... Conflicts: Makefile
2010-02-24bash: completion for gitk aliasesSZEDER Gábor
gitk aliases either start with "!gitk", or look something like "!sh -c FOO=bar gitk", IOW they contain the "gitk" word. With this patch the completion script will recognize these cases and will offer gitk's options. Just like the earlier change improving on aliased command recognition, this change can also be fooled easily by some complex aliases, but users of such aliases could remedy it with custom completion functions. Signed-off-by: SZEDER Gábor <> Signed-off-by: Junio C Hamano <>
2010-02-24bash: support user-supplied completion scripts for aliasesSZEDER Gábor
Shell command aliases can get rather complex, and the completion script can not always determine correctly the git command invoked by such an alias. For such cases users might want to provide custom completion scripts the same way like for their custom commands made possible by the previous patch. The current completion script does not allow this, because if it encounters an alias, then it will unconditionally perform completion for the aliased git command (in case it can determine the aliased git command, of course). With this patch the completion script will first search for a completion function for the command given on the command line, be it a git command, a custom git command of the user, or an alias, and invoke that function to perform the completion. This has no effect on git commands, because they can not be aliased anyway. If it is an alias and there is a completion function for that alias (e.g. _git_foo() for the alias 'foo'), then it will be invoked to perform completion, allowing users to provide custom completion functions for aliases. If such a completion function can not be found, only then will the completion script check whether the command given on the command line is an alias or not, and proceed as usual (i.e. find out the aliased git command and provide completion for it). Signed-off-by: SZEDER Gábor <> Signed-off-by: Junio C Hamano <>
2010-02-24bash: support user-supplied completion scripts for user's git commandsSZEDER Gábor
The bash completion script already provides support to complete aliases, options and refs for aliases (if the alias can be traced back to a supported git command by __git_aliased_command()), and the user's custom git commands, but it does not support the options of the user's custom git commands (of course; how could it know about the options of a custom git command?). Users of such custom git commands could extend git's bash completion script by writing functions to support their commands, but they might have issues with it: they might not have the rights to modify a system-wide git completion script, and they will need to track and merge upstream changes in the future. This patch addresses this by providing means for users to supply custom completion scriplets for their custom git commands without modifying the main git bash completion script. Instead of having a huge hard-coded list of command-completion function pairs (in _git()), the completion script will figure out which completion function to call based on the command's name. That is, when completing the options of 'git foo', the main completion script will check whether the function '_git_foo' is declared, and if declared, it will invoke that function to perform the completion. If such a function is not declared, it will fall back to complete file names. So, users will only need to provide this '_git_foo' completion function in a separate file, source that file, and it will be used the next time they press TAB after 'git foo '. There are two git commands (stage and whatchanged), for which the completion functions of other commands were used, therefore they got their own completion function. Signed-off-by: SZEDER Gábor <> Signed-off-by: Junio C Hamano <>
2010-02-24bash: improve aliased command recognitionSZEDER Gábor
To support completion for aliases, the completion script tries to figure out which git command is invoked by an alias. Its implementation in __git_aliased_command() is rather straightforward: it returns the first word from the alias. For simple aliases starting with the git command (e.g. alias.last = cat-file commit HEAD) this gives the right results. Unfortunately, it does not work with shell command aliases, which can get rather complex, as illustrated by one of Junio's aliases: [alias] lgm = "!sh -c 'GIT_NOTES_REF=refs/notes/amlog git log \"$@\" || :' -" In this case the current implementation returns "!sh" as the aliased git command, which is obviosly wrong. The full parsing of a shell command alias like that in the completion code is clearly unfeasible. However, we can easily improve on aliased command recognition by eleminating stuff that is definitely not a git command: shell commands (anything starting with '!'), command line options (anything starting with '-'), environment variables (anything with a '=' in it), and git itself. This way the above alias would be handled correctly, and the completion script would correctly recognize "log" as the aliased git command. Of course, this solution is not perfect either, and could be fooled easily. It's not hard to construct an alias, in which a word does not match any of these filter patterns, but is still not a git command (e.g. by setting an environment variable to a value which contains spaces). It may even return false positives, when the output of a git command is piped into an other git command, and the second gets the command line options via $@, but options for the first one are offered. However, the following patches will enable the user to supply custom completion scripts for aliases, which can be used to remedy these problematic cases. Signed-off-by: SZEDER Gábor <> Signed-off-by: Junio C Hamano <>
2010-02-20git-p4: fix bug in symlink handlingEvan Powers
Fix inadvertent breakage from b932705 (git-p4: stream from perforce to speed up clones, 2009-07-30) in the code that strips the trailing '\n' from p4 print on a symlink. (In practice, contents is of the form ['target\n', ''].) Signed-off-by: Evan Powers <> Acked-by: Pete Wyckoff <> Signed-off-by: Junio C Hamano <>
2010-02-17Merge branch 'jc/typo' into maintJunio C Hamano
* jc/typo: Typofixes outside documentation area
2010-02-14Builtin-ify git-notesJohan Herland
The builtin-ification includes some minor behavioural changes to the command-line interface: It is no longer allowed to mix the -m and -F arguments, and it is not allowed to use multiple -F options. As part of the builtin-ification, we add the commit_notes() function to the builtin API. This function (together with the notes.h API) can be easily used from other builtins to manipulate the notes tree. Also includes needed changes to t3301. This patch has been improved by the following contributions: - Stephen Boyd: Use die() instead of fprintf(stderr, ...) followed by exit(1) Cc: Stephen Boyd <> Signed-off-by: Johan Herland <> Signed-off-by: Junio C Hamano <>
2010-02-12bash: support 'git am's new '--continue' optionSZEDER Gábor
Signed-off-by: SZEDER Gábor <> Signed-off-by: Junio C Hamano <>
2010-02-06bash: support the --autosquash option for rebaseBjörn Gustavsson
Signed-off-by: Björn Gustavsson <> Signed-off-by: Junio C Hamano <>
2010-02-04Typofixes outside documentation areaJunio C Hamano
begining -> beginning canonicalizations -> canonicalization comand -> command dewrapping -> unwrapping dirtyness -> dirtiness DISCLAMER -> DISCLAIMER explicitely -> explicitly feeded -> fed impiled -> implied madatory -> mandatory mimick -> mimic preceeding -> preceding reqeuest -> request substition -> substitution Signed-off-by: Junio C Hamano <>
2010-02-01git-p4: Fix sync errors due to new server versionPal-Kristian Engstad
Fix sync errors due to new Perforce servers. The P4D/NTX64/2009.2/228098 (2009/12/16) server reports 'move/delete' instead of 'delete'. This causes the Perforce depot and the git repo to get out of sync. Fixed by adding the new status string. Signed-off-by: Pal-Kristian Engstad <> Signed-off-by: Junio C Hamano <>
2010-01-28Merge branch 'maint'Junio C Hamano
* maint: bash: don't offer remote transport helpers as subcommands
2010-01-28bash: support 'git notes' and its subcommandsSZEDER Gábor
... and it will offer refs unless after -m or -F, because these two options require a non-ref argument. Signed-off-by: SZEDER Gábor <> Acked-by: Shawn O. Pearce <> Signed-off-by: Junio C Hamano <>
2010-01-28bash: don't offer remote transport helpers as subcommandsSZEDER Gábor
Since commits a2d725b7 (Use an external program to implement fetching with curl, 2009-08-05) and c9e388bb (Make the "traditionally-supported" URLs a special case, 2009-09-03) remote transport helpers like 'remote-ftp' and 'remote-curl' are offered by the completion script as available subcommands. Not good, since they are helpers, therefore should not be offered, so filter them out. Signed-off-by: SZEDER Gábor <> Acked-by: Shawn O. Pearce <> Signed-off-by: Junio C Hamano <>
2010-01-23msvc: Fix an "unrecognized option" linker warningRamsay Jones
Having recently added support for building git-imap-send on Windows, we now link against OpenSSL libraries, and the linker issues the following warning: warning LNK4044: unrecognized option '/lssl'; ignored In order to suppress the warning, we change the msvc linker script to translate an '-lssl' parameter to the ssleay32.lib library. Note that the linker script was already including ssleay32.lib (along with libeay32.lib) as part of the translation of the '-lcrypto' library parameter. However, libeay32.dll does not depend on ssleay32.dll and can be used stand-alone, so we remove ssleay32.lib from the '-lcrypto' translation. The dependence of ssleay32.dll on libeay32.dll is represented in the Makefile by the NEEDS_CRYPTO_WITH_SSL build variable. Also, add the corresponding change to the buildsystem generator. Signed-off-by: Ramsay Jones <> Acked-by: Sebastian Schuberth <> Signed-off-by: Junio C Hamano <>