summaryrefslogtreecommitdiff
path: root/contrib
AgeCommit message (Collapse)Author
2013-10-13mergetools/diffmerge: support DiffMerge as a git mergetoolStefan Saasen
DiffMerge is a non-free (but gratis) tool that supports OS X, Windows and Linux. See http://www.sourcegear.com/diffmerge/ DiffMerge includes a script `/usr/bin/diffmerge` that can be used to launch the graphical compare tool. This change adds mergetool support for DiffMerge and adds 'diffmerge' as an option to the mergetool help. Signed-off-by: Stefan Saasen <ssaasen@atlassian.com> Acked-by: David Aguilar <davvid@gmail.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
2013-10-08Merge branch 'tz/credential-netrc'Jonathan Nieder
* tz/credential-netrc: git-credential-netrc: fix uninitialized warning
2013-10-08git-credential-netrc: fix uninitialized warningTed Zlatanov
Simple patch to avoid unitialized warning and log what we'll do. Signed-off-by: Ted Zlatanov <tzz@lifelogs.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
2013-09-26contrib: remove ciabotStefan Beller
Almost a year ago the CIA service irrevocably crashed. The CIA author had plans to revive the service, but the effort has since sunk without trace. Projects tend to use "irker" instead these days. Repository hook scripts for irker ship with the irker distribution. Signed-off-by: Stefan Beller <stefanbeller@googlemail.com> Acked-by: Eric S. Raymond <esr@thyrsus.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
2013-09-25Merge branch 'sg/complete-untracked-filter'Jonathan Nieder
* sg/complete-untracked-filter: completion: improve untracked directory filtering for filename completion
2013-09-25Merge branch 'es/contacts-in-subdir'Jonathan Nieder
* es/contacts-in-subdir: contacts: fix to work in subdirectories
2013-09-25Merge branch 'maint'Jonathan Nieder
* maint: git-remote-mediawiki: bugfix for pages w/ >500 revisions
2013-09-24git-remote-mediawiki: bugfix for pages w/ >500 revisionsBenoit Person
Mediawiki introduces a new API for queries w/ more than 500 results in version 1.21. That change triggered an infinite loop while cloning a mediawiki with such a page. The latest API renamed and moved the "continuing" information in the response, necessary to build the next query. The code failed to retrieve that information but still detected that it was in a "continuing query". As a result, it launched the same query over and over again. If a "continuing" information is detected in the response (old or new), the next query is updated accordingly. If not, we quit assuming it's not a continuing query. Reported-by: Benjamin Cathey Signed-off-by: Benoit Person <benoit.person@gmail.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
2013-09-19completion: improve untracked directory filtering for filename completionSZEDER Gábor
Similar to Bash's default filename completion, our git-aware filename completion stops at directory boundaries, i.e. it doesn't offer the full 'path/to/file' at first, but only 'path/'. To achieve that the completion script runs 'git ls-files' with specific command line options to get the list of relevant paths under the current directory, and then processes each path to strip all but the base directory or filename (see __git_index_files()). To offer only modified and untracked files for 'git add' the completion script runs 'git ls-files --exclude-standard --others --modified'. This command lists all non-ignored files in untracked directories, which leads to a noticeable delay caused by the processing mentioned above if there are a lot of such files (__git_index_files() specifies '--exclude-standard' internally): $ mkdir untracked-dir $ for i in {1..10000} ; do >untracked-dir/$i ; done $ time __git_index_files "--others --modified" untracked-dir real 0m0.537s user 0m0.452s sys 0m0.160s Eliminate this delay by additionally passing the '--directory --no-empty-directory' options to 'git ls-files' to show only the directory name of non-empty untracked directories instead their whole content: $ time __git_index_files "--others --modified --directory --no-empty-directory" untracked-dir real 0m0.029s user 0m0.020s sys 0m0.004s Filename completion for 'git clean' suffers from the same delay, as it offers untracked files, too. The fix could be the same, but since it actually makes sense to 'git clean' empty directories, in this case we only pass the '--directory' option to 'git ls-files'. Reported-by: Isaac Levy <ilevy@google.com> Signed-off-by: SZEDER Gábor <szeder@ira.uka.de> Reviewed-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-09-18Merge branch 'fc/contrib-bzr-hg-fixes'Junio C Hamano
* fc/contrib-bzr-hg-fixes: contrib/remote-helpers: quote variable references in redirection targets contrib/remote-helpers: style updates for test scripts remote-hg: use notes to keep track of Hg revisions remote-helpers: cleanup more global variables remote-helpers: trivial style fixes remote-hg: improve basic test remote-hg: add missing &&s in the test remote-hg: fix test remote-bzr: make bzr branches configurable per-repo remote-bzr: fix export of utf-8 authors
2013-09-18contacts: fix to work in subdirectoriesEric Sunshine
Unlike other git commands which work correctly at the top-level or in a subdirectory, git-contacts fails when invoked in a subdirectory. This is because it invokes git-blame with pathnames relative to the top-level, but git-blame interprets the pathnames as relative to the current directory. Fix this. Signed-off-by: Eric Sunshine <sunshine@sunshineco.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-09-17Merge branch 'rh/ishes-doc'Junio C Hamano
We liberally use "committish" and "commit-ish" (and "treeish" and "tree-ish"); as these are non-words, let's unify these terms to their dashed form. More importantly, clarify the documentation on object peeling using these terms. * rh/ishes-doc: glossary: fix and clarify the definition of 'ref' revisions.txt: fix and clarify <rev>^{<type>} glossary: more precise definition of tree-ish (a.k.a. treeish) use 'commit-ish' instead of 'committish' use 'tree-ish' instead of 'treeish' glossary: define commit-ish (a.k.a. committish) glossary: mention 'treeish' as an alternative to 'tree-ish'
2013-09-12Merge branch 'mm/mediawiki-dumb-push-fix'Junio C Hamano
* mm/mediawiki-dumb-push-fix: git-remote-mediawiki: no need to update private ref in non-dumb push git-remote-mediawiki: use no-private-update capability on dumb push transport-helper: add no-private-update capability git-remote-mediawiki: add test and check Makefile targets
2013-09-11Merge branch 'jn/post-receive-utf8'Junio C Hamano
Update post-receive-email script to make sure the message contents and pathnames are encoded consistently in UTF-8. * jn/post-receive-utf8: hooks/post-receive-email: set declared encoding to utf-8 hooks/post-receive-email: force log messages in UTF-8 hooks/post-receive-email: use plumbing instead of git log/show
2013-09-09Merge branch 'es/contacts-blame-L-multi'Junio C Hamano
* es/contacts-blame-L-multi: contacts: reduce git-blame invocations contacts: gather all blame sources prior to invoking git-blame contacts: validate hunk length earlier
2013-09-08remote-bzr: reuse bzrlib transports when possibleRichard Hansen
Pass a list of open bzrlib.transport.Transport objects to each bzrlib function that might create a transport. This enables bzrlib to reuse existing transports when possible, avoiding multiple concurrent connections to the same remote server. If the remote server is accessed via ssh, this fixes a couple of problems: * If the user does not have keys loaded into an ssh agent, the user may be prompted for a password multiple times. * If the user is using OpenSSH and the ControlMaster setting is set to auto, git-remote-bzr might hang. This is because bzrlib closes the multiple ssh sessions in an undefined order and might try to close the master ssh session before the other sessions. The master ssh process will not exit until the other sessions have exited, causing a deadlock. (The ssh sessions are closed in an undefined order because bzrlib relies on the Python garbage collector to trigger ssh session termination.) Signed-off-by: Richard Hansen <rhansen@bbn.com> Acked-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-09-04use 'commit-ish' instead of 'committish'Richard Hansen
Replace 'committish' in documentation and comments with 'commit-ish' to match gitglossary(7) and to be consistent with 'tree-ish'. The only remaining instances of 'committish' are: * variable, function, and macro names * "(also committish)" in the definition of commit-ish in gitglossary[7] Signed-off-by: Richard Hansen <rhansen@bbn.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-09-04Merge branch 'fc/remote-hg-shared-setup'Junio C Hamano
* fc/remote-hg-shared-setup: remote-hg: add shared repo upgrade remote-hg: ensure shared repo is initialized
2013-09-04Merge branch 'ap/remote-hg-tilde-is-home-directory'Junio C Hamano
* ap/remote-hg-tilde-is-home-directory: remote-hg: fix path when cloning with tilde expansion
2013-09-03git-remote-mediawiki: no need to update private ref in non-dumb pushMatthieu Moy
We used to update the private ref ourselves, but this update is now done by default since 664059fb (transport-helper: update remote helper namespace, 2013-04-17). Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-09-03git-remote-mediawiki: use no-private-update capability on dumb pushMatthieu Moy
Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-09-03contrib/remote-helpers: quote variable references in redirection targetsJunio C Hamano
Even though it is not required by POSIX to double-quote the redirection target in a variable, our code does so because some versions of bash issue a warning without the quotes. Reviewed-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-09-03contrib/remote-helpers: style updates for test scriptsJunio C Hamano
During the review of the main series it was noticed that these test scripts can use updates to conform to our coding style better, but fixing the style should be done in a patch separate from the main series. This updates the test-*.sh scripts only for style issues: * We do not leave SP between a redirection operator and the filename; * We change line before "then", "do", etc. rather than terminating the condition for "if"/"while" and list for "for" with a semicolon; * When HERE document does not use any expansion, we quote the end marker (e.g. "cat <<\EOF" not "cat <<EOF") to signal the readers that there is no funny substitution to worry about when reading the code. * We use "test" rather than "[". Reviewed-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-08-30remote-hg: use notes to keep track of Hg revisionsFelipe Contreras
Keep track of Mercurial revisions as Git notes under the 'refs/notes/hg' ref. This way, the user can easily see which Mercurial revision corresponds to certain Git commit. Unfortunately, there's no way to efficiently update the notes after doing an export (push), so they'll have to be updated when importing (fetching). Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-08-30Merge branch 'bc/completion-for-bash-3.0'Junio C Hamano
Some people still use rather old versions of bash, which cannot grok some constructs like 'printf -v varname' the prompt and completion code started to use recently. * bc/completion-for-bash-3.0: contrib/git-prompt.sh: handle missing 'printf -v' more gracefully t9902-completion.sh: old Bash still does not support array+=('') notation git-completion.bash: use correct Bash/Zsh array length syntax
2013-08-30Merge branch 'mm/war-on-whatchanged'Junio C Hamano
* mm/war-on-whatchanged: whatchanged: document its historical nature core-tutorial: trim the section on Inspecting Changes
2013-08-29git-remote-mediawiki: add test and check Makefile targetsMatthieu Moy
There are a few level 4 and 2 perlcritic issues in the current code. We make level 5 fatal, and keep level 2 as warnings. Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-08-29remote-helpers: cleanup more global variablesFelipe Contreras
They don't need to be specified if they are not going to be set. Suggested-by: Dusty Phillips <dusty@linux.ca> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-08-29remote-helpers: trivial style fixesFelipe Contreras
In accordance with pep8. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-08-29remote-hg: improve basic testFelipe Contreras
It appears 'let' is not present in all shells. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-08-29remote-hg: add missing &&s in the testFelipe Contreras
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-08-29remote-hg: fix testFelipe Contreras
It wasn't being checked properly before; those refs never existed. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-08-29remote-bzr: make bzr branches configurable per-repoFelipe Contreras
Different repositories have different branches, some are are even branches themselves. Reported-by: Peter Niederlag <netservice@niekom.de> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-08-29remote-bzr: fix export of utf-8 authorsFelipe Contreras
Reported-by: Joakim Verona <joakim@verona.se> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-08-22contrib/git-prompt.sh: handle missing 'printf -v' more gracefullyBrandon Casey
Old Bash (3.0) which is distributed with RHEL 4.X and other ancient platforms that are still in wide use, do not have a printf that supports -v. Neither does Zsh (which is already handled in the code). As suggested by Junio, let's test whether printf supports the -v option and store the result. Then later, we can use it to determine whether 'printf -v' can be used, or whether printf must be called in a subshell. Signed-off-by: Brandon Casey <drafnel@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-08-21git-completion.bash: use correct Bash/Zsh array length syntaxBrandon Casey
The syntax for retrieving the number of elements in an array is: ${#name[@]} Signed-off-by: Brandon Casey <drafnel@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-08-13git-remote-mediawiki: ignore generated git-mwMatthieu Moy
Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-08-13contacts: reduce git-blame invocationsEric Sunshine
git-contacts invokes git-blame once for each patch hunk it encounters. No attempt is made to consolidate invocations for multiple hunks referencing the same file at the same revision. This can become expensive quickly. Reduce the number of git-blame invocations by taking advantage of the ability to specify multiple -L ranges for a single invocation. Without this patch, on a randomly chosen range of commits: % time git-contacts 25fba78d36be6297^..23c339c0f262aad2 >/dev/null real 0m6.142s user 0m5.429s sys 0m0.356s With this patch: % time git-contacts 25fba78d36be6297^..23c339c0f262aad2 >/dev/null real 0m2.285s user 0m2.093s sys 0m0.165s Signed-off-by: Eric Sunshine <sunshine@sunshineco.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-08-13contacts: gather all blame sources prior to invoking git-blameEric Sunshine
git-contacts invokes git-blame immediately upon encountering a patch hunk. No attempt is made to consolidate invocations for multiple hunks referencing the same file at the same revision. This can become expensive quickly. Any effort to reduce the number of times git-blame is run will need to to know in advance which line ranges to blame per file per revision. Make this information available by collecting all sources as a distinct step from invoking git-blame. A subsequent patch will utilize the information to optimize git-blame invocations. Signed-off-by: Eric Sunshine <sunshine@sunshineco.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-08-13contacts: validate hunk length earlierEric Sunshine
Rather than calling get_blame() with a zero-length hunk only to have it rejected immediately, perform hunk-length validation earlier in order to avoid calling get_blame() unnecessarily. This is a preparatory step to simplify later patches which reduce the number of git-blame invocations by collecting together all lines to blame within a single file at a particular revision. By validating the blame range early, the subsequent patch can more easily avoid adding empty ranges at collection time. Signed-off-by: Eric Sunshine <sunshine@sunshineco.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-08-13core-tutorial: trim the section on Inspecting ChangesJunio C Hamano
Back when the core tutorial was written, `log` and `whatchanged` were scripted Porcelains. In the "Inspecting Changes" section that talks about the plumbing commands in the diff family, it made sense to use `log` and `whatchanged` as good examples of the use of these plumbing commands, and because even these scripted Porcelains were novelty (there wasn't the new end-user tutorial written), it made some sense to illustrate uses of the `git log` (and `git whatchanged`) scripted Porcelain commands. But we no longer have scripted `log` and `whatchanged` to serve as examples, and this document is not where the end users learn what `git log` command is about. Stop at briefly mentioning the possibility of combining rev-list with diff-tree to build your own log, and leave the end-user documentation of `log` to the new tutorial and the user manual. Also resurrect the last version of `git-log`, `git-whatchanged`, and `git-show` to serve as examples to contrib/examples/ directory. While at it, remove 'whatchanged' from a list of sample commands that are affected by GIT_FLUSH environment variable. This is not meant to be an exhaustive list but as a list of typical ones, and an old command that is kept primarily for backward compatibility does not belong to it. Helped-by: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-08-12remote-hg: add shared repo upgradeFelipe Contreras
If we have an old organization (v1.8.3), and want to upgrade to a newer one (v1.8.4), the user would have to fetch the whole repository, instead we can just move the repository, so the user would not notice any difference. Also, remove other clones, so in time they get set up as shared. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Reviewed-by: Antoine Pelisse <apelisse@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-08-12remote-hg: ensure shared repo is initializedFelipe Contreras
6796d49 (remote-hg: use a shared repository store) introduced a bug by making the shared repository '.git/hg', which is already used before that patch, so clones that happened before that patch, fail after that patch, because there's no shared Mercurial repo. So, instead of simply checking if the directory exists, let's always try to create an empty shared repository to ensure it's there. This works because we don't need the initial clone, if the repository is shared, pulling from the child updates the parent's storage; it's exactly the same as cloning, so we can simplify the shared repo setup this way while at the same time fixing the problem. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Reviewed-by: Antoine Pelisse <apelisse@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-08-09remote-hg: fix path when cloning with tilde expansionAntoine Pelisse
The current code fixes the path to make it absolute when cloning, but doesn't consider tilde expansion, so that scenario fails throwing an exception because /home/myuser/~/my/repository doesn't exists: $ git clone hg::~/my/repository && cd repository && git fetch Expand the tilde when checking if the path is absolute, so that we don't fix a path that doesn't need to be. Signed-off-by: Antoine Pelisse <apelisse@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-08-05hooks/post-receive-email: set declared encoding to utf-8Gerrit Pape
Some email clients (e.g., claws-mail) display the message body incorrectly when the charset is not defined explicitly in a Content-Type header. "git log" generates logs in UTF-8 encoding by default, so add a Content-Type header declaring that encoding to the emails the post-receive-email example hook sends. [jn: also setting the Content-Transfer-Encoding so MTAs know what kind of mangling might be needed when sending to a non 8-bit clean SMTP host] Requested-by: Alexander Gerasiov <gq@debian.org> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-08-05hooks/post-receive-email: force log messages in UTF-8Jonathan Nieder
Git commands write commit messages in UTF-8 by default, but that default can be overridden by the [i18n] commitEncoding and logOutputEncoding settings. With such a setting, the emails written by the post-receive-email hook use a mixture of encodings: 1. Log messages use the configured log output encoding, which is meant to be whatever encoding works best with local terminals (and does not have much to do with what encoding should be used for email) 2. Filenames are left as is: on Linux, usually UTF-8, and in the Mingw port (which uses Unicode filesystem APIs), always UTF-8 3. The "This is an automated email" preface uses a project description from .git/description, which is typically in UTF-8 to support gitweb. So (1) is configurable, and (2) and (3) are unconfigurable and typically UTF-8. Override the log output encoding to always use UTF-8 when writing the email to get the best chance of a comprehensible single-encoding email. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-08-05hooks/post-receive-email: use plumbing instead of git log/showJonathan Nieder
This way the hook doesn't have to keep being tweaked as porcelain learns new features like color and pagination. While at it, replace the "git rev-list | git shortlog" idiom with plain "git shortlog" for simplicity. Except for depending less on the value of settings like '[log] abbrevCommit', no change in output intended. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-08-02Merge branch 'rj/cygwin-clarify-use-of-cheating-lstat'Junio C Hamano
Cygwin port added a "not quite correct but a lot faster and good enough for many lstat() calls that are only used to see if the working tree entity matches the index entry" lstat() emulation some time ago, and it started biting us in places. This removes it and uses the standard lstat() that comes with Cygwin. Recent topic that uses lstat on packed-refs file is broken when this cheating lstat is used, and this is a simplest fix that is also the cleanest direction to go in the long run. * rj/cygwin-clarify-use-of-cheating-lstat: cygwin: Remove the Win32 l/stat() implementation
2013-08-01Merge branch 'ob/typofixes'Junio C Hamano
* ob/typofixes: many small typofixes
2013-08-01Merge branch 'ms/subtree-install-fix'Junio C Hamano
* ms/subtree-install-fix: contrib/subtree: Fix make install target