summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Documentation/RelNotes/1.7.4.txt62
-rw-r--r--Documentation/git-archive.txt2
-rw-r--r--Documentation/git-fast-import.txt7
-rw-r--r--Documentation/git-reset.txt9
-rw-r--r--Documentation/gitattributes.txt35
-rw-r--r--Documentation/githooks.txt4
-rwxr-xr-xGIT-VERSION-GEN2
-rw-r--r--builtin/commit.c4
-rw-r--r--builtin/remote-ext.c8
-rw-r--r--exec_cmd.c1
-rwxr-xr-xgit-submodule.sh16
-rwxr-xr-xgitweb/gitweb.perl23
-rw-r--r--ll-merge.c9
-rw-r--r--sha1_file.c2
-rw-r--r--t/lib-git-svn.sh38
-rwxr-xr-xt/t0000-basic.sh36
-rwxr-xr-xt/t3032-merge-recursive-options.sh5
-rwxr-xr-xt/t4018-diff-funcname.sh2
-rwxr-xr-xt/t6038-merge-text-auto.sh2
-rwxr-xr-xt/t7400-submodule-basic.sh38
-rwxr-xr-xt/t9010-svn-fe.sh35
-rwxr-xr-xt/t9157-git-svn-fetch-merge.sh2
-rw-r--r--t/test-lib.sh7
-rw-r--r--userdiff.c17
-rw-r--r--vcs-svn/svndump.c2
25 files changed, 239 insertions, 129 deletions
diff --git a/Documentation/RelNotes/1.7.4.txt b/Documentation/RelNotes/1.7.4.txt
index 055c1ca2b7..84d0e1dc13 100644
--- a/Documentation/RelNotes/1.7.4.txt
+++ b/Documentation/RelNotes/1.7.4.txt
@@ -15,7 +15,7 @@ Updates since v1.7.3
themselves. The name of a branch cannot begin with a dash now.
* System-wide fallback default attributes can be stored in
- /etc/gitattributes; core.attributesfile configuration variable can
+ /etc/gitattributes; the core.attributesfile configuration variable can
be used to customize the path to this file.
* The thread structure generated by "git send-email" has changed
@@ -25,39 +25,39 @@ Updates since v1.7.3
cover letter of the previous series; this has been changed to make
the patches in the new series replies to the new cover letter.
- * Bash completion script in contrib/ has been adjusted to be usable with
- Bash 4 (options with '=value' didn't complete) It has been also made
+ * The Bash completion script in contrib/ has been adjusted to be usable with
+ Bash 4 (options with '=value' didn't complete). It has been also made
usable with zsh.
* Different pagers can be chosen depending on which subcommand is
- being run under the pager, using "pager.<subcommand>" variable.
+ being run under the pager, using the "pager.<subcommand>" variable.
- * The hardcoded tab-width of 8 used in whitespace breakage checks is now
+ * The hardcoded tab-width of 8 that is used in whitespace breakage checks is now
configurable via the attributes mechanism.
* Support of case insensitive filesystems (i.e. "core.ignorecase") has
been improved. For example, the gitignore mechanism didn't pay attention
- to the case insensitivity.
+ to case insensitivity.
- * The <tree>:<path> syntax to name a blob in a tree, and :<path>
- syntax to name a blob in the index (e.g. "master:Makefile",
+ * The <tree>:<path> syntax for naming a blob in a tree, and the :<path>
+ syntax for naming a blob in the index (e.g. "master:Makefile",
":hello.c") have been extended. You can start <path> with "./" to
implicitly have the (sub)directory you are in prefixed to the
lookup. Similarly, ":../Makefile" from a subdirectory would mean
"the Makefile of the parent directory in the index".
- * "git blame" learned --show-email option to display the e-mail
+ * "git blame" learned the --show-email option to display the e-mail
addresses instead of the names of authors.
- * "git commit" learned --fixup and --squash options to help later invocation
- of the interactive rebase.
+ * "git commit" learned the --fixup and --squash options to help later invocation
+ of interactive rebase.
* Command line options to "git cvsimport" whose names are in capital
letters (-A, -M, -R and -S) can now be specified as the default in
the .git/config file by their longer names (cvsimport.authorsFile,
cvsimport.mergeRegex, cvsimport.trackRevisions, cvsimport.ignorePaths).
- * "git daemon" can be built in MinGW environment.
+ * "git daemon" can be built in the MinGW environment.
* "git daemon" can take more than one --listen option to listen to
multiple addresses.
@@ -65,13 +65,13 @@ Updates since v1.7.3
* "git describe --exact-match" was optimized not to read commit
objects unnecessarily.
- * "git diff" and "git grep" learned how functions and subroutines
- in Fortran look like.
+ * "git diff" and "git grep" learned what functions and subroutines
+ in Fortran and Perl look like.
- * "git fetch" learned "--recurse-submodules" option.
+ * "git fetch" learned the "--recurse-submodules" option.
- * "git mergetool" tells vim/gvim to show three-way diff by default
- (use vimdiff2/gvimdiff2 as the tool name for old behaviour).
+ * "git mergetool" tells vim/gvim to show a three-way diff by default
+ (use vimdiff2/gvimdiff2 as the tool name for old behavior).
* "git log -G<pattern>" limits the output to commits whose change has
added or deleted lines that match the given pattern.
@@ -91,12 +91,20 @@ Updates since v1.7.3
directory in one branch while a new file is created in place of that
directory in the other branch.
- * "git rebase --autosquash" can use SHA-1 object names to name which
- commit to fix up (e.g. "fixup! e83c5163").
+ * "git merge" learned the "--abort" option, synonymous to
+ "git reset --merge" when a merge is in progress.
- * The default "recursive" merge strategy learned --rename-threshold
+ * "git notes" learned the "merge" subcommand to merge notes refs.
+ In addition to the default manual conflict resolution, there are
+ also several notes merge strategies for automatically resolving
+ notes merge conflicts.
+
+ * "git rebase --autosquash" can use SHA-1 object names to name the
+ commit which is to be fixed up (e.g. "fixup! e83c5163").
+
+ * The default "recursive" merge strategy learned the --rename-threshold
option to influence the rename detection, similar to the -M option
- of "git diff". From "git merge" frontend, "-X<strategy option>"
+ of "git diff". From the "git merge" frontend, the "-X<strategy option>"
interface, e.g. "git merge -Xrename-threshold=50% ...", can be used
to trigger this.
@@ -104,21 +112,21 @@ Updates since v1.7.3
changes; the most notable is -Xignore-space-at-eol.
* "git send-email" learned "--to-cmd", similar to "--cc-cmd", to read
- recipient list from a command output.
+ the recipient list from a command output.
* "git send-email" learned to read and use "To:" from its input files.
* you can extend "git shell", which is often used on boxes that allow
- git-only login over ssh as login shell, with custom set of
+ git-only login over ssh as login shell, with a custom set of
commands.
* The current branch name in "git status" output can be colored differently
- from the generic header color by setting "color.status.branch" variable.
+ from the generic header color by setting the "color.status.branch" variable.
* "git submodule sync" updates metainformation for all submodules,
not just the ones that have been checked out.
- * gitweb can use custom 'highlight' command with its configuration file.
+ * gitweb can use a custom 'highlight' command with its configuration file.
* other gitweb updates.
@@ -129,7 +137,7 @@ Also contains various documentation updates.
Fixes since v1.7.3
------------------
-All of the fixes in v1.7.3.X maintenance series are included in this
+All of the fixes in the v1.7.3.X maintenance series are included in this
release, unless otherwise noted.
* "git log --author=me --author=her" did not find commits written by
@@ -146,6 +154,6 @@ release, unless otherwise noted.
---
exec >/var/tmp/1
-O=v1.7.4-rc1
+O=v1.7.4-rc2
echo O=$(git describe master)
git shortlog --no-merges ^maint ^$O master
diff --git a/Documentation/git-archive.txt b/Documentation/git-archive.txt
index 4163a1bcb1..bf5037ab2a 100644
--- a/Documentation/git-archive.txt
+++ b/Documentation/git-archive.txt
@@ -116,7 +116,7 @@ Note that attributes are by default taken from the `.gitattributes` files
in the tree that is being archived. If you want to tweak the way the
output is generated after the fact (e.g. you committed without adding an
appropriate export-ignore in its `.gitattributes`), adjust the checked out
-`.gitattributes` file as necessary and use `--work-tree-attributes`
+`.gitattributes` file as necessary and use `--worktree-attributes`
option. Alternatively you can keep necessary attributes that should apply
while archiving any tree in your `$GIT_DIR/info/attributes` file.
diff --git a/Documentation/git-fast-import.txt b/Documentation/git-fast-import.txt
index f56dfcabb9..4415e63635 100644
--- a/Documentation/git-fast-import.txt
+++ b/Documentation/git-fast-import.txt
@@ -534,9 +534,6 @@ start with double quote (`"`).
If an `LF` or double quote must be encoded into `<path>` shell-style
quoting should be used, e.g. `"path/with\n and \" in it"`.
-Additionally, in `040000` mode, `<path>` may also be an empty string
-(`""`) to specify the root of the tree.
-
The value of `<path>` must be in canonical form. That is it must not:
* contain an empty directory component (e.g. `foo//bar` is invalid),
@@ -545,6 +542,8 @@ The value of `<path>` must be in canonical form. That is it must not:
* contain the special component `.` or `..` (e.g. `foo/./bar` and
`foo/../bar` are invalid).
+The root of the tree can be represented by an empty string as `<path>`.
+
It is recommended that `<path>` always be encoded using UTF-8.
`filedelete`
@@ -905,7 +904,7 @@ The `<dataref>` can be either a mark reference (`:<idnum>`)
set previously or a full 40-byte SHA-1 of a Git blob, preexisting or
ready to be written.
-output uses the same format as `git cat-file --batch`:
+Output uses the same format as `git cat-file --batch`:
====
<sha1> SP 'blob' SP <size> LF
diff --git a/Documentation/git-reset.txt b/Documentation/git-reset.txt
index fd72976371..927ecee2f2 100644
--- a/Documentation/git-reset.txt
+++ b/Documentation/git-reset.txt
@@ -76,15 +76,10 @@ In other words, --merge does something like a 'git read-tree -u -m <commit>',
but carries forward unmerged index entries.
--keep::
- Resets the index, updates files in the working tree that are
- different between <commit> and HEAD, but keeps those
- which are different between HEAD and the working tree (i.e.
- which have local changes).
+ Resets index entries and updates files in the working tree that are
+ different between <commit> and HEAD.
If a file that is different between <commit> and HEAD has local changes,
reset is aborted.
-+
-In other words, --keep does a 2-way merge between <commit> and HEAD followed by
-'git reset --mixed <commit>'.
--
If you want to undo a commit other than the latest on a branch,
diff --git a/Documentation/gitattributes.txt b/Documentation/gitattributes.txt
index 22b85825ab..7e7e12168e 100644
--- a/Documentation/gitattributes.txt
+++ b/Documentation/gitattributes.txt
@@ -504,6 +504,8 @@ patterns are available:
- `pascal` suitable for source code in the Pascal/Delphi language.
+- `perl` suitable for source code in the Perl language.
+
- `php` suitable for source code in the PHP language.
- `python` suitable for source code in the Python language.
@@ -591,6 +593,39 @@ and now produces better output), you can remove the cache
manually with `git update-ref -d refs/notes/textconv/jpg` (where
"jpg" is the name of the diff driver, as in the example above).
+Marking files as binary
+^^^^^^^^^^^^^^^^^^^^^^^
+
+Git usually guesses correctly whether a blob contains text or binary
+data by examining the beginning of the contents. However, sometimes you
+may want to override its decision, either because a blob contains binary
+data later in the file, or because the content, while technically
+composed of text characters, is opaque to a human reader. For example,
+many postscript files contain only ascii characters, but produce noisy
+and meaningless diffs.
+
+The simplest way to mark a file as binary is to unset the diff
+attribute in the `.gitattributes` file:
+
+------------------------
+*.ps -diff
+------------------------
+
+This will cause git to generate `Binary files differ` (or a binary
+patch, if binary patches are enabled) instead of a regular diff.
+
+However, one may also want to specify other diff driver attributes. For
+example, you might want to use `textconv` to convert postscript files to
+an ascii representation for human viewing, but otherwise treat them as
+binary files. You cannot specify both `-diff` and `diff=ps` attributes.
+The solution is to use the `diff.*.binary` config option:
+
+------------------------
+[diff "ps"]
+ textconv = ps2ascii
+ binary = true
+------------------------
+
Performing a three-way merge
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/Documentation/githooks.txt b/Documentation/githooks.txt
index 7183aa9abb..28edefa202 100644
--- a/Documentation/githooks.txt
+++ b/Documentation/githooks.txt
@@ -350,10 +350,6 @@ rebase::
The commits are guaranteed to be listed in the order that they were
processed by rebase.
-There is no default 'post-rewrite' hook, but see the
-`post-receive-copy-notes` script in `contrib/hooks` for an example
-that copies your git-notes to the rewritten commits.
-
GIT
---
diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN
index c29b944478..ccfc298b18 100755
--- a/GIT-VERSION-GEN
+++ b/GIT-VERSION-GEN
@@ -1,7 +1,7 @@
#!/bin/sh
GVF=GIT-VERSION-FILE
-DEF_VER=v1.7.4-rc1
+DEF_VER=v1.7.4-rc2
LF='
'
diff --git a/builtin/commit.c b/builtin/commit.c
index 22ba54f9bb..03cff5af63 100644
--- a/builtin/commit.c
+++ b/builtin/commit.c
@@ -45,9 +45,9 @@ static const char implicit_ident_advice[] =
" git config --global user.name \"Your Name\"\n"
" git config --global user.email you@example.com\n"
"\n"
-"If the identity used for this commit is wrong, you can fix it with:\n"
+"After doing this, you may fix the identity used for this commit with:\n"
"\n"
-" git commit --amend --author='Your Name <you@example.com>'\n";
+" git commit --amend --reset-author\n";
static const char empty_amend_advice[] =
"You asked to amend the most recent commit, but doing so would make\n"
diff --git a/builtin/remote-ext.c b/builtin/remote-ext.c
index 1f773171cb..ea71977c83 100644
--- a/builtin/remote-ext.c
+++ b/builtin/remote-ext.c
@@ -212,16 +212,16 @@ static int command_loop(const char *child)
char buffer[MAXCOMMAND];
while (1) {
- size_t length;
+ size_t i;
if (!fgets(buffer, MAXCOMMAND - 1, stdin)) {
if (ferror(stdin))
die("Comammand input error");
exit(0);
}
/* Strip end of line characters. */
- length = strlen(buffer);
- while (isspace((unsigned char)buffer[length - 1]))
- buffer[--length] = 0;
+ i = strlen(buffer);
+ while (i > 0 && isspace(buffer[i - 1]))
+ buffer[--i] = 0;
if (!strcmp(buffer, "capabilities")) {
printf("*connect\n\n");
diff --git a/exec_cmd.c b/exec_cmd.c
index bf225706ee..38545e8bfd 100644
--- a/exec_cmd.c
+++ b/exec_cmd.c
@@ -3,7 +3,6 @@
#include "quote.h"
#define MAX_ARGS 32
-extern char **environ;
static const char *argv_exec_path;
static const char *argv0_path;
diff --git a/git-submodule.sh b/git-submodule.sh
index c21b77aee5..8b90589717 100755
--- a/git-submodule.sh
+++ b/git-submodule.sh
@@ -37,12 +37,24 @@ resolve_relative_url ()
die "remote ($remote) does not have a url defined in .git/config"
url="$1"
remoteurl=${remoteurl%/}
+ sep=/
while test -n "$url"
do
case "$url" in
../*)
url="${url#../}"
- remoteurl="${remoteurl%/*}"
+ case "$remoteurl" in
+ */*)
+ remoteurl="${remoteurl%/*}"
+ ;;
+ *:*)
+ remoteurl="${remoteurl%:*}"
+ sep=:
+ ;;
+ *)
+ die "cannot strip one component off url '$remoteurl'"
+ ;;
+ esac
;;
./*)
url="${url#./}"
@@ -51,7 +63,7 @@ resolve_relative_url ()
break;;
esac
done
- echo "$remoteurl/${url%/}"
+ echo "$remoteurl$sep${url%/}"
}
#
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index c65af1a00a..1025c2f716 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -250,13 +250,14 @@ our %highlight_ext = (
# main extensions, defining name of syntax;
# see files in /usr/share/highlight/langDefs/ directory
map { $_ => $_ }
- qw(py c cpp rb java css php sh pl js tex bib xml awk bat ini spec tcl),
+ qw(py c cpp rb java css php sh pl js tex bib xml awk bat ini spec tcl sql make),
# alternate extensions, see /etc/highlight/filetypes.conf
'h' => 'c',
+ map { $_ => 'sh' } qw(bash zsh ksh),
map { $_ => 'cpp' } qw(cxx c++ cc),
- map { $_ => 'php' } qw(php3 php4),
+ map { $_ => 'php' } qw(php3 php4 php5 phps),
map { $_ => 'pl' } qw(perl pm), # perhaps also 'cgi'
- 'mak' => 'make',
+ map { $_ => 'make'} qw(mak mk),
map { $_ => 'xml' } qw(xhtml html htm),
);
@@ -3464,8 +3465,7 @@ sub run_highlighter {
my ($fd, $highlight, $syntax) = @_;
return $fd unless ($highlight && defined $syntax);
- close $fd
- or die_error(404, "Reading blob failed");
+ close $fd;
open $fd, quote_command(git_cmd(), "cat-file", "blob", $hash)." | ".
quote_command($highlight_bin).
" --xhtml --fragment --syntax $syntax |"
@@ -3601,10 +3601,15 @@ EOF
insert_file($site_header);
}
- print "<div class=\"page_header\">\n" .
- $cgi->a({-href => esc_url($logo_url),
- -title => $logo_label},
- qq(<img src=").esc_url($logo).qq(" width="72" height="27" alt="git" class="logo"/>));
+ print "<div class=\"page_header\">\n";
+ if (defined $logo) {
+ print $cgi->a({-href => esc_url($logo_url),
+ -title => $logo_label},
+ $cgi->img({-src => esc_url($logo),
+ -width => 72, -height => 27,
+ -alt => "git",
+ -class => "logo"}));
+ }
print $cgi->a({-href => esc_url($home_link)}, $home_link_str) . " / ";
if (defined $project) {
print $cgi->a({-href => href(action=>"summary")}, esc_html($project));
diff --git a/ll-merge.c b/ll-merge.c
index 007dd3e4d3..6ce512efc4 100644
--- a/ll-merge.c
+++ b/ll-merge.c
@@ -351,16 +351,13 @@ int ll_merge(mmbuffer_t *result_buf,
const struct ll_merge_options *opts)
{
static struct git_attr_check check[2];
+ static const struct ll_merge_options default_opts;
const char *ll_driver_name = NULL;
int marker_size = DEFAULT_CONFLICT_MARKER_SIZE;
const struct ll_merge_driver *driver;
- if (!opts) {
- struct ll_merge_options default_opts = {0};
- return ll_merge(result_buf, path, ancestor, ancestor_label,
- ours, our_label, theirs, their_label,
- &default_opts);
- }
+ if (!opts)
+ opts = &default_opts;
if (opts->renormalize) {
normalize_file(ancestor, path);
diff --git a/sha1_file.c b/sha1_file.c
index 1cafdfa617..d86a8db69a 100644
--- a/sha1_file.c
+++ b/sha1_file.c
@@ -2141,7 +2141,7 @@ void *read_sha1_file_repl(const unsigned char *sha1,
return data;
}
- if (errno != ENOENT)
+ if (errno && errno != ENOENT)
die_errno("failed to read object %s", sha1_to_hex(sha1));
/* die if we replaced an object with one that does not exist */
diff --git a/t/lib-git-svn.sh b/t/lib-git-svn.sh
index 6a9d975723..199f22c231 100644
--- a/t/lib-git-svn.sh
+++ b/t/lib-git-svn.sh
@@ -68,8 +68,7 @@ svn_cmd () {
svn "$orig_svncmd" --config-dir "$svnconf" "$@"
}
-if test -n "$SVN_HTTPD_PORT"
-then
+prepare_httpd () {
for d in \
"$SVN_HTTPD_PATH" \
/usr/sbin/apache2 \
@@ -83,8 +82,8 @@ then
done
if test -z "$SVN_HTTPD_PATH"
then
- skip_all='skipping git svn tests, Apache not found'
- test_done
+ echo >&2 '*** error: Apache not found'
+ return 1
fi
for d in \
"$SVN_HTTPD_MODULE_PATH" \
@@ -99,23 +98,16 @@ then
done
if test -z "$SVN_HTTPD_MODULE_PATH"
then
- skip_all='skipping git svn tests, Apache module dir not found'
- test_done
- fi
-fi
-
-start_httpd () {
- repo_base_path="$1"
- if test -z "$SVN_HTTPD_PORT"
- then
- echo >&2 'SVN_HTTPD_PORT is not defined!'
- return
+ echo >&2 '*** error: Apache module dir not found'
+ return 1
fi
- if test -z "$repo_base_path"
+ if test ! -f "$SVN_HTTPD_MODULE_PATH/mod_dav_svn.so"
then
- repo_base_path=svn
+ echo >&2 '*** error: Apache module "mod_dav_svn" not found'
+ return 1
fi
+ repo_base_path="${1-svn}"
mkdir "$GIT_DIR"/logs
cat > "$GIT_DIR/httpd.conf" <<EOF
@@ -132,12 +124,24 @@ LoadModule dav_svn_module $SVN_HTTPD_MODULE_PATH/mod_dav_svn.so
SVNPath "$rawsvnrepo"
</Location>
EOF
+}
+
+start_httpd () {
+ if test -z "$SVN_HTTPD_PORT"
+ then
+ echo >&2 'SVN_HTTPD_PORT is not defined!'
+ return
+ fi
+
+ prepare_httpd "$1" || return 1
+
"$SVN_HTTPD_PATH" -f "$GIT_DIR"/httpd.conf -k start
svnrepo="http://127.0.0.1:$SVN_HTTPD_PORT/$repo_base_path"
}
stop_httpd () {
test -z "$SVN_HTTPD_PORT" && return
+ test ! -f "$GIT_DIR/httpd.conf" && return
"$SVN_HTTPD_PATH" -f "$GIT_DIR"/httpd.conf -k stop
}
diff --git a/t/t0000-basic.sh b/t/t0000-basic.sh
index 2f7002a5e5..8deec75c3a 100755
--- a/t/t0000-basic.sh
+++ b/t/t0000-basic.sh
@@ -80,11 +80,11 @@ EOF
chmod +x passing-todo.sh &&
./passing-todo.sh >out 2>err &&
! test -s err &&
-cat >expect <<EOF &&
-ok 1 - pretend we have fixed a known breakage # TODO known breakage
-# fixed 1 known breakage(s)
-# passed all 1 test(s)
-1..1
+sed -e 's/^> //' >expect <<EOF &&
+> ok 1 - pretend we have fixed a known breakage # TODO known breakage
+> # fixed 1 known breakage(s)
+> # passed all 1 test(s)
+> 1..1
EOF
test_cmp expect out)
"
@@ -164,19 +164,19 @@ EOF
test_must_fail ./failing-cleanup.sh >out 2>err &&
! test -s err &&
! test -f \"trash directory.failing-cleanup/clean-after-failure\" &&
-sed -e 's/Z$//' >expect <<\EOF &&
-not ok - 1 tests clean up even after a failure
-# Z
-# touch clean-after-failure &&
-# test_when_finished rm clean-after-failure &&
-# (exit 1)
-# Z
-not ok - 2 failure to clean up causes the test to fail
-# Z
-# test_when_finished \"(exit 2)\"
-# Z
-# failed 2 among 2 test(s)
-1..2
+sed -e 's/Z$//' -e 's/^> //' >expect <<\EOF &&
+> not ok - 1 tests clean up even after a failure
+> # Z
+> # touch clean-after-failure &&
+> # test_when_finished rm clean-after-failure &&
+> # (exit 1)
+> # Z
+> not ok - 2 failure to clean up causes the test to fail
+> # Z
+> # test_when_finished \"(exit 2)\"
+> # Z
+> # failed 2 among 2 test(s)
+> 1..2
EOF
test_cmp expect out)
"
diff --git a/t/t3032-merge-recursive-options.sh b/t/t3032-merge-recursive-options.sh
index de9ff89d14..44f5421be4 100755
--- a/t/t3032-merge-recursive-options.sh
+++ b/t/t3032-merge-recursive-options.sh
@@ -13,9 +13,12 @@ test_description='merge-recursive options
. ./test-lib.sh
+test_have_prereq SED_STRIPS_CR && SED_OPTIONS=-b
+test_have_prereq MINGW && export GREP_OPTIONS=-U
+
test_expect_success 'setup' '
conflict_hunks () {
- sed -n -e "
+ sed $SED_OPTIONS -n -e "
/^<<<</ b conflict
b
: conflict
diff --git a/t/t4018-diff-funcname.sh b/t/t4018-diff-funcname.sh
index 0a61b57b5f..3646930623 100755
--- a/t/t4018-diff-funcname.sh
+++ b/t/t4018-diff-funcname.sh
@@ -32,7 +32,7 @@ EOF
sed 's/beer\\/beer,\\/' < Beer.java > Beer-correct.java
-builtin_patterns="bibtex cpp csharp fortran html java objc pascal php python ruby tex"
+builtin_patterns="bibtex cpp csharp fortran html java objc pascal perl php python ruby tex"
for p in $builtin_patterns
do
test_expect_success "builtin $p pattern compiles" '
diff --git a/t/t6038-merge-text-auto.sh b/t/t6038-merge-text-auto.sh
index 460bf741b5..d9c2d386dd 100755
--- a/t/t6038-merge-text-auto.sh
+++ b/t/t6038-merge-text-auto.sh
@@ -14,7 +14,7 @@ test_description='CRLF merge conflict across text=auto change
. ./test-lib.sh
-test_have_prereq MINGW && SED_OPTIONS=-b
+test_have_prereq SED_STRIPS_CR && SED_OPTIONS=-b
test_expect_success setup '
git config core.autocrlf false &&
diff --git a/t/t7400-submodule-basic.sh b/t/t7400-submodule-basic.sh
index 2c49db9f62..874279e32d 100755
--- a/t/t7400-submodule-basic.sh
+++ b/t/t7400-submodule-basic.sh
@@ -446,4 +446,42 @@ test_expect_success 'add should fail when path is used by an existing directory'
)
'
+test_expect_success 'set up for relative path tests' '
+ mkdir reltest &&
+ (
+ cd reltest &&
+ git init &&
+ mkdir sub &&
+ (
+ cd sub &&
+ git init &&
+ test_commit foo
+ ) &&
+ git add sub &&
+ git config -f .gitmodules submodule.sub.path sub &&
+ git config -f .gitmodules submodule.sub.url ../subrepo &&
+ cp .git/config pristine-.git-config
+ )
+'
+
+test_expect_success 'relative path works with URL' '
+ (
+ cd reltest &&
+ cp pristine-.git-config .git/config &&
+ git config remote.origin.url ssh://hostname/repo &&
+ git submodule init &&
+ test "$(git config submodule.sub.url)" = ssh://hostname/subrepo
+ )
+'
+
+test_expect_success 'relative path works with user@host:path' '
+ (
+ cd reltest &&
+ cp pristine-.git-config .git/config &&
+ git config remote.origin.url user@host:repo &&
+ git submodule init &&
+ test "$(git config submodule.sub.url)" = user@host:subrepo
+ )
+'
+
test_done
diff --git a/t/t9010-svn-fe.sh b/t/t9010-svn-fe.sh
index c96bf2f5c0..88a9751dd3 100755
--- a/t/t9010-svn-fe.sh
+++ b/t/t9010-svn-fe.sh
@@ -4,22 +4,6 @@ test_description='check svn dumpfile importer'
. ./test-lib.sh
-if ! svnadmin -h >/dev/null 2>&1
-then
- skip_all='skipping svn-fe tests, svn not available'
- test_done
-fi
-
-svnconf=$PWD/svnconf
-export svnconf
-
-svn_cmd () {
- subcommand=$1 &&
- shift &&
- mkdir -p "$svnconf" &&
- svn "$subcommand" --config-dir "$svnconf" "$@"
-}
-
reinit_git () {
rm -fr .git &&
git init
@@ -41,10 +25,21 @@ test_expect_success 'v3 dumps not supported' '
test_cmp empty stream
'
-test_expect_success 't9135/svn.dump' '
- svnadmin create simple-svn &&
- svnadmin load simple-svn <"$TEST_DIRECTORY/t9135/svn.dump" &&
- svn_cmd export "file://$PWD/simple-svn" simple-svnco &&
+test_expect_success 'set up svn repo' '
+ svnconf=$PWD/svnconf &&
+ mkdir -p "$svnconf" &&
+
+ if
+ svnadmin -h >/dev/null 2>&1 &&
+ svnadmin create simple-svn &&
+ svnadmin load simple-svn <"$TEST_DIRECTORY/t9135/svn.dump" &&
+ svn export --config-dir "$svnconf" "file://$PWD/simple-svn" simple-svnco
+ then
+ test_set_prereq SVNREPO
+ fi
+'
+
+test_expect_success SVNREPO 't9135/svn.dump' '
git init simple-git &&
test-svn-fe "$TEST_DIRECTORY/t9135/svn.dump" >simple.fe &&
(
diff --git a/t/t9157-git-svn-fetch-merge.sh b/t/t9157-git-svn-fetch-merge.sh
index accf61eb03..991d2aa1be 100755
--- a/t/t9157-git-svn-fetch-merge.sh
+++ b/t/t9157-git-svn-fetch-merge.sh
@@ -8,7 +8,7 @@ test_description='git svn merge detection'
svn_ver="$(svn --version --quiet)"
case $svn_ver in
-[0-1].[0-4].[0-6])
+0.* | 1.[0-4].*)
skip_all="skipping git-svn test - SVN too old ($svn_ver)"
test_done
;;
diff --git a/t/test-lib.sh b/t/test-lib.sh
index cb1ca973aa..42f2f14496 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -1057,6 +1057,13 @@ case $(uname -s) in
# backslashes in pathspec are converted to '/'
# exec does not inherit the PID
test_set_prereq MINGW
+ test_set_prereq SED_STRIPS_CR
+ ;;
+*CYGWIN*)
+ test_set_prereq POSIXPERM
+ test_set_prereq EXECKEEPSPID
+ test_set_prereq NOT_MINGW
+ test_set_prereq SED_STRIPS_CR
;;
*)
test_set_prereq POSIXPERM
diff --git a/userdiff.c b/userdiff.c
index 2d5453697a..c384b39e4d 100644
--- a/userdiff.c
+++ b/userdiff.c
@@ -61,6 +61,23 @@ PATTERNS("pascal",
"|[-+0-9.e]+|0[xXbB]?[0-9a-fA-F]+"
"|<>|<=|>=|:=|\\.\\."
"|[^[:space:]]|[\x80-\xff]+"),
+PATTERNS("perl",
+ "^[ \t]*package .*;\n"
+ "^[ \t]*sub .* \\{\n"
+ "^[A-Z]+ \\{\n" /* BEGIN, END, ... */
+ "^=head[0-9] ", /* POD */
+ /* -- */
+ "[[:alpha:]_'][[:alnum:]_']*"
+ "|0[xb]?[0-9a-fA-F_]*"
+ /* taking care not to interpret 3..5 as (3.)(.5) */
+ "|[0-9a-fA-F_]+(\\.[0-9a-fA-F_]+)?([eE][-+]?[0-9_]+)?"
+ "|=>|-[rwxoRWXOezsfdlpSugkbctTBMAC>]|~~|::"
+ "|&&=|\\|\\|=|//=|\\*\\*="
+ "|&&|\\|\\||//|\\+\\+|--|\\*\\*|\\.\\.\\.?"
+ "|[-+*/%.^&<>=!|]="
+ "|=~|!~"
+ "|<<|<>|<=>|>>"
+ "|[^[:space:]]"),
PATTERNS("php",
"^[\t ]*(((public|protected|private|static)[\t ]+)*function.*)$\n"
"^[\t ]*(class.*)$",
diff --git a/vcs-svn/svndump.c b/vcs-svn/svndump.c
index fa580e62de..2ad2c307dd 100644
--- a/vcs-svn/svndump.c
+++ b/vcs-svn/svndump.c
@@ -211,7 +211,7 @@ void svndump_read(const char *url)
if (key == keys.svn_fs_dump_format_version) {
dump_ctx.version = atoi(val);
if (dump_ctx.version > 2)
- die("expected svn dump format version <= 2, found %d",
+ die("expected svn dump format version <= 2, found %"PRIu32,
dump_ctx.version);
} else if (key == keys.uuid) {
dump_ctx.uuid = pool_intern(val);