summaryrefslogtreecommitdiff
path: root/contrib
AgeCommit message (Collapse)Author
2011-05-10git-completion: fix regression in zsh supportFelipe Contreras
The zsh support of git-completion script in contrib/ is broken for current versions of zsh, and does not notice when there's a subcommand. For example: "git log origi<TAB>" gives no completions because it would try to find a "git origi..." command. This will be fixed by zsh 4.3.12, but for now we can workaround it by backporting the same fix as zsh folks implemented. The problem started after commit v1.7.4-rc0~11^2~2 (bash: get --pretty=m<tab> completion to work with bash v4), which introduced _get_comp_words_by_ref() that comes from bash-completion[1] scripts, and relies on the 'words' variable. However, it turns out 'words' is a special variable used by zsh completion. From zshcompwid(1): [...] the parameters are reset on each function exit (including nested function calls from within the completion widget) to the values they had when the function was entered. As a result, subcommand words are lost. Ouch. This is now fixed in the latest master branch of zsh[2] by simply defining 'words' as hidden (typeset -h), which removes the special meaning inside the emulated bash function. So let's do the same. Jonathan Nieder helped on the commit message. [1] http://bash-completion.alioth.debian.org/ [2] http://zsh.git.sourceforge.net/git/gitweb.cgi?p=zsh/zsh;a=commitdiff;h=e880604f029088f32fb1ecc39213d720ae526aaa Reported-by: Stefan Haller <lists@haller-berlin.de> Comments-by: SZEDER Gábor <szeder@ira.uka.de> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-07git-p4: replace each tab with 8 spaces for consistencyAndrew Garber
Note that the majority of git-p4 uses spaces, not tabs, for indentation. Consistent indentation is a good hygiene for Python scripts, and mixing tabs and spaces in Python can lead to hard-to-find bugs. Signed-off-by: Andrew Garber <andrew@andrewgarber.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-03git.el: Don't use font-lock-compile-keywordsLawrence Mitchell
If font-lock is disabled, font-lock-compile-keywords complains. Really what we want to do is to replace log-edit's font-lock definitions with our own, so define a major mode deriving from log-edit and set up font-lock-defaults there. We then use the optional MODE argument to log-edit to set up the major mode of the commit buffer appropriately. Signed-off-by: Lawrence Mitchell <wence@gmx.li> Acked-by: Alexandre Julliard <julliard@winehq.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-03-30Merge branch 'maint'Junio C Hamano
* maint: contrib/thunderbird-patch-inline: do not require bash to run the script t8001: check the exit status of the command being tested strbuf.h: remove a tad stale docs-in-comment and reference api-doc instead Typos: t/README Documentation/config.txt: make truth value of numbers more explicit git-pack-objects.txt: fix grammatical errors parse-remote: replace unnecessary sed invocation
2011-03-30contrib/thunderbird-patch-inline: do not require bash to run the scriptMaxin john
The script does not have to be run under bash, but any POSIX compliant shell would do, as it does not use any bash-isms. It may be written under a different style than what is recommended in Documentation/CodingGuidelines, but that is a different matter. While at it, fix obvious typos in the comment. Signed-off-by: Maxin B. John <maxin@maxinbjohn.info> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-03-27Merge branch 'mg/rev-list-n-parents'Junio C Hamano
* mg/rev-list-n-parents: tests: avoid nonportable {foo,bar} glob rev-list --min-parents,--max-parents: doc, test and completion revision.c: introduce --min-parents and --max-parents options t6009: use test_commit() from test-lib.sh
2011-03-27Merge branch 'jp/completion-help-alias'Junio C Hamano
* jp/completion-help-alias: git-completion: Add git help completion for aliases
2011-03-23Merge branch 'pw/p4'Junio C Hamano
* pw/p4: git-p4: test sync new branch git-p4: fix sync new branch regression
2011-03-23rev-list --min-parents,--max-parents: doc, test and completionMichael J Gruber
This also adds test for "--merges" and "--no-merges" which we did not have so far. Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-03-23Merge branch 'tl/p4'Junio C Hamano
* tl/p4: git-p4: Fix error message crash in P4Sync.commit. Teach git-p4 to ignore case in perforce filenames if configured. git-p4: Teach gitConfig method about arguments.
2011-03-23Merge branch 'sg/complete-symmetric-diff'Junio C Hamano
* sg/complete-symmetric-diff: bash: complete 'git diff ...branc<TAB>' bash: fix misindented esac statement in __git_complete_file()
2011-03-22git-completion: Add git help completion for aliasesJakob Pfender
Enable bash completion for "git help <alias>", analogous to "git <alias>", which was already implemented. Signed-off-by: Jakob Pfender <jpfender@elegosoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-03-20Merge branch 'ss/mergetool--lib'Junio C Hamano
* ss/mergetool--lib: mergetool--lib: Add Beyond Compare 3 as a tool mergetool--lib: Sort tools alphabetically for easier lookup
2011-03-16git-p4: fix sync new branch regressionPete Wyckoff
e32e00d (git-p4: better message for "git-p4 sync" when not cloned, 2011-02-19) broke another use case, that of using "git-p4 sync" to import a new branch into an existing repository. Refine the fix again, on top of the fix in ac34efc. Reported-by: Michael Horowitz <michael.horowitz@ieee.org> Signed-off-by: Pete Wyckoff <pw@padd.com> Tested-by: Michael Horowitz <michael.horowitz@ieee.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-03-15git-p4: Fix error message crash in P4Sync.commit.Tor Arvid Lund
There is an error message that crashes the script because of an invalid ref to the non-existing "path" variable. It is almost never printed, which would explain why nobody encountered this problem before... But anyway, this oneliner fixes it. Signed-off-by: Tor Arvid Lund <torarvid@gmail.com> Acked-by: Pete Wyckoff <pw@padd.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-03-15Teach git-p4 to ignore case in perforce filenames if configured.Tor Arvid Lund
When files are added to perforce, the path to that file has whichever case configuration that exists on the machine of the user who added the file. What does that mean? It means that when Alice adds a file //depot/DirA/FileA.txt ... and Bob adds: //depot/dirA/FileB.txt ... we may or may not get a problem. If a user sets the config variable git-p4.ignorecase to "true", we will consider //depot/DirA and //depot/dirA to be the same directory. Signed-off-by: Tor Arvid Lund <torarvid@gmail.com> Acked-by: Pete Wyckoff <pw@padd.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-03-15git-p4: Teach gitConfig method about arguments.Tor Arvid Lund
With this patch, it is possible to call the gitConfig method with an optional argument string, which will be passed to the "git config" executable. For instance: gitConfig("core.ignorecase", "--bool") will ensure that you get the value "true", and won't have to check the returned value for [1, true, on, yes]. Signed-off-by: Tor Arvid Lund <torarvid@gmail.com> Acked-by: Pete Wyckoff <pw@padd.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-03-13Merge branch 'pw/p4'Junio C Hamano
* pw/p4: git-p4: test clone @all git-p4: fix clone @all regression
2011-03-13git-p4: fix clone @all regressionPete Wyckoff
e32e00d (git-p4: better message for "git-p4 sync" when not cloned, 2011-02-19) broke the use of the "@all" revision specifier, e.g., git-p4 clone //depot/xxx@all Fix it as per Tor Arvid's quick patch. Signed-off-by: Pete Wyckoff <pw@padd.com> Reported-by: Anatol Pomozov <anatol.pomozov@gmail.com> Based-on-patch-by: Tor Arvid Lund <torarvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-03-11bash: complete 'git diff ...branc<TAB>'SZEDER Gábor
While doing a final sanity check before merging a topic Bsomething, it is a good idea to review what damage Bsomething branch would make, by running: $ git diff ...Bsomething Unfortunately, our completion script for 'git diff' doesn't offer anything after '...'. This is because 'git diff's completion function invokes __git_complete_file() for non-option arguments to complete the '<tree>:<path>' extended SHA-1 notation, but this helper function doesn't support refs after '...' or '..'. Completion of refs after '...' or '..' is supported by the __git_complete_revlist() helper function, but that doesn't support '<tree>:<path>'. To support both '...<ref>' and '<tree>:<path>' notations for 'git diff', this patch, instead of adding yet another helper function, joins __git_complete_file() and __git_complete_revlist() into the new common function __git_complete_revlist_file(). The old helper functions __git_complete_file() and __git_complete_revlist() are changed to be a direct wrapper around the new __git_complete_revlist_file(), because they might be used in user-supplied completion scripts and we don't want to break them. This change will cause some wrong suggestions for other commands which use __git_complete_file() ('git diff' and friends) or __git_complete_revlist() ('git log' and friends), e.g. 'git diff ...master:Doc<TAB>' and 'git log master:Doc<TAB>' will complete the path to 'Documentation/', although neither commands make any sense. However, both of these were actively wrong to begin with as soon as the user entered the ':', so there is no real harm done. Suggested-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: SZEDER Gábor <szeder@ira.uka.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-03-11bash: fix misindented esac statement in __git_complete_file()SZEDER Gábor
Signed-off-by: SZEDER Gábor <szeder@ira.uka.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-03-09Merge branch 'js/cherry-pick-usability'Junio C Hamano
* js/cherry-pick-usability: Teach commit about CHERRY_PICK_HEAD bash: teach __git_ps1 about CHERRY_PICK_HEAD Introduce CHERRY_PICK_HEAD t3507: introduce pristine-detach helper
2011-03-04Merge branch 'mh/p4'Junio C Hamano
* mh/p4: git-p4 submit: prevent 'Jobs' section from being removed from p4 change log
2011-03-01Merge branch 'svn-fe' of git://repo.or.cz/git/jrnJunio C Hamano
* 'svn-fe' of git://repo.or.cz/git/jrn: (31 commits) fast-import: make code "-Wpointer-arith" clean vcs-svn: teach line_buffer about temporary files vcs-svn: allow input from file descriptor vcs-svn: allow character-oriented input vcs-svn: add binary-safe read function t0081 (line-buffer): add buffering tests vcs-svn: tweak test-line-buffer to not assume line-oriented input tests: give vcs-svn/line_buffer its own test script vcs-svn: make test-line-buffer input format more flexible vcs-svn: teach line_buffer to handle multiple input files vcs-svn: collect line_buffer data in a struct vcs-svn: replace buffer_read_string memory pool with a strbuf vcs-svn: eliminate global byte_buffer fast-import: add 'ls' command vcs-svn: Allow change nodes for root of tree (/) vcs-svn: Implement Prop-delta handling vcs-svn: Sharpen parsing of property lines vcs-svn: Split off function for handling of individual properties vcs-svn: Make source easier to read on small screens vcs-svn: More dump format sanity checks ...
2011-02-28mergetool--lib: Add Beyond Compare 3 as a toolSebastian Schuberth
Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com> Tested-by: Chris Packham <judge.packham@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-02-28Merge branch 'va/p4'Junio C Hamano
* va/p4: git-p4: Add copy detection support git-p4: Improve rename detection support
2011-02-28Merge branch 'pw/p4'Junio C Hamano
* pw/p4: git-p4: support clone --bare git-p4: decode p4 wildcard characters git-p4: better message for "git-p4 sync" when not cloned git-p4: reinterpret confusing p4 message git-p4: accommodate new move/delete type in p4 git-p4: add missing newline in initial import message git-p4: fix key error for p4 problem git-p4: test script
2011-02-26Merge commit 'jn/svn-fe' of git://github.com/gitster/git into svn-feJonathan Nieder
* git://github.com/gitster/git: vcs-svn: Allow change nodes for root of tree (/) vcs-svn: Implement Prop-delta handling vcs-svn: Sharpen parsing of property lines vcs-svn: Split off function for handling of individual properties vcs-svn: Make source easier to read on small screens vcs-svn: More dump format sanity checks vcs-svn: Reject path nodes without Node-action vcs-svn: Delay read of per-path properties vcs-svn: Combine repo_replace and repo_modify functions vcs-svn: Replace = Delete + Add vcs-svn: handle_node: Handle deletion case early vcs-svn: Use mark to indicate nodes with included text vcs-svn: Unclutter handle_node by introducing have_props var vcs-svn: Eliminate node_ctx.mark global vcs-svn: Eliminate node_ctx.srcRev global vcs-svn: Check for errors from open() vcs-svn: Allow simple v3 dumps (no deltas yet) Conflicts: t/t9010-svn-fe.sh vcs-svn/svndump.c
2011-02-26git-p4 submit: prevent 'Jobs' section from being removed from p4 change logMichael Horowitz
In an attempt to overwrite the 'Description:' section of the p4 change log to include the git commit messages, it also overwrote the 'Jobs:' section.  This fix restores the 'Job:' section. Signed-off-by: Michael Horowitz <michael.horowitz@ieee.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-02-22bash: teach __git_ps1 about CHERRY_PICK_HEADJay Soffian
Make the git prompt (when enabled) show a CHERRY-PICKING indicator when we are in the middle of a conflicted cherry-pick, analogous to the existing MERGING and BISECTING flags. Signed-off-by: Jay Soffian <jaysoffian@gmail.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-02-21git-p4: Add copy detection supportVitor Antunes
Add new config options: git-p4.detectCopies - Enable copy detection. git-p4.detectCopiesHarder - Find copies harder. The detectCopies option should be set to a true/false value. The detectCopiesHarder option should be set to true/false value. P4Submit can now process diff-tree C status and integrate files accordingly. Signed-off-by: Vitor Antunes <vitor.hda@gmail.com> Acked-by: Pete Wyckoff <pw@padd.com> Acked-by: Tor Arvid Lund <torarvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-02-21git-p4: Improve rename detection supportVitor Antunes
Only open files for edit after integrating if the SHA1 of source and destination differ from each other. Add git config option detectRenames to allow permanent rename detection. This options should be set to a true/false value. Rename "detectRename" variable to "detectRenames" to make it more coherent with the description in git man pages, which always use plural. Signed-off-by: Vitor Antunes <vitor.hda@gmail.com> Acked-by: Pete Wyckoff <pw@padd.com> Acked-by: Tor Arvid Lund <torarvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-02-21git-p4: support clone --barePete Wyckoff
Just like git clone --bare, build a .git directory but no checked out files. Signed-off-by: Pete Wyckoff <pw@padd.com> Acked-By: Tor Arvid Lund <torarvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-02-21git-p4: decode p4 wildcard charactersPete Wyckoff
There are four wildcard characters in p4. Files with these characters can be added to p4 repos using the "-f" option. They are stored in %xx notation, and when checked out, p4 converts them back to normal. This patch does the same thing when importing into git, converting the four special characters. Without this change, the files appear with literal %xx in their names. Be careful not to produce "*" in filenames on windows. That will fail. Signed-off-by: Pete Wyckoff <pw@padd.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-02-21git-p4: better message for "git-p4 sync" when not clonedPete Wyckoff
A common error is to do "git-p4 sync" in a repository that was not initialized by "git-p4 clone". There will be no p4 refs. The error message in this case is a traceback for an assertion, which is confusing. Change it instead to explain the likely problem. Signed-off-by: Pete Wyckoff <pw@padd.com> Acked-By: Tor Arvid Lund <torarvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-02-21git-p4: reinterpret confusing p4 messagePete Wyckoff
Error output will look like this: glom$ git p4 clone //deopt Importing from //deopt into . Reinitialized existing Git repository in /tmp/x/.git/ Doing initial import of //deopt from revision #head into refs/remotes/p4/master p4 returned an error: //deopt/... - must refer to client glom. This particular p4 error is misleading. Perhaps the depot path was misspelled. Depot path: //deopt Signed-off-by: Pete Wyckoff <pw@padd.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-02-21git-p4: accommodate new move/delete type in p4Pete Wyckoff
562d53f (git-p4: Fix sync errors due to new server version, 2010-01-21) taught git-p4 sync to recognize the new move/delete type, but this type can also show up in an initial clone and labels output. Instead of replicating the support in three places, hoist the definition somewhere global. Signed-off-by: Pete Wyckoff <pw@padd.com> Acked-By: Tor Arvid Lund <torarvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-02-21git-p4: add missing newline in initial import messagePete Wyckoff
Signed-off-by: Pete Wyckoff <pw@padd.com> Acked-By: Tor Arvid Lund <torarvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-02-21git-p4: fix key error for p4 problemPete Wyckoff
Some p4 failures result in an error, but the info['code'] is not set. These include a bad p4 executable, or a core dump from p4, and other odd internal errors where p4 fails to generate proper marshaled output. Make sure the info key exists before using it to avoid a python traceback. Signed-off-by: Pete Wyckoff <pw@padd.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-02-14Obey p4 views when using client specIan Wienand
When using the p4 client spec, this attempts to obey the client's output preferences. For example, a view like //depot/foo/branch/... //client/branch/foo/... //depot/bar/branch/... //client/branch/bar/... will result in a directory layout in the git tree of branch/ branch/foo branch/bar p4 can do various other reordering that this change doesn't support, but we should detect it and at least fail nicely. Signed-off-by: Ian Wienand <ianw@vmware.com> Acked-by: Pete Wyckoff <pw@padd.com> Acked-by: Tor Arvid Lund <torarvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-02-12Merge branch 'maint'Junio C Hamano
* maint: Git 1.7.4.1 clone: fixup recurse_submodules option svn-fe: warn about experimental status Conflicts: contrib/examples/git-revert.sh contrib/svn-fe/svn-fe.txt
2011-02-11svn-fe: warn about experimental statusJonathan Nieder
svn-fe is young and some coming cleanups might involve backward incompatible UI changes. Add some words of warning to the manual so early adopters that are not following the project closely don't get burned. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-02-10Merge branch 'jn/cherry-pick-strategy-option'Junio C Hamano
* jn/cherry-pick-strategy-option: cherry-pick/revert: add support for -X/--strategy-option
2011-02-07post-receive-email: suppress error if description file missingSitaram Chamarty
Signed-off-by: Sitaram Chamarty <sitaramc@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-12-28cherry-pick/revert: add support for -X/--strategy-optionJonathan Nieder
For example, this would allow cherry-picking or reverting patches from a piece of history with a different end-of-line style, like so: $ git revert -Xrenormalize old-problematic-commit Currently that is possible with manual use of merge-recursive but the cherry-pick/revert porcelain does not expose the functionality. While at it, document the existing support for --strategy. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-12-22Merge branch 'pd/bash-4-completion'Junio C Hamano
* pd/bash-4-completion: bash: simple reimplementation of _get_comp_words_by_ref bash: get --pretty=m<tab> completion to work with bash v4 Conflicts: contrib/completion/git-completion.bash
2010-12-21Merge branch 'tc/completion-reflog'Junio C Hamano
* tc/completion-reflog: bash completion: add basic support for git-reflog
2010-12-21completion: add missing configuration variablesMartin von Zweigbergk
Quite a few configuration variables have been added since 226b343 (completion: add missing configuration variables to _git_config(), 2009-05-03). Add these variables to the Bash completion script. Also remove the obsolete 'add.ignore-errors' and 'color.grep.external', as well as 'diff.renameLimit.', which never existed and rename the misspelled 'sendemail.aliasesfiletype'. Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com> Acked-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-12-17bash completion: add basic support for git-reflogTay Ray Chuan
"Promote" the reflog command out of plumbing, so that we now run completion for it. After all, it's listed under porcelain (ancillary), and we do run completion for those commands. Add basic completion for the three subcommands - show, expire, delete. Try completing refs for these too. Helped-by: SZEDER Gábor <szeder@ira.uka.de> Signed-off-by: Tay Ray Chuan <rctay89@gmail.com> Reviewed-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-12-15Merge branch 'master' (early part) into pd/bash-4-completionJonathan Nieder
* 'master' (early part): (529 commits) completion: fix zsh check under bash with 'set -u' Fix copy-pasted comments related to tree diff handling. Git 1.7.3.2 {cvs,svn}import: use the new 'git read-tree --empty' t/t9001-send-email.sh: fix stderr redirection in 'Invalid In-Reply-To' Clarify and extend the "git diff" format documentation git-show-ref.txt: clarify the pattern matching documentation: git-config minor cleanups Update test script annotate-tests.sh to handle missing/extra authors Better advice on using topic branches for kernel development Documentation: update implicit "--no-index" behavior in "git diff" Documentation: expand 'git diff' SEE ALSO section Documentation: diff can compare blobs Documentation: gitrevisions is in section 7 fast-import: Allow filemodify to set the root shell portability: no "export VAR=VAL" CodingGuidelines: reword parameter expansion section Documentation: update-index: -z applies also to --index-info gitweb: Improve behavior for actionless path_info gitweb URLs gitweb: Fix bug in evaluate_path_info ... Conflicts: GIT-VERSION-GEN RelNotes contrib/completion/git-completion.bash