Merge branch 'jn/setup-fixes'
authorJunio C Hamano <gitster@pobox.com>
Mon, 24 Jan 2011 18:53:09 +0000 (10:53 -0800)
committerJunio C Hamano <gitster@pobox.com>
Mon, 24 Jan 2011 18:53:09 +0000 (10:53 -0800)
* jn/setup-fixes:
t1510: fix typo in the comment of a test
Documentation updates for 'GIT_WORK_TREE without GIT_DIR' historical usecase
Subject: setup: officially support --work-tree without --git-dir
tests: compress the setup tests
tests: cosmetic improvements to the repo-setup test
t/README: hint about using $(pwd) rather than $PWD in tests
Fix expected values of setup tests on Windows

25 files changed:
Documentation/RelNotes/1.7.4.txt
Documentation/git-archive.txt
Documentation/git-fast-import.txt
Documentation/git-reset.txt
Documentation/gitattributes.txt
Documentation/githooks.txt
GIT-VERSION-GEN
builtin/commit.c
builtin/remote-ext.c
exec_cmd.c
git-submodule.sh
gitweb/gitweb.perl
ll-merge.c
sha1_file.c
t/lib-git-svn.sh
t/t0000-basic.sh
t/t3032-merge-recursive-options.sh
t/t4018-diff-funcname.sh
t/t6038-merge-text-auto.sh
t/t7400-submodule-basic.sh
t/t9010-svn-fe.sh
t/t9157-git-svn-fetch-merge.sh
t/test-lib.sh
userdiff.c
vcs-svn/svndump.c
index 055c1ca2b7348b5f28a96d92b39a1094a0d27337..84d0e1dc13ca59a6bb0ab300dd91abdc210ffbe6 100644 (file)
@@ -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 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 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 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
index 4163a1bcb1643e7f05b6a79034ac9f63135d6ac9..bf5037ab2a5042a20e9cb603f0831bb186ac3b74 100644 (file)
@@ -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.
 
index f56dfcabb96d1510abfd61a13c36135f3824b744..4415e636352ea88f34a798b6c29dc5e34d60d868 100644 (file)
@@ -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
index fd72976371cee0fcd25e3419138eb13382dc6ab8..927ecee2f26cdf0bd30457d5016b654c01a23a14 100644 (file)
@@ -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,
index 22b85825abcd48604701b8ceae7fef28e026ddde..7e7e12168eb69d43f6d7eea9cde2176e06fe73d5 100644 (file)
@@ -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
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
index 7183aa9abbc35018dc50a7c0e5254cc72115af23..28edefa202fb0d1065f161f59787ceae39439eb3 100644 (file)
@@ -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
 ---
index c29b94447894b93638dc99064fab3cb2db7daab6..ccfc298b18439f6463d0c709819402edcec04102 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 GVF=GIT-VERSION-FILE
-DEF_VER=v1.7.4-rc1
+DEF_VER=v1.7.4-rc2
 
 LF='
 '
index 22ba54f9bb2ea9f9f9f01528e8a155723da7a4da..03cff5af631fec975442c528b1ffba264b879c8e 100644 (file)
@@ -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"
index 1f773171cbdde76cc105e37928cc5f2ecb2ed93f..ea71977c8360e1a7899bbd035cf26f93d889800b 100644 (file)
@@ -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");
index bf225706ee377b89035eb21f76f9957cfaf6363b..38545e8bfd72c8cd4f91e0d33257b143db86bac5 100644 (file)
@@ -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;
 
index c21b77aee54cd045b7bb64ae7337387569bbf65a..8b9058971767dbb4d94e996876f6ba7ed178ddd6 100755 (executable)
@@ -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%/}"
 }
 
 #
index c65af1a00a42dccda70ddbc0f3231ae1b7a53644..1025c2f7165a7941ac8d13bff0e693cb3783b475 100755 (executable)
@@ -250,13 +250,14 @@ sub evaluate_uri {
        # 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 @@ sub git_header_html {
                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));
index 007dd3e4d38ff657a29a06e559173b796f193763..6ce512efc4cce8042481e8a6947d033c272e78e6 100644 (file)
@@ -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);
index 1cafdfa617a833ec757b481826dc62282be8f374..d86a8db69ade6fd26ebd88bbb361a7a86838f14e 100644 (file)
@@ -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 */
index 6a9d9757239f0476422b1a97228927b1ba1ac934..199f22c231b5ac1479929a89cdf988ac7aff4268 100644 (file)
@@ -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
 }
 
index 2f7002a5e57d61a69d418cc55d1e939198c6ac20..8deec75c3a0eef961986a0bb313a918ab532f58d 100755 (executable)
@@ -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)
 "
index de9ff89d14ff97f1691efee3a670084d4f20a249..44f5421be45579b10c5556a958404ad2daa02002 100755 (executable)
@@ -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
index 0a61b57b5f6f00ae4c0734a34ce45c0ba1fcf098..364693062399228cd6a18b52a21db173519d8e94 100755 (executable)
@@ -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" '
index 460bf741b594d4d6b7f2220ac0f1a0d28c653619..d9c2d386ddf8caff4b87fa457c23757f76c293c7 100755 (executable)
@@ -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 &&
index 2c49db9f6244225db7f82b574f21f05b58bfdc26..874279e32da98ac2c20137a207a0d115f073e444 100755 (executable)
@@ -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
index c96bf2f5c04774f04f2f87c72edcaae7bbaa72e1..88a9751dd3c73a39a15ec3d18d3dddb7790706bb 100755 (executable)
@@ -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 &&
        (
index accf61eb03c482e72cef7c8810c47bef5b985394..991d2aa1be63c2440db93e6237201383e28a498a 100755 (executable)
@@ -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
        ;;
index cb1ca973aa16d82b3c52cc2b7834d977887567a2..42f2f144969a0671b3431f21f659beaff2c53b3d 100644 (file)
@@ -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
index 2d5453697aaf5287f524b72d0088ee15679e0691..c384b39e4daf1226a2c13c74dc2a4a2f75b8e63b 100644 (file)
@@ -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.*)$",
index fa580e62de05f832e7d7474cc1a457cd7379cef2..2ad2c307dd6e8f4bddf5cbd9c588973a085bf870 100644 (file)
@@ -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);