Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'contrib')
-rw-r--r--contrib/completion/git-completion.bash61
-rw-r--r--contrib/credential/netrc/Makefile3
-rwxr-xr-xcontrib/credential/netrc/t-git-credential-netrc.sh9
-rwxr-xr-xcontrib/credential/netrc/test.pl5
-rw-r--r--contrib/git-jump/README12
-rwxr-xr-xcontrib/git-jump/git-jump2
6 files changed, 59 insertions, 33 deletions
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index bc31e8973b..94c95516eb 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -330,9 +330,32 @@ __gitcomp ()
case "$cur_" in
--*=)
;;
+ --no-*)
+ local c i=0 IFS=$' \t\n'
+ for c in $1; do
+ if [[ $c == "--" ]]; then
+ continue
+ fi
+ c="$c${4-}"
+ if [[ $c == "$cur_"* ]]; then
+ case $c in
+ --*=*|*.) ;;
+ *) c="$c " ;;
+ esac
+ COMPREPLY[i++]="${2-}$c"
+ fi
+ done
+ ;;
*)
local c i=0 IFS=$' \t\n'
for c in $1; do
+ if [[ $c == "--" ]]; then
+ c="--no-...${4-}"
+ if [[ $c == "$cur_"* ]]; then
+ COMPREPLY[i++]="${2-}$c "
+ fi
+ break
+ fi
c="$c${4-}"
if [[ $c == "$cur_"* ]]; then
case $c in
@@ -1161,7 +1184,7 @@ _git_am ()
return
;;
--*)
- __gitcomp_builtin am "--no-utf8" \
+ __gitcomp_builtin am "" \
"$__git_am_inprogress_options"
return
esac
@@ -1261,9 +1284,7 @@ _git_branch ()
__git_complete_refs --cur="${cur##--set-upstream-to=}"
;;
--*)
- __gitcomp_builtin branch "--no-color --no-abbrev
- --no-track --no-column
- "
+ __gitcomp_builtin branch
;;
*)
if [ $only_local_ref = "y" -a $has_r = "n" ]; then
@@ -1304,7 +1325,7 @@ _git_checkout ()
__gitcomp "diff3 merge" "" "${cur##--conflict=}"
;;
--*)
- __gitcomp_builtin checkout "--no-track --no-recurse-submodules"
+ __gitcomp_builtin checkout
;;
*)
# check if --track, --no-track, or --no-guess was specified
@@ -1367,7 +1388,7 @@ _git_clone ()
{
case "$cur" in
--*)
- __gitcomp_builtin clone "--no-single-branch"
+ __gitcomp_builtin clone
return
;;
esac
@@ -1400,7 +1421,7 @@ _git_commit ()
return
;;
--*)
- __gitcomp_builtin commit "--no-edit --verify"
+ __gitcomp_builtin commit
return
esac
@@ -1503,7 +1524,7 @@ _git_fetch ()
return
;;
--*)
- __gitcomp_builtin fetch "--no-tags"
+ __gitcomp_builtin fetch
return
;;
esac
@@ -1540,7 +1561,7 @@ _git_fsck ()
{
case "$cur" in
--*)
- __gitcomp_builtin fsck "--no-reflogs"
+ __gitcomp_builtin fsck
return
;;
esac
@@ -1646,7 +1667,7 @@ _git_ls_files ()
{
case "$cur" in
--*)
- __gitcomp_builtin ls-files "--no-empty-directory"
+ __gitcomp_builtin ls-files
return
;;
esac
@@ -1797,12 +1818,7 @@ _git_merge ()
case "$cur" in
--*)
- __gitcomp_builtin merge "--no-rerere-autoupdate
- --no-commit --no-edit --no-ff
- --no-log --no-progress
- --no-squash --no-stat
- --no-verify-signatures
- "
+ __gitcomp_builtin merge
return
esac
__git_complete_refs
@@ -1901,10 +1917,7 @@ _git_pull ()
return
;;
--*)
- __gitcomp_builtin pull "--no-autostash --no-commit --no-edit
- --no-ff --no-log --no-progress --no-rebase
- --no-squash --no-stat --no-tags
- --no-verify-signatures"
+ __gitcomp_builtin pull
return
;;
@@ -2095,7 +2108,7 @@ _git_status ()
return
;;
--*)
- __gitcomp_builtin status "--no-column"
+ __gitcomp_builtin status
return
;;
esac
@@ -2345,7 +2358,7 @@ _git_remote ()
case "$subcommand,$cur" in
add,--*)
- __gitcomp_builtin remote_add "--no-tags"
+ __gitcomp_builtin remote_add
;;
add,*)
;;
@@ -2425,7 +2438,7 @@ _git_revert ()
fi
case "$cur" in
--*)
- __gitcomp_builtin revert "--no-edit" \
+ __gitcomp_builtin revert "" \
"$__git_revert_inprogress_options"
return
;;
@@ -2495,7 +2508,7 @@ _git_show_branch ()
{
case "$cur" in
--*)
- __gitcomp_builtin show-branch "--no-color"
+ __gitcomp_builtin show-branch
return
;;
esac
diff --git a/contrib/credential/netrc/Makefile b/contrib/credential/netrc/Makefile
index 0ffa407191..6174e3bb83 100644
--- a/contrib/credential/netrc/Makefile
+++ b/contrib/credential/netrc/Makefile
@@ -1,3 +1,6 @@
+# The default target of this Makefile is...
+all::
+
test:
./t-git-credential-netrc.sh
diff --git a/contrib/credential/netrc/t-git-credential-netrc.sh b/contrib/credential/netrc/t-git-credential-netrc.sh
index 58191a62f8..07227d0228 100755
--- a/contrib/credential/netrc/t-git-credential-netrc.sh
+++ b/contrib/credential/netrc/t-git-credential-netrc.sh
@@ -17,15 +17,16 @@
# set up test repository
test_expect_success \
- 'set up test repository' \
- 'git config --add gpg.program test.git-config-gpg'
+ 'set up test repository' \
+ 'git config --add gpg.program test.git-config-gpg'
# The external test will outputs its own plan
test_external_has_tap=1
+ export PERL5LIB="$GITPERLLIB"
test_external \
- 'git-credential-netrc' \
- perl "$TEST_DIRECTORY"/../contrib/credential/netrc/test.pl
+ 'git-credential-netrc' \
+ perl "$GIT_BUILD_DIR"/contrib/credential/netrc/test.pl
test_done
)
diff --git a/contrib/credential/netrc/test.pl b/contrib/credential/netrc/test.pl
index 1e1001030e..c0fb3718b2 100755
--- a/contrib/credential/netrc/test.pl
+++ b/contrib/credential/netrc/test.pl
@@ -1,5 +1,4 @@
#!/usr/bin/perl
-use lib (split(/:/, $ENV{GITPERLLIB}));
use warnings;
use strict;
@@ -12,7 +11,6 @@ BEGIN {
# t-git-credential-netrc.sh kicks off our testing, so we have to go
# from there.
Test::More->builder->current_test(1);
- Test::More->builder->no_ending(1);
}
my @global_credential_args = @ARGV;
@@ -104,6 +102,9 @@ $cred = run_credential( ['-f', $netrcGpg, '-g', 'test.command-option-gpg', 'get'
ok(scalar keys %$cred == 2, 'Got keys decrypted by command option');
+my $is_passing = eval { Test::More->is_passing };
+exit($is_passing ? 0 : 1) unless $@ =~ /Can't locate object method/;
+
sub run_credential
{
my $args = shift @_;
diff --git a/contrib/git-jump/README b/contrib/git-jump/README
index 4484bda410..2f618a7f97 100644
--- a/contrib/git-jump/README
+++ b/contrib/git-jump/README
@@ -25,6 +25,13 @@ git-jump will feed this to the editor:
foo.c:2: printf("hello word!\n");
-----------------------------------
+Or, when running 'git jump grep', column numbers will also be emitted,
+e.g. `git jump grep "hello"` would return:
+
+-----------------------------------
+foo.c:2:9: printf("hello word!\n");
+-----------------------------------
+
Obviously this trivial case isn't that interesting; you could just open
`foo.c` yourself. But when you have many changes scattered across a
project, you can use the editor's support to "jump" from point to point.
@@ -35,7 +42,8 @@ Git-jump can generate four types of interesting lists:
2. The beginning of any merge conflict markers.
- 3. Any grep matches.
+ 3. Any grep matches, including the column of the first match on a
+ line.
4. Any whitespace errors detected by `git diff --check`.
@@ -82,7 +90,7 @@ which does something similar to `git jump grep`. However, it is limited
to positioning the cursor to the correct line in only the first file,
leaving you to locate subsequent hits in that file or other files using
the editor or pager. By contrast, git-jump provides the editor with a
-complete list of files and line numbers for each match.
+complete list of files, lines, and a column number for each match.
Limitations
diff --git a/contrib/git-jump/git-jump b/contrib/git-jump/git-jump
index 80ab0590bc..931b0fe3a9 100755
--- a/contrib/git-jump/git-jump
+++ b/contrib/git-jump/git-jump
@@ -52,7 +52,7 @@ mode_merge() {
# editor shows them to us in the status bar.
mode_grep() {
cmd=$(git config jump.grepCmd)
- test -n "$cmd" || cmd="git grep -n"
+ test -n "$cmd" || cmd="git grep -n --column"
$cmd "$@" |
perl -pe '
s/[ \t]+/ /g;