summaryrefslogtreecommitdiff
path: root/contrib
AgeCommit message (Collapse)AuthorFilesLines
2013-04-18Merge branch 'maint'Libravatar Junio C Hamano1-1/+2
* maint: remote-hg: fix commit messages
2013-04-18Merge branch 'fc/completion'Libravatar Junio C Hamano1-45/+33
In addition to a user visible change to offer more options to cherry-pick, generally cleans up and simplifies the code. * fc/completion: completion: small optimization completion: inline __gitcomp_1 to its sole callsite completion: get rid of compgen completion: add __gitcomp_nl tests completion: add new __gitcompadd helper completion: get rid of empty COMPREPLY assignments completion: trivial test improvement completion: add more cherry-pick options
2013-04-17remote-hg: fix commit messagesLibravatar Felipe Contreras1-1/+2
git fast-import expects an extra newline after the commit message data, but we are adding it only on hg-git compat mode, which is why the bidirectionality tests pass. We should add it unconditionally. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-15remote-bzr: fix prefix of tagsLibravatar Felipe Contreras1-3/+6
In the current transport-helper code, refs without namespaced refspecs don't work correctly, so let's always use them. Some people reported issues with 'git clone --mirror', and this fixes them, as well as possibly others. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-14completion: small optimizationLibravatar Felipe Contreras1-4/+4
No need to calculate a new $c with a space if we are not going to do anything it with it. There should be no functional changes, except that a word "foo " with no suffixes can't be matched. But $cur cannot have a space at the end anyway. So it's safe. Based on the code from SZEDER Gábor. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-14completion: inline __gitcomp_1 to its sole callsiteLibravatar Felipe Contreras1-15/+11
There is no point in calling a separate function that is only used in one place. Especially considering that there's no need to call compgen, and we traverse the words ourselves both in __gitcompadd, and __gitcomp_1. Let's squash the functions together, and traverse only once. This improves performance. For N number of words: == 1 == original: 0.002s new: 0.000s == 10 == original: 0.005s new: 0.001s == 100 == original: 0.009s new: 0.006s == 1000 == original: 0.027s new: 0.019s == 10000 == original: 0.163s new: 0.151s == 100000 == original: 1.555s new: 1.497s No functional changes. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-14completion: get rid of compgenLibravatar Felipe Contreras1-5/+10
The functionality we use from compgen is not much, we can do the same manually, with drastic improvements in speed, especially when dealing with only a few words. This patch also has the sideffect that brekage reported by Jeroen Meijer and SZEDER Gábor gets fixed because we no longer expand the resulting words. Here are some numbers filtering N amount of words: == 1 == original: 0.002s new: 0.000s == 10 == original: 0.002s new: 0.000s == 100 == original: 0.003s new: 0.002s == 1000 == original: 0.012s new: 0.011s == 10000 == original: 0.056s new: 0.066s == 100000 == original: 2.669s new: 0.622s If the results are not narrowed: == 1 == original: 0.002s new: 0.000s == 10 == original: 0.002s new: 0.001s == 100 == original: 0.004s new: 0.004s == 1000 == original: 0.020s new: 0.015s == 10000 == original: 0.101s new: 0.355s == 100000 == original: 2.850s new: 31.941s So, unless 'git checkout <tab>' usually gives you more than 10000 results, you'll get an improvement :) Other possible solutions perform better after 1000 words, but worst if less than that: COMPREPLY=($(awk -v cur="$3" -v pre="$2" -v suf="$4" '$0 ~ cur { print pre$0suf }' <<< "$1" )) COMPREPLY=($(printf -- "$2%s$4\n" $1 | grep "^$2$3")) Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-14completion: add new __gitcompadd helperLibravatar Felipe Contreras1-5/+8
The idea is to never touch the COMPREPLY variable directly. This allows other completion systems (i.e. zsh) to override __gitcompadd, and do something different instead. Also, this allows further optimizations down the line. There should be no functional changes. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-12test-bzr: portable shell and utf-8 strings for Mac OSLibravatar Torsten Bögershausen1-19/+19
Make the shell script more portable: - Split export X=Y into 2 lines - Use printf instead of echo -e Use UTF-8 code points which are not decomposed by the filesystem: Code points like "á" will be decomposed by Mac OS X. bzr is unable to find the file "á" on disk. Use code points from unicode which can not be decomposed. In other words, the precompsed form use the same bytes as decomposed. Signed-off-by: Torsten Bögershausen <tboegi@web.de> Acked-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-12Sync with 'maint'Libravatar Junio C Hamano5-15/+15
* maint: Correct common spelling mistakes in comments and tests kwset: fix spelling in comments precompose-utf8: fix spelling of "want" in error message compat/nedmalloc: fix spelling in comments compat/regex: fix spelling and grammar in comments obstack: fix spelling of similar contrib/subtree: fix spelling of accidentally git-remote-mediawiki: spelling fixes doc: various spelling fixes fast-export: fix argument name in error messages Documentation: distinguish between ref and offset deltas in pack-format i18n: make the translation of -u advice in one go
2013-04-12contrib/subtree: fix spelling of accidentallyLibravatar Stefano Lattarini1-1/+1
Noticed with Lucas De Marchi's codespell tool. Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Acked-by: Matthieu Moy <Matthieu.Moy@imag.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-12git-remote-mediawiki: spelling fixesLibravatar Stefano Lattarini4-14/+14
Most of these were found using Lucas De Marchi's codespell tool. Others were pointed out by Eric Sunshine. Helped-by: Eric Sunshine <sunshine@sunshineco.com> Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Acked-by: Matthieu Moy <Matthieu.Moy@imag.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-12completion: get rid of empty COMPREPLY assignmentsLibravatar Felipe Contreras1-21/+0
There's no functional reason for those, the only purpose they are supposed to serve is to say "we don't provide any words here", but even for that it's not used consistently. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-12completion: add more cherry-pick optionsLibravatar Felipe Contreras1-1/+6
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-08remote-bzr: improve tag handlingLibravatar Felipe Contreras1-9/+16
revision_history() is deprecated and doesn't do what we want (revno instead of dotted_revno?). Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-08remote-bzr: fix utf-8 support for fetchingLibravatar Christophe Simonis2-9/+19
The previous patches didn't deal with all the scenarios. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-07Sync with 1.8.2.1Libravatar Junio C Hamano1-1/+1
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-07Merge branch 'fc/remote-helpers-test-updates'Libravatar Junio C Hamano3-16/+2
* fc/remote-helpers-test-updates: remote-hg: fix hg-git test-case remote-bzr: remove stale check code for tests remote-helpers: fix the run of all tests remote-bzr: avoid echo -n
2013-04-07Sync with 1.8.1.6Libravatar Junio C Hamano1-1/+1
2013-04-07remote-helpers/test-bzr.sh: do not use "grep '\s'"Libravatar Torsten Bögershausen1-1/+1
Using grep "devel\s\+3:" to find at least one whitspace is not portable on all grep versions; not all grep versions understand "\s" as a "whitespace". Use a literal TAB followed by SPACE. The + as a qualifier for "one or more" is not a basic regular expression; use egrep instead of grep. Signed-off-by: Torsten Bögershausen <tboegi@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-07remote-bzr: add utf-8 support for pushingLibravatar Felipe Contreras2-0/+37
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-07remote-bzr: add utf-8 support for fetchingLibravatar Timotheus Pokorra2-2/+27
[fc: added tests] Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-07remote-bzr: avoid unreferred tagsLibravatar Felipe Contreras1-0/+4
They have no content, there's nothing we can do with them. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-07remote-bzr: only update workingtree on local reposLibravatar Felipe Contreras1-2/+1
Apparently, that's the only way it's possible. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-07remote-bzr: set author if availableLibravatar David Engster2-1/+21
[fc: added tests] Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-07remote-bzr: remove files before modificationsLibravatar Christophe Simonis1-2/+2
Allow re-add of a deleted file in the same commit. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-07remote-bzr: fix directory renamingLibravatar Christophe Simonis2-1/+31
Git does not handle directories, renaming a directory is renaming every files in this directory. [fc: added tests] Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-04Sync with maintLibravatar Junio C Hamano1-1/+1
* maint: mailmap: update Pasky's address git-remote-mediawiki: new wiki URL in documentation
2013-04-04git-remote-mediawiki: new wiki URL in documentationLibravatar Matthieu Moy1-1/+1
The Bibzball wiki is not maintained anymore. Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-04remote-hg: fix hg-git test-caseLibravatar Felipe Contreras1-1/+0
There was some lingering code that shouldn't have been there in the first place. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-04remote-bzr: remove stale check code for testsLibravatar Felipe Contreras1-14/+0
The fastimport plugin was only required in the early stage of development. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-04remote-helpers: fix the run of all testsLibravatar Felipe Contreras1-0/+1
We don't need to check for duplicate test numbers, we don't have them, and either way test-lint-duplicates doesn't work in this situation. Also, while we are on it, enable test-lint-shell-syntax to check for sh errors. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-04remote-bzr: avoid echo -nLibravatar Felipe Contreras1-1/+1
It's not portable, as reported by test-lint. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-03Merge branch 'rr/prompt-revert-head'Libravatar Junio C Hamano1-0/+2
The prompt string generator did not notice when we are in a middle of a "git revert" session. * rr/prompt-revert-head: bash: teach __git_ps1 about REVERT_HEAD
2013-04-01Merge branch 'da/downcase-u-in-usage' into maintLibravatar Junio C Hamano10-62/+62
* da/downcase-u-in-usage: contrib/mw-to-git/t/install-wiki.sh: use a lowercase "usage:" string contrib/examples/git-remote.perl: use a lowercase "usage:" string tests: use a lowercase "usage:" string git-svn: use a lowercase "usage:" string Documentation/user-manual.txt: use a lowercase "usage:" string templates/hooks--update.sample: use a lowercase "usage:" string contrib/hooks/setgitperms.perl: use a lowercase "usage:" string contrib/examples: use a lowercase "usage:" string contrib/fast-import/import-zips.py: use spaces instead of tabs contrib/fast-import/import-zips.py: fix broken error message contrib/fast-import: use a lowercase "usage:" string contrib/credential: use a lowercase "usage:" string git-cvsimport: use a lowercase "usage:" string git-cvsimport: use a lowercase "usage:" string git-cvsexportcommit: use a lowercase "usage:" string git-archimport: use a lowercase "usage:" string git-merge-one-file: use a lowercase "usage:" string git-relink: use a lowercase "usage:" string git-svn: use a lowercase "usage:" string git-sh-setup: use a lowercase "usage:" string
2013-03-31bash: teach __git_ps1 about REVERT_HEADLibravatar Robin Rosenberg1-0/+2
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-03-25Merge branch 'jl/submodule-deinit'Libravatar Junio C Hamano1-1/+1
There was no Porcelain way to say "I no longer am interested in this submodule", once you express your interest in a submodule with "submodule init". "submodule deinit" is the way to do so. * jl/submodule-deinit: submodule: add 'deinit' command
2013-03-21Merge branch 'tz/credential-authinfo'Libravatar Junio C Hamano4-0/+545
A new read-only credential helper (in contrib/) to interact with the .netrc/.authinfo files. Hopefully mn/send-email-authinfo topic can rebuild on top of something like this. * tz/credential-authinfo: Add contrib/credentials/netrc with GPG support
2013-03-19Merge branch 'da/downcase-u-in-usage'Libravatar Junio C Hamano10-62/+62
* da/downcase-u-in-usage: contrib/mw-to-git/t/install-wiki.sh: use a lowercase "usage:" string contrib/examples/git-remote.perl: use a lowercase "usage:" string tests: use a lowercase "usage:" string git-svn: use a lowercase "usage:" string Documentation/user-manual.txt: use a lowercase "usage:" string templates/hooks--update.sample: use a lowercase "usage:" string contrib/hooks/setgitperms.perl: use a lowercase "usage:" string contrib/examples: use a lowercase "usage:" string contrib/fast-import/import-zips.py: use spaces instead of tabs contrib/fast-import/import-zips.py: fix broken error message contrib/fast-import: use a lowercase "usage:" string contrib/credential: use a lowercase "usage:" string git-cvsimport: use a lowercase "usage:" string git-cvsimport: use a lowercase "usage:" string git-cvsexportcommit: use a lowercase "usage:" string git-archimport: use a lowercase "usage:" string git-merge-one-file: use a lowercase "usage:" string git-relink: use a lowercase "usage:" string git-svn: use a lowercase "usage:" string git-sh-setup: use a lowercase "usage:" string
2013-03-11Merge branch 'mp/complete-paths'Libravatar Junio C Hamano1-5/+11
* mp/complete-paths: git-completion.bash: zsh does not implement function redirection correctly
2013-03-11git-completion.bash: zsh does not implement function redirection correctlyLibravatar Matthieu Moy1-5/+11
A recent change added functions whose entire standard error stream is redirected to /dev/null using a construct that is valid POSIX.1 but is not widely used: funcname () { cd "$1" && run some command "$2" } 2>/dev/null Even though this file is "git-completion.bash", zsh completion support dot-sources it (instead of asking bash to grok it like tcsh completion does), and zsh does not implement this redirection correctly. With zsh, trying to complete an inexistant directory gave this: git add no-such-dir/__git_ls_files_helper:cd:2: no such file or directory: no-such-dir/ Also these functions use "cd" to first go somewhere else before running a command, but the location the caller wants them to go that is given as an argument to them should not be affected by CDPATH variable the users may have set for their interactive session. To fix both of these, wrap the body of the function in a subshell, unset CDPATH at the beginning of the subshell, and redirect the standard error stream of the subshell to /dev/null. Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-03-07Merge branch 'mp/complete-paths'Libravatar Junio C Hamano1-0/+9
* mp/complete-paths: git-completion.zsh: define __gitcomp_file compatibility function
2013-03-05git-completion.zsh: define __gitcomp_file compatibility functionLibravatar Matthieu Moy1-0/+9
Commit fea16b47b60 (Fri Jan 11 19:48:43 2013, Manlio Perillo, git-completion.bash: add support for path completion), introduced a new __gitcomp_file function that uses the bash builtin "compgen". The function was redefined for ZSH in the deprecated section of git-completion.bash, but not in the new git-completion.zsh script. As a result, users of git-completion.zsh trying to complete "git add fo<tab>" get an error: git add fo__gitcomp_file:8: command not found: compgen This patch adds the redefinition and removes the error. Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-03-04submodule: add 'deinit' commandLibravatar Jens Lehmann1-1/+1
With "git submodule init" the user is able to tell git he cares about one or more submodules and wants to have it populated on the next call to "git submodule update". But currently there is no easy way he could tell git he does not care about a submodule anymore and wants to get rid of his local work tree (except he knows a lot about submodule internals and removes the "submodule.$name.url" setting from .git/config together with the work tree himself). Help those users by providing a 'deinit' command. This removes the whole submodule.<name> section from .git/config (either for the given submodule(s) or for all those which have been initialized if '.' is used) together with their work tree. Fail if the current work tree contains modifications (unless forced), but don't complain when either the work tree is already removed or no settings are found in .git/config. Add tests and link the man pages of "git submodule deinit" and "git rm" to assist the user in deciding whether removing or unregistering the submodule is the right thing to do for him. Also add the deinit subcommand to the completion list. Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-02-26wincred: improve compatibility with windows versionsLibravatar Karsten Blees1-129/+70
On WinXP, the windows credential helper doesn't work at all (due to missing Cred[Un]PackAuthenticationBuffer APIs). On Win7, the credential format used by wincred is incompatible with native Windows tools (such as the control panel applet or 'cmdkey.exe /generic'). These Windows tools only set the TargetName, UserName and CredentialBlob members of the CREDENTIAL structure (where CredentialBlob is the UTF-16-encoded password). Remove the unnecessary packing / unpacking of the password, along with the related API definitions, for compatibility with Windows XP. Don't use CREDENTIAL_ATTRIBUTEs to identify credentials for compatibility with Windows credential manager tools. Parse the protocol, username, host and path fields from the credential's target name instead. Credentials created with an old wincred version will have mangled or empty passwords after this change. Signed-off-by: Karsten Blees <blees@dcon.de> Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
2013-02-26wincred: accept CRLF on stdin to simplify console usageLibravatar Karsten Blees1-2/+5
The windows credential helper currently only accepts LF on stdin, but bash and cmd.exe both send CRLF. This prevents interactive use in the console. Change the stdin parser to optionally accept CRLF. Signed-off-by: Karsten Blees <blees@dcon.de> Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
2013-02-25Add contrib/credentials/netrc with GPG supportLibravatar Ted Zlatanov4-0/+545
This credential helper supports multiple files, returning the first one that matches. It checks file permissions and owner. For *.gpg files, it will run GPG to decrypt the file. Signed-off-by: Ted Zlatanov <tzz@lifelogs.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-02-24contrib/mw-to-git/t/install-wiki.sh: use a lowercase "usage:" stringLibravatar David Aguilar1-1/+1
Make the usage string consistent with Git. Signed-off-by: David Aguilar <davvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-02-24contrib/examples/git-remote.perl: use a lowercase "usage:" stringLibravatar David Aguilar1-4/+4
Make the usage string consistent with Git. Signed-off-by: David Aguilar <davvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-02-24contrib/hooks/setgitperms.perl: use a lowercase "usage:" stringLibravatar David Aguilar1-1/+1
Make the usage string consistent with Git. Reviewed-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: David Aguilar <davvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>