Code

Merge v1.7.10-rc0 for git l10n update
authorJiang Xin <worldhello.net@gmail.com>
Fri, 16 Mar 2012 12:18:07 +0000 (20:18 +0800)
committerJiang Xin <worldhello.net@gmail.com>
Fri, 16 Mar 2012 12:18:07 +0000 (20:18 +0800)
21 files changed:
Documentation/RelNotes/1.7.10.txt
Documentation/RelNotes/1.7.9.4.txt [new file with mode: 0644]
Documentation/git-branch.txt
Documentation/git-rerere.txt
Documentation/git.txt
GIT-VERSION-GEN
builtin/prune-packed.c
builtin/prune.c
builtin/verify-tag.c
config.c
git-am.sh
git-sh-i18n.sh
git-submodule.sh
gitweb/gitweb.perl
t/perf/p0000-perf-lib-sanity.sh
t/perf/p4000-diff-algorithms.sh
t/perf/perf-lib.sh
t/t0204-gettext-reencode-sanity.sh
t/t1300-repo-config.sh
t/t7400-submodule-basic.sh
t/t7406-submodule-update.sh

index ae446e0c2cde17d10e0552ac07cdb2e1521b54f0..540ce38c456d1c0c37152ed58a75bdfa8a512c7c 100644 (file)
@@ -25,6 +25,10 @@ Compatibility Notes
    "git merge" command if you know everybody who uses your script has
    Git v1.7.8 or newer.
 
+ * The "--binary/-b" options to "git am" have been a no-op for quite a
+   while and were deprecated in mid 2008 (v1.6.0).  When you give these
+   options to "git am", it will now warn and ask you not to use them.
+
 
 Updates since v1.7.9
 --------------------
@@ -43,20 +47,23 @@ UI, Workflows & Features
 
  * A content filter (clean/smudge) used to be just a way to make the
    recorded contents "more useful", and allowed to fail; a filter can
-   new optionally be marked as "required".
+   now optionally be marked as "required".
 
  * Options whose names begin with "--no-" (e.g. the "--no-verify"
    option of the "git commit" command) can be negated by omitting
    "no-" from its name, e.g. "git commit --verify".
 
  * "git am" learned to pass "-b" option to underlying "git mailinfo", so
-   that bracketed string other than "PATCH" at the beginning can be kept.
+   that bracketed string other than "PATCH" at the beginning can be kept.
 
  * "git clone" learned "--single-branch" option to limit cloning to a
-   single branch (surprise!).
+   single branch (surprise!); tags that do not point into the history
+   of the branch are not fetched.
 
  * "git clone" learned to detach the HEAD in the resulting repository
-   when the source repository's HEAD does not point to a branch.
+   when the user specifies a tag with "--branch" (e.g., "--branch=v1.0").
+   Clone also learned to print the usual "detached HEAD" advice in such
+   a case, similar to "git checkout v1.0".
 
  * When showing a patch while ignoring whitespace changes, the context
    lines are taken from the postimage, in order to make it easier to
@@ -71,9 +78,12 @@ UI, Workflows & Features
  * "fsck" learned "--no-dangling" option to omit dangling object
    information.
 
- * "git log -G" learned to pay attention to the "-i" option and can
-   find patch hunks that introduce or remove a string that matches the
-   given pattern ignoring the case.
+ * "git log -G" and "git log -S" learned to pay attention to the "-i"
+   option.  With "-i", "log -G" ignores the case when finding patch
+   hunks that introduce or remove a string that matches the given
+   pattern.  Similarly with "-i", "log -S" ignores the case when
+   finding the commit the given block of text appears or disappears
+   from the file.
 
  * "git merge" in an interactive session learned to spawn the editor
    by default to let the user edit the auto-generated merge message,
@@ -82,12 +92,15 @@ UI, Workflows & Features
    Both "git merge" and "git pull" can be given --no-edit from the
    command line to accept the auto-generated merge message.
 
- * The advise message given when the user didn't give enough clue on
+ * The advice message given when the user didn't give enough clue on
    what to merge to "git pull" and "git merge" has been updated to
    be more concise and easier to understand.
 
  * "git push" learned the "--prune" option, similar to "git fetch".
 
+ * The whole directory that houses a top-level superproject managed by
+   "git submodule" can be moved to another place.
+
  * "git symbolic-ref" learned the "--short" option to abbreviate the
    refname it shows unambiguously.
 
@@ -95,7 +108,7 @@ UI, Workflows & Features
    output to those that point at the given object.
 
  * "gitweb" allows intermediate entries in the directory hierarchy
-   that leads to a projects to be clicked, which in turn shows the
+   that leads to a project to be clicked, which in turn shows the
    list of projects inside that directory.
 
  * "gitweb" learned to read various pieces of information for the
@@ -106,6 +119,10 @@ UI, Workflows & Features
  * Project search in "gitweb" shows the substring that matched in the
    project name and description highlighted.
 
+ * A new script "diffall" is added to contrib/; it drives an
+   external tool to perform a directory diff of two Git revisions
+   in one go, unlike "difftool" that compares one file at a time.
+
 Foreign Interface
 
  * Improved handling of views, labels and branches in "git-p4" (in contrib).
@@ -149,6 +166,10 @@ Internal Implementation (please report possible regressions)
  * The code to check if a path points at a file beyond a symbolic link
    has been restructured to be thread-safe.
 
+ * When pruning directories that has become empty during "git prune"
+   and "git prune-packed", call closedir() that iterates over a
+   directory before rmdir() it.
+
 Also contains minor documentation updates and code clean-ups.
 
 
@@ -159,21 +180,17 @@ Unless otherwise noted, all the fixes since v1.7.9 in the maintenance
 releases are contained in this release (see release notes to them for
 details).
 
- * "git bundle" did not record boundary commits correctly when there
-   are many of them.
-   (merge efe4be1 tr/maint-bundle-boundary later to maint).
+ * The "remaining" subcommand to "git rerere" was not documented.
+   (merge 3e7a1df ph/rerere-doc later to maint).
 
- * "git diff-index" and its friends at the plumbing level showed the
-   "diff --git" header and nothing else for a path whose cached stat
-   info is dirty without actual difference when asked to produce a
-   patch. This was a longstanding bug that we could have fixed long
-   time ago.
-   (merge b3f01ff jc/maint-diff-patch-header later to maint).
+ * "git tag -s" honored "gpg.program" configuration variable since
+   1.7.9, but "git tag -v" and "git verify-tag" didn't.
+   (merge a2c2506 az/verify-tag-use-gpg-config later to maint).
 
- * The code to synthesize the fake ancestor tree used by 3-way merge
-   fallback in "git am" was not prepared to read a patch created with
-   a non-standard -p<num> value.
-   (merge a61ba26 jc/am-3-nonstandard-popt later to maint).
+ * When "git config" diagnoses an error in a configuration file and
+   shows the line number for the offending line, it miscounted if the
+   error was at the end of line.
+   (merge 4b34059 ms/maint-config-error-at-eol-linecount later to maint).
 
  * "gitweb" used to drop warnings in the log file when "heads" view is
    accessed in a repository whose HEAD does not point at a valid
@@ -181,7 +198,7 @@ details).
 
 ---
 exec >/var/tmp/1
-O=v1.7.9.3-366-g1e4d087
+O=v1.7.10-rc0-50-gd973dc0
 echo O=$(git describe)
 git log --first-parent --oneline ^maint $O..
 echo
diff --git a/Documentation/RelNotes/1.7.9.4.txt b/Documentation/RelNotes/1.7.9.4.txt
new file mode 100644 (file)
index 0000000..e5217a1
--- /dev/null
@@ -0,0 +1,24 @@
+Git v1.7.9.4 Release Notes
+==========================
+
+Fixes since v1.7.9.3
+--------------------
+
+ * The code to synthesize the fake ancestor tree used by 3-way merge
+   fallback in "git am" was not prepared to read a patch created with
+   a non-standard -p<num> value.
+
+ * "git bundle" did not record boundary commits correctly when there
+   are many of them.
+
+ * "git diff-index" and its friends at the plumbing level showed the
+   "diff --git" header and nothing else for a path whose cached stat
+   info is dirty without actual difference when asked to produce a
+   patch. This was a longstanding bug that we could have fixed long
+   time ago.
+
+ * "gitweb" did use quotemeta() to prepare search string when asked to
+   do a fixed-string project search, but did not use it by mistake and
+   used the user-supplied string instead.
+
+Also contains minor fixes and documentation updates.
index 0427e80a35601e689a47299dce9c5517959bddf8..6410c3d34545ce9bf191ffe91bbf8fd77cfc9b7e 100644 (file)
@@ -24,8 +24,8 @@ be highlighted with an asterisk.  Option `-r` causes the remote-tracking
 branches to be listed, and option `-a` shows both. This list mode is also
 activated by the `--list` option (see below).
 <pattern> restricts the output to matching branches, the pattern is a shell
-wildcard (i.e., matched using fnmatch(3))
-Multiple patterns may be given; if any of them matches, the tag is shown.
+wildcard (i.e., matched using fnmatch(3)).
+Multiple patterns may be given; if any of them matches, the branch is shown.
 
 With `--contains`, shows only the branches that contain the named commit
 (in other words, the branches whose tip commits are descendants of the
@@ -49,7 +49,7 @@ the remote-tracking branch. This behavior may be changed via the global
 overridden by using the `--track` and `--no-track` options, and
 changed later using `git branch --set-upstream`.
 
-With a '-m' or '-M' option, <oldbranch> will be renamed to <newbranch>.
+With a `-m` or `-M` option, <oldbranch> will be renamed to <newbranch>.
 If <oldbranch> had a corresponding reflog, it is renamed to match
 <newbranch>, and a reflog entry is created to remember the branch
 renaming. If <newbranch> exists, -M must be used to force the rename
@@ -59,7 +59,7 @@ With a `-d` or `-D` option, `<branchname>` will be deleted.  You may
 specify more than one branch for deletion.  If the branch currently
 has a reflog then the reflog will also be deleted.
 
-Use -r together with -d to delete remote-tracking branches. Note, that it
+Use `-r` together with `-d` to delete remote-tracking branches. Note, that it
 only makes sense to delete remote-tracking branches if they no longer exist
 in the remote repository or if 'git fetch' was configured not to fetch
 them again. See also the 'prune' subcommand of linkgit:git-remote[1] for a
@@ -154,17 +154,18 @@ start-point is either a local or remote-tracking branch.
        branch.autosetupmerge configuration variable is true.
 
 --set-upstream::
-       If specified branch does not exist yet or if '--force' has been
-       given, acts exactly like '--track'. Otherwise sets up configuration
-       like '--track' would when creating the branch, except that where
+       If specified branch does not exist yet or if `--force` has been
+       given, acts exactly like `--track`. Otherwise sets up configuration
+       like `--track` would when creating the branch, except that where
        branch points to is not changed.
 
 --edit-description::
        Open an editor and edit the text to explain what the branch is
        for, to be used by various other commands (e.g. `request-pull`).
 
---contains <commit>::
-       Only list branches which contain the specified commit.
+--contains [<commit>]::
+       Only list branches which contain the specified commit (HEAD
+       if not specified).
 
 --merged [<commit>]::
        Only list branches whose tips are reachable from the
index a6253ba617f5ebcd82e4cfb1702999c145fa346c..b43b7c8c0ed67fa37e20c41f35a703c28c4d9844 100644 (file)
@@ -8,7 +8,7 @@ git-rerere - Reuse recorded resolution of conflicted merges
 SYNOPSIS
 --------
 [verse]
-'git rerere' ['clear'|'forget' <pathspec>|'diff'|'status'|'gc']
+'git rerere' ['clear'|'forget' <pathspec>|'diff'|'remaining'|'status'|'gc']
 
 DESCRIPTION
 -----------
@@ -37,30 +37,35 @@ its working state.
 
 'clear'::
 
-This resets the metadata used by rerere if a merge resolution is to be
+Reset the metadata used by rerere if a merge resolution is to be
 aborted.  Calling 'git am [--skip|--abort]' or 'git rebase [--skip|--abort]'
 will automatically invoke this command.
 
 'forget' <pathspec>::
 
-This resets the conflict resolutions which rerere has recorded for the current
+Reset the conflict resolutions which rerere has recorded for the current
 conflict in <pathspec>.
 
 'diff'::
 
-This displays diffs for the current state of the resolution.  It is
+Display diffs for the current state of the resolution.  It is
 useful for tracking what has changed while the user is resolving
 conflicts.  Additional arguments are passed directly to the system
 'diff' command installed in PATH.
 
 'status'::
 
-Like 'diff', but this only prints the filenames that will be tracked
-for resolutions.
+Print paths with conflicts whose merge resolution rerere will record.
+
+'remaining'::
+
+Print paths with conflicts that have not been autoresolved by rerere.
+This includes paths whose resolutions cannot be tracked by rerere,
+such as conflicting submodules.
 
 'gc'::
 
-This prunes records of conflicted merges that
+Prune records of conflicted merges that
 occurred a long time ago.  By default, unresolved conflicts older
 than 15 days and resolved conflicts older than 60
 days are pruned.  These defaults are controlled via the
index b257d80c756cb7bf45ff1a57abd5488e3ad8f5f6..d5b7667c15ef45e371b3fd3c4ecdf513f8f7cc02 100644 (file)
@@ -44,9 +44,10 @@ unreleased) version of git, that is available from 'master'
 branch of the `git.git` repository.
 Documentation for older releases are available here:
 
-* link:v1.7.9.3/git.html[documentation for release 1.7.9.3]
+* link:v1.7.9.4/git.html[documentation for release 1.7.9.4]
 
 * release notes for
+  link:RelNotes/1.7.9.4.txt[1.7.9.4],
   link:RelNotes/1.7.9.3.txt[1.7.9.3],
   link:RelNotes/1.7.9.2.txt[1.7.9.2],
   link:RelNotes/1.7.9.1.txt[1.7.9.1],
index f28ceef12ee604c1dad66fdb981df624d52d3e1e..1c06cec047aec084453954b87718fbd4abf87c2b 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 GVF=GIT-VERSION-FILE
-DEF_VER=v1.7.10-rc0
+DEF_VER=v1.7.10-rc1
 
 LF='
 '
index f9463deec2f5a5875ee9870e67c990a2fea942db..b58a2e1eb28d0eb94cc6863c64af7e0ac816caea 100644 (file)
@@ -35,8 +35,6 @@ static void prune_dir(int i, DIR *dir, char *pathname, int len, int opts)
                        unlink_or_warn(pathname);
                display_progress(progress, i + 1);
        }
-       pathname[len] = 0;
-       rmdir(pathname);
 }
 
 void prune_packed_objects(int opts)
@@ -65,6 +63,8 @@ void prune_packed_objects(int opts)
                        continue;
                prune_dir(i, d, pathname, len + 3, opts);
                closedir(d);
+               pathname[len + 2] = '\0';
+               rmdir(pathname);
        }
        stop_progress(&progress);
 }
index 58d7cb83240ecef7ab3ff82f3aa92959ec7a62fe..b99b635e44f6145395b5c761505099c0a0f5b6cc 100644 (file)
@@ -85,9 +85,9 @@ static int prune_dir(int i, char *path)
                }
                fprintf(stderr, "bad sha1 file: %s/%s\n", path, de->d_name);
        }
+       closedir(dir);
        if (!show_only)
                rmdir(path);
-       closedir(dir);
        return 0;
 }
 
index 28c21743381db95f6ddb4b185ec34cdbff686866..986789f706911d122e24b0d784ab193e2ec3b74b 100644 (file)
@@ -58,6 +58,14 @@ static int verify_tag(const char *name, int verbose)
        return ret;
 }
 
+static int git_verify_tag_config(const char *var, const char *value, void *cb)
+{
+       int status = git_gpg_config(var, value, cb);
+       if (status)
+               return status;
+       return git_default_config(var, value, cb);
+}
+
 int cmd_verify_tag(int argc, const char **argv, const char *prefix)
 {
        int i = 1, verbose = 0, had_error = 0;
@@ -66,7 +74,7 @@ int cmd_verify_tag(int argc, const char **argv, const char *prefix)
                OPT_END()
        };
 
-       git_config(git_default_config, NULL);
+       git_config(git_verify_tag_config, NULL);
 
        argc = parse_options(argc, argv, prefix, verify_tag_options,
                             verify_tag_usage, PARSE_OPT_KEEP_ARGV0);
index ad0390819d2701d6153adf9db2947ee4908742ce..68d32940f3f8f1512fa36702beb98c2457ca5d46 100644 (file)
--- a/config.c
+++ b/config.c
@@ -196,8 +196,10 @@ static char *parse_value(void)
        for (;;) {
                int c = get_next_char();
                if (c == '\n') {
-                       if (quote)
+                       if (quote) {
+                               cf->linenr--;
                                return NULL;
+                       }
                        return cf->value.buf;
                }
                if (comment)
@@ -287,7 +289,7 @@ static int get_extended_base_var(char *name, int baselen, int c)
 {
        do {
                if (c == '\n')
-                       return -1;
+                       goto error_incomplete_line;
                c = get_next_char();
        } while (isspace(c));
 
@@ -299,13 +301,13 @@ static int get_extended_base_var(char *name, int baselen, int c)
        for (;;) {
                int c = get_next_char();
                if (c == '\n')
-                       return -1;
+                       goto error_incomplete_line;
                if (c == '"')
                        break;
                if (c == '\\') {
                        c = get_next_char();
                        if (c == '\n')
-                               return -1;
+                               goto error_incomplete_line;
                }
                name[baselen++] = c;
                if (baselen > MAXNAME / 2)
@@ -316,6 +318,9 @@ static int get_extended_base_var(char *name, int baselen, int c)
        if (get_next_char() != ']')
                return -1;
        return baselen;
+error_incomplete_line:
+       cf->linenr--;
+       return -1;
 }
 
 static int get_base_var(char *name)
index 0bd290b4ae990df4e0553700fa4fa38696e2b980..4da0ddafc4bf2029823148e7285085661c134497 100755 (executable)
--- a/git-am.sh
+++ b/git-am.sh
@@ -380,7 +380,9 @@ do
        -i|--interactive)
                interactive=t ;;
        -b|--binary)
-               : ;;
+               echo >&2 "The $1 option has been a no-op for long time, and"
+               echo >&2 "it will be removed. Please do not use it anymore."
+               ;;
        -3|--3way)
                threeway=t ;;
        -s|--signoff)
index d5fae993b0c093bdd07079101df303c2c74deae3..6a27f6813624e10b479cae244ad3bb9d2127ff6d 100644 (file)
@@ -21,7 +21,7 @@ GIT_INTERNAL_GETTEXT_SH_SCHEME=fallthrough
 if test -n "@@USE_GETTEXT_SCHEME@@"
 then
        GIT_INTERNAL_GETTEXT_SH_SCHEME="@@USE_GETTEXT_SCHEME@@"
-elif test -n "@@USE_FALLTHROUGH_GETTEXT_SCHEME@@$GIT_INTERNAL_GETTEXT_TEST_FALLBACKS"
+elif test -n "$GIT_INTERNAL_GETTEXT_TEST_FALLBACKS"
 then
        : no probing necessary
 elif test -n "$GIT_GETTEXT_POISON"
index 9bb2e13e929c824a75c648966aaaa61672b9c445..efc86ad4e0b90edbbf5a927aa87e7ad4b1a1949e 100755 (executable)
@@ -132,46 +132,46 @@ module_clone()
        gitdir_base=
        name=$(module_name "$path" 2>/dev/null)
        test -n "$name" || name="$path"
-       base_path=$(dirname "$path")
+       base_name=$(dirname "$name")
 
        gitdir=$(git rev-parse --git-dir)
-       gitdir_base="$gitdir/modules/$base_path"
-       gitdir="$gitdir/modules/$path"
-
-       case $gitdir in
-       /*)
-               a="$(cd_to_toplevel && pwd)/"
-               b=$gitdir
-               while [ "$b" ] && [ "${a%%/*}" = "${b%%/*}" ]
-               do
-                       a=${a#*/} b=${b#*/};
-               done
-
-               rel="$a$name"
-               rel=`echo $rel | sed -e 's|[^/]*|..|g'`
-               rel_gitdir="$rel/$b"
-               ;;
-       *)
-               rel=`echo $name | sed -e 's|[^/]*|..|g'`
-               rel_gitdir="$rel/$gitdir"
-               ;;
-       esac
+       gitdir_base="$gitdir/modules/$base_name"
+       gitdir="$gitdir/modules/$name"
 
        if test -d "$gitdir"
        then
                mkdir -p "$path"
-               echo "gitdir: $rel_gitdir" >"$path/.git"
                rm -f "$gitdir/index"
        else
                mkdir -p "$gitdir_base"
-               if test -n "$reference"
-               then
-                       git-clone $quiet "$reference" -n "$url" "$path" --separate-git-dir "$gitdir"
-               else
-                       git-clone $quiet -n "$url" "$path" --separate-git-dir "$gitdir"
-               fi ||
+               git clone $quiet -n ${reference:+"$reference"} \
+                       --separate-git-dir "$gitdir" "$url" "$path" ||
                die "$(eval_gettext "Clone of '\$url' into submodule path '\$path' failed")"
        fi
+
+       a=$(cd "$gitdir" && pwd)/
+       b=$(cd "$path" && pwd)/
+       # normalize Windows-style absolute paths to POSIX-style absolute paths
+       case $a in [a-zA-Z]:/*) a=/${a%%:*}${a#*:} ;; esac
+       case $b in [a-zA-Z]:/*) b=/${b%%:*}${b#*:} ;; esac
+       # Remove all common leading directories after a sanity check
+       if test "${a#$b}" != "$a" || test "${b#$a}" != "$b"; then
+               die "$(eval_gettext "Gitdir '\$a' is part of the submodule path '\$b' or vice versa")"
+       fi
+       while test "${a%%/*}" = "${b%%/*}"
+       do
+               a=${a#*/}
+               b=${b#*/}
+       done
+       # Now chop off the trailing '/'s that were added in the beginning
+       a=${a%/}
+       b=${b%/}
+
+       rel=$(echo $b | sed -e 's|[^/]*|..|g')
+       echo "gitdir: $rel/$a" >"$path/.git"
+
+       rel=$(echo $a | sed -e 's|[^/]*|..|g')
+       (clear_local_git_env; cd "$path" && GIT_WORK_TREE=. git config core.worktree "$rel/$b")
 }
 
 #
index cd98888a9325889ce1c8e06124c31ea5da2eea87..a8b5fad26631207fcc17a6339ba735877c0902bd 100755 (executable)
@@ -3073,15 +3073,15 @@ sub filter_forks_from_projects_list {
 sub search_projects_list {
        my ($projlist, %opts) = @_;
        my $tagfilter  = $opts{'tagfilter'};
-       my $searchtext = $opts{'searchtext'};
+       my $search_re = $opts{'search_regexp'};
 
        return @$projlist
-               unless ($tagfilter || $searchtext);
+               unless ($tagfilter || $search_re);
 
        # searching projects require filling to be run before it;
        fill_project_list_info($projlist,
                               $tagfilter  ? 'ctags' : (),
-                              $searchtext ? ('path', 'descr') : ());
+                              $search_re ? ('path', 'descr') : ());
        my @projects;
  PROJECT:
        foreach my $pr (@$projlist) {
@@ -3092,10 +3092,10 @@ sub search_projects_list {
                                grep { lc($_) eq lc($tagfilter) } keys %{$pr->{'ctags'}};
                }
 
-               if ($searchtext) {
+               if ($search_re) {
                        next unless
-                               $pr->{'path'} =~ /$searchtext/ ||
-                               $pr->{'descr_long'} =~ /$searchtext/;
+                               $pr->{'path'} =~ /$search_re/ ||
+                               $pr->{'descr_long'} =~ /$search_re/;
                }
 
                push @projects, $pr;
@@ -5484,16 +5484,16 @@ sub git_project_list_body {
        my $show_ctags  = gitweb_check_feature('ctags');
        my $tagfilter = $show_ctags ? $input_params{'ctag'} : undef;
        $check_forks = undef
-               if ($tagfilter || $searchtext);
+               if ($tagfilter || $search_regexp);
 
        # filtering out forks before filling info allows to do less work
        @projects = filter_forks_from_projects_list(\@projects)
                if ($check_forks);
        # search_projects_list pre-fills required info
        @projects = search_projects_list(\@projects,
-                                        'searchtext' => $searchtext,
+                                        'search_regexp' => $search_regexp,
                                         'tagfilter'  => $tagfilter)
-               if ($tagfilter || $searchtext);
+               if ($tagfilter || $search_regexp);
        # fill the rest
        @projects = fill_project_list_info(\@projects);
 
index 2ca4aaccb8a0a64513d1ab711895c8769ca2761e..cf8e1efce7cd29679c3ffdb2fa7d03489c38c1c9 100755 (executable)
@@ -38,4 +38,18 @@ test_expect_success 'test_export works with weird vars' '
        test "$bar" = "weird # variable"
 '
 
+test_perf 'important variables available in subshells' '
+       test -n "$HOME" &&
+       test -n "$TEST_DIRECTORY" &&
+       test -n "$TRASH_DIRECTORY" &&
+       test -n "$GIT_BUILD_DIR"
+'
+
+test_perf 'test-lib-functions correctly loaded in subshells' '
+       : >a &&
+       test_path_is_file a &&
+       : >b &&
+       test_cmp a b
+'
+
 test_done
index d6e505c78c26babc6173db2b853f829444290d1a..7e00c9da47d7a37e498a2b2326578f79a4c33e4f 100755 (executable)
@@ -7,7 +7,7 @@ test_description="Tests diff generation performance"
 test_perf_default_repo
 
 test_perf 'log -3000 (baseline)' '
-       git log -1000 >/dev/null
+       git log -3000 >/dev/null
 '
 
 test_perf 'log --raw -3000 (tree-only)' '
index 2a5e1f354d6f5d98d7dc0db74395f399df03b15b..5580c22812be1cadd6b70974eb85ce7cda1b8df3 100644 (file)
@@ -45,6 +45,10 @@ TEST_NO_CREATE_REPO=t
 
 . ../test-lib.sh
 
+# Variables from test-lib that are normally internal to the tests; we
+# need to export them for test_perf subshells
+export TEST_DIRECTORY TRASH_DIRECTORY GIT_BUILD_DIR GIT_TEST_CMP
+
 perf_results_dir=$TEST_OUTPUT_DIRECTORY/test-results
 mkdir -p "$perf_results_dir"
 rm -f "$perf_results_dir"/$(basename "$0" .sh).subtests
@@ -119,7 +123,7 @@ test_run_perf_ () {
        test_export_="test_cleanup"
        export test_cleanup test_export_
        /usr/bin/time -f "%E %U %S" -o test_time.$i "$SHELL" -c '
-. '"$TEST_DIRECTORY"/../test-lib-functions.sh'
+. '"$TEST_DIRECTORY"/test-lib-functions.sh'
 test_export () {
        [ $# != 0 ] || return 0
        test_export_="$test_export_\\|$1"
index 189af90c02f1f9205567df9a3408a8c0363396a4..8437e51eb545f5c31ad506adfee863f76db27fa5 100755 (executable)
@@ -7,6 +7,10 @@ test_description="Gettext reencoding of our *.po/*.mo files works"
 
 . ./lib-gettext.sh
 
+# The constants used in a tricky observation for undefined behaviour
+RUNES="TILRAUN: ᚻᛖ ᚳᚹᚫᚦ ᚦᚫᛏ ᚻᛖ ᛒᚢᛞᛖ ᚩᚾ ᚦᚫᛗ ᛚᚪᚾᛞᛖ ᚾᚩᚱᚦᚹᛖᚪᚱᛞᚢᛗ ᚹᛁᚦ ᚦᚪ ᚹᛖᛥᚫ"
+PUNTS="TILRAUN: ?? ???? ??? ?? ???? ?? ??? ????? ??????????? ??? ?? ????"
+MSGKEY="TEST: Old English Runes"
 
 test_expect_success GETTEXT_LOCALE 'gettext: Emitting UTF-8 from our UTF-8 *.mo files / Icelandic' '
     printf "TILRAUN: Halló Heimur!" >expect &&
@@ -15,8 +19,8 @@ test_expect_success GETTEXT_LOCALE 'gettext: Emitting UTF-8 from our UTF-8 *.mo
 '
 
 test_expect_success GETTEXT_LOCALE 'gettext: Emitting UTF-8 from our UTF-8 *.mo files / Runes' '
-    printf "TILRAUN: ᚻᛖ ᚳᚹᚫᚦ ᚦᚫᛏ ᚻᛖ ᛒᚢᛞᛖ ᚩᚾ ᚦᚫᛗ ᛚᚪᚾᛞᛖ ᚾᚩᚱᚦᚹᛖᚪᚱᛞᚢᛗ ᚹᛁᚦ ᚦᚪ ᚹᛖᛥᚫ" >expect &&
-    LANGUAGE=is LC_ALL="$is_IS_locale" gettext "TEST: Old English Runes" >actual &&
+    printf "%s" "$RUNES" >expect &&
+    LANGUAGE=is LC_ALL="$is_IS_locale" gettext "$MSGKEY" >actual &&
     test_cmp expect actual
 '
 
@@ -26,18 +30,23 @@ test_expect_success GETTEXT_ISO_LOCALE 'gettext: Emitting ISO-8859-1 from our UT
     test_cmp expect actual
 '
 
-test_expect_success GETTEXT_ISO_LOCALE 'gettext: Emitting ISO-8859-1 from our UTF-8 *.mo files / Runes' '
-    LANGUAGE=is LC_ALL="$is_IS_iso_locale" gettext "TEST: Old English Runes" >runes &&
-
-       if grep "^TEST: Old English Runes$" runes
-       then
-               say "Your system can not handle this complexity and returns the string as-is"
-       else
-               # Both Solaris and GNU libintl will return this stream of
-               # question marks, so it is s probably portable enough
-               printf "TILRAUN: ?? ???? ??? ?? ???? ?? ??? ????? ??????????? ??? ?? ????" >runes-expect &&
-               test_cmp runes-expect runes
-       fi
+test_expect_success GETTEXT_ISO_LOCALE 'gettext: impossible ISO-8859-1 output' '
+       LANGUAGE=is LC_ALL="$is_IS_iso_locale" gettext "$MSGKEY" >runes &&
+       case "$(cat runes)" in
+       "$MSGKEY")
+               say "Your system gives back the key to message catalog"
+               ;;
+       "$PUNTS")
+               say "Your system replaces an impossible character with ?"
+               ;;
+       "$RUNES")
+               say "Your system gives back the raw message for an impossible request"
+               ;;
+       *)
+               say "We never saw the error behaviour your system exhibits"
+               false
+               ;;
+       esac
 '
 
 test_expect_success GETTEXT_LOCALE 'gettext: Fetching a UTF-8 msgid -> UTF-8' '
index 5f249f681e9324d7d35e3aee4dc9a834beff6c75..36e227b3bb25cb17dabc5e205e63056e7fd0b370 100755 (executable)
@@ -985,4 +985,35 @@ test_expect_success 'git config --edit respects core.editor' '
        test_cmp expect actual
 '
 
+# malformed configuration files
+test_expect_success 'barf on syntax error' '
+       cat >.git/config <<-\EOF &&
+       # broken section line
+       [section]
+       key garbage
+       EOF
+       test_must_fail git config --get section.key >actual 2>error &&
+       grep " line 3 " error
+'
+
+test_expect_success 'barf on incomplete section header' '
+       cat >.git/config <<-\EOF &&
+       # broken section line
+       [section
+       key = value
+       EOF
+       test_must_fail git config --get section.key >actual 2>error &&
+       grep " line 2 " error
+'
+
+test_expect_success 'barf on incomplete string' '
+       cat >.git/config <<-\EOF &&
+       # broken section line
+       [section]
+       key = "value string
+       EOF
+       test_must_fail git config --get section.key >actual 2>error &&
+       grep " line 3 " error
+'
+
 test_done
index 695f7afdf31cc589e9c31d764d1e713ad64240c0..b377a7af28c9dde11bd4cf6adcf0d7eae31a0754 100755 (executable)
@@ -79,6 +79,15 @@ test_expect_success 'submodule add' '
                cd addtest &&
                git submodule add -q "$submodurl" submod >actual &&
                test ! -s actual &&
+               echo "gitdir: ../.git/modules/submod" >expect &&
+               test_cmp expect submod/.git &&
+               (
+                       cd submod &&
+                       git config core.worktree >actual &&
+                       echo "../../../submod" >expect &&
+                       test_cmp expect actual &&
+                       rm -f actual expect
+               ) &&
                git submodule init
        ) &&
 
@@ -498,4 +507,17 @@ test_expect_success 'relative path works with user@host:path' '
        )
 '
 
+test_expect_success 'moving the superproject does not break submodules' '
+       (
+               cd addtest &&
+               git submodule status >expect
+       )
+       mv addtest addtest2 &&
+       (
+               cd addtest2 &&
+               git submodule status >actual &&
+               test_cmp expect actual
+       )
+'
+
 test_done
index 5b97222c48a15dff018cb814ca14c59ed0ee91a2..dcb195b4cf67af3cf5ce94d0f5ca75bf94664b9a 100755 (executable)
@@ -619,4 +619,21 @@ test_expect_success 'submodule add properly re-creates deeper level submodules'
        )
 '
 
+test_expect_success 'submodule update properly revives a moved submodule' '
+       (cd super &&
+        git commit -am "pre move" &&
+        git status >expect&&
+        H=$(cd submodule2; git rev-parse HEAD) &&
+        git rm --cached submodule2 &&
+        rm -rf submodule2 &&
+        mkdir -p "moved/sub module" &&
+        git update-index --add --cacheinfo 160000 $H "moved/sub module" &&
+        git config -f .gitmodules submodule.submodule2.path "moved/sub module"
+        git commit -am "post move" &&
+        git submodule update &&
+        git status >actual &&
+        test_cmp expect actual
+       )
+'
+
 test_done