aboutsummaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
Diffstat (limited to 'contrib')
-rw-r--r--contrib/completion/git-completion.bash9
-rw-r--r--contrib/completion/git-prompt.sh7
-rw-r--r--contrib/credential/gnome-keyring/git-credential-gnome-keyring.c3
-rw-r--r--contrib/credential/libsecret/git-credential-libsecret.c3
-rw-r--r--contrib/emacs/git-blame.el5
-rw-r--r--contrib/emacs/git.el5
-rwxr-xr-xcontrib/fast-import/import-directories.perl3
-rw-r--r--contrib/git-jump/README10
-rwxr-xr-xcontrib/git-jump/git-jump7
-rwxr-xr-xcontrib/hg-to-git/hg-to-git.py3
-rw-r--r--contrib/mw-to-git/Git/Mediawiki.pm3
-rwxr-xr-xcontrib/mw-to-git/git-remote-mediawiki.perl38
12 files changed, 71 insertions, 25 deletions
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index fdd984d34..3683c772c 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -111,8 +111,7 @@ __git ()
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software Foundation,
-# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# along with this program; if not, see <http://www.gnu.org/licenses/>.
#
# The latest version of this software can be obtained here:
#
@@ -1205,7 +1204,7 @@ _git_branch ()
--color --no-color --verbose --abbrev= --no-abbrev
--track --no-track --contains --no-contains --merged --no-merged
--set-upstream-to= --edit-description --list
- --unset-upstream --delete --move --remotes
+ --unset-upstream --delete --move --copy --remotes
--column --no-column --sort= --points-at
"
;;
@@ -1401,7 +1400,7 @@ __git_diff_common_options="--stat --numstat --shortstat --summary
--patch-with-stat --name-only --name-status --color
--no-color --color-words --no-renames --check
--full-index --binary --abbrev --diff-filter=
- --find-copies-harder
+ --find-copies-harder --ignore-cr-at-eol
--text --ignore-space-at-eol --ignore-space-change
--ignore-all-space --ignore-blank-lines --exit-code
--quiet --ext-diff --no-ext-diff
@@ -1923,6 +1922,7 @@ _git_pull ()
--*)
__gitcomp "
--rebase --no-rebase
+ --autostash --no-autostash
$__git_merge_options
$__git_fetch_options
"
@@ -2642,6 +2642,7 @@ _git_config ()
sendemail.suppressfrom
sendemail.thread
sendemail.to
+ sendemail.tocmd
sendemail.validate
sendemail.smtpbatchsize
sendemail.smtprelogindelay
diff --git a/contrib/completion/git-prompt.sh b/contrib/completion/git-prompt.sh
index c6cbef38c..983e419d2 100644
--- a/contrib/completion/git-prompt.sh
+++ b/contrib/completion/git-prompt.sh
@@ -278,11 +278,12 @@ __git_ps1_colorize_gitstring ()
r="$c_clear$r"
}
+# Helper function to read the first line of a file into a variable.
+# __git_eread requires 2 arguments, the file path and the name of the
+# variable, in that order.
__git_eread ()
{
- local f="$1"
- shift
- test -r "$f" && read "$@" <"$f"
+ test -r "$1" && IFS=$'\r\n' read "$2" <"$1"
}
# __git_ps1 accepts 0 or 1 arguments (i.e., format string)
diff --git a/contrib/credential/gnome-keyring/git-credential-gnome-keyring.c b/contrib/credential/gnome-keyring/git-credential-gnome-keyring.c
index 2a317fca4..d389bfadc 100644
--- a/contrib/credential/gnome-keyring/git-credential-gnome-keyring.c
+++ b/contrib/credential/gnome-keyring/git-credential-gnome-keyring.c
@@ -13,8 +13,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
/*
diff --git a/contrib/credential/libsecret/git-credential-libsecret.c b/contrib/credential/libsecret/git-credential-libsecret.c
index b4750c9ee..e6598b638 100644
--- a/contrib/credential/libsecret/git-credential-libsecret.c
+++ b/contrib/credential/libsecret/git-credential-libsecret.c
@@ -14,8 +14,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
/*
diff --git a/contrib/emacs/git-blame.el b/contrib/emacs/git-blame.el
index e671f6c1c..510e0f710 100644
--- a/contrib/emacs/git-blame.el
+++ b/contrib/emacs/git-blame.el
@@ -25,9 +25,8 @@
;; PURPOSE. See the GNU General Public License for more details.
;; You should have received a copy of the GNU General Public
-;; License along with this program; if not, write to the Free
-;; Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
-;; MA 02111-1307 USA
+;; License along with this program; if not, see
+;; <http://www.gnu.org/licenses/>.
;; http://www.fsf.org/copyleft/gpl.html
diff --git a/contrib/emacs/git.el b/contrib/emacs/git.el
index 5ffc506f6..97919f2d7 100644
--- a/contrib/emacs/git.el
+++ b/contrib/emacs/git.el
@@ -15,9 +15,8 @@
;; PURPOSE. See the GNU General Public License for more details.
;;
;; You should have received a copy of the GNU General Public
-;; License along with this program; if not, write to the Free
-;; Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
-;; MA 02111-1307 USA
+;; License along with this program; if not, see
+;; <http://www.gnu.org/licenses/>.
;;; Commentary:
diff --git a/contrib/fast-import/import-directories.perl b/contrib/fast-import/import-directories.perl
index 4dec1f18e..a16f79cfd 100755
--- a/contrib/fast-import/import-directories.perl
+++ b/contrib/fast-import/import-directories.perl
@@ -14,8 +14,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+# along with this program; if not, see <http://www.gnu.org/licenses/>.
#
# ------------------------------------------------------------------------
diff --git a/contrib/git-jump/README b/contrib/git-jump/README
index 225e3f095..4484bda41 100644
--- a/contrib/git-jump/README
+++ b/contrib/git-jump/README
@@ -63,6 +63,9 @@ git jump grep foo_bar
# same as above, but case-insensitive; you can give
# arbitrary grep options
git jump grep -i foo_bar
+
+# use the silver searcher for git jump grep
+git config jump.grepCmd "ag --column"
--------------------------------------------------
@@ -92,3 +95,10 @@ how to activate it.
The shell snippets to generate the quickfix lines will almost certainly
choke on filenames with exotic characters (like newlines).
+
+Contributing
+------------
+
+Bug fixes, bug reports, and feature requests should be discussed on the
+Git mailing list <git@vger.kernel.org>, and cc'd to the git-jump
+maintainer, Jeff King <peff@peff.net>.
diff --git a/contrib/git-jump/git-jump b/contrib/git-jump/git-jump
index 427f206a4..80ab0590b 100755
--- a/contrib/git-jump/git-jump
+++ b/contrib/git-jump/git-jump
@@ -11,7 +11,8 @@ diff: elements are diff hunks. Arguments are given to diff.
merge: elements are merge conflicts. Arguments are ignored.
-grep: elements are grep hits. Arguments are given to grep.
+grep: elements are grep hits. Arguments are given to git grep or, if
+ configured, to the command in `jump.grepCmd`.
ws: elements are whitespace errors. Arguments are given to diff --check.
EOF
@@ -50,7 +51,9 @@ mode_merge() {
# but let's clean up extra whitespace, so they look better if the
# editor shows them to us in the status bar.
mode_grep() {
- git grep -n "$@" |
+ cmd=$(git config jump.grepCmd)
+ test -n "$cmd" || cmd="git grep -n"
+ $cmd "$@" |
perl -pe '
s/[ \t]+/ /g;
s/^ *//;
diff --git a/contrib/hg-to-git/hg-to-git.py b/contrib/hg-to-git/hg-to-git.py
index 60dec86d3..de3f81667 100755
--- a/contrib/hg-to-git/hg-to-git.py
+++ b/contrib/hg-to-git/hg-to-git.py
@@ -15,8 +15,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ along with this program; if not, see <http://www.gnu.org/licenses/>.
"""
import os, os.path, sys
diff --git a/contrib/mw-to-git/Git/Mediawiki.pm b/contrib/mw-to-git/Git/Mediawiki.pm
index d13c4dfa7..917d9e2d3 100644
--- a/contrib/mw-to-git/Git/Mediawiki.pm
+++ b/contrib/mw-to-git/Git/Mediawiki.pm
@@ -2,6 +2,7 @@ package Git::Mediawiki;
use 5.008;
use strict;
+use POSIX;
use Git;
BEGIN {
@@ -52,7 +53,7 @@ sub smudge_filename {
$filename =~ s/ /_/g;
# Decode forbidden characters encoded in clean_filename
$filename =~ s/_%_([0-9a-fA-F][0-9a-fA-F])/sprintf('%c', hex($1))/ge;
- return $filename;
+ return substr($filename, 0, NAME_MAX-length('.mw'));
}
sub connect_maybe {
diff --git a/contrib/mw-to-git/git-remote-mediawiki.perl b/contrib/mw-to-git/git-remote-mediawiki.perl
index e7f857c1a..af9cbc9d0 100755
--- a/contrib/mw-to-git/git-remote-mediawiki.perl
+++ b/contrib/mw-to-git/git-remote-mediawiki.perl
@@ -63,6 +63,11 @@ chomp(@tracked_pages);
my @tracked_categories = split(/[ \n]/, run_git("config --get-all remote.${remotename}.categories"));
chomp(@tracked_categories);
+# Just like @tracked_categories, but for MediaWiki namespaces.
+my @tracked_namespaces = split(/[ \n]/, run_git("config --get-all remote.${remotename}.namespaces"));
+for (@tracked_namespaces) { s/_/ /g; }
+chomp(@tracked_namespaces);
+
# Import media files on pull
my $import_media = run_git("config --get --bool remote.${remotename}.mediaimport");
chomp($import_media);
@@ -256,6 +261,32 @@ sub get_mw_tracked_categories {
return;
}
+sub get_mw_tracked_namespaces {
+ my $pages = shift;
+ foreach my $local_namespace (sort @tracked_namespaces) {
+ my $namespace_id;
+ if ($local_namespace eq "(Main)") {
+ $namespace_id = 0;
+ } else {
+ $namespace_id = get_mw_namespace_id($local_namespace);
+ }
+ # virtual namespaces don't support allpages
+ next if !defined($namespace_id) || $namespace_id < 0;
+ my $mw_pages = $mediawiki->list( {
+ action => 'query',
+ list => 'allpages',
+ apnamespace => $namespace_id,
+ aplimit => 'max' } )
+ || die $mediawiki->{error}->{code} . ': '
+ . $mediawiki->{error}->{details} . "\n";
+ print {*STDERR} "$#{$mw_pages} found in namespace $local_namespace ($namespace_id)\n";
+ foreach my $page (@{$mw_pages}) {
+ $pages->{$page->{title}} = $page;
+ }
+ }
+ return;
+}
+
sub get_mw_all_pages {
my $pages = shift;
# No user-provided list, get the list of pages from the API.
@@ -319,6 +350,10 @@ sub get_mw_pages {
$user_defined = 1;
get_mw_tracked_categories(\%pages);
}
+ if (@tracked_namespaces) {
+ $user_defined = 1;
+ get_mw_tracked_namespaces(\%pages);
+ }
if (!$user_defined) {
get_mw_all_pages(\%pages);
}
@@ -1308,7 +1343,8 @@ sub get_mw_namespace_id {
my $id;
if (!defined $ns) {
- print {*STDERR} "No such namespace ${name} on MediaWiki.\n";
+ my @namespaces = map { s/ /_/g; $_; } sort keys %namespace_id;
+ print {*STDERR} "No such namespace ${name} on MediaWiki, known namespaces: @namespaces\n";
$ns = {is_namespace => 0};
$namespace_id{$name} = $ns;
}