Merge https://github.com/git-l10n/git-po
authorJunio C Hamano <gitster@pobox.com>
Mon, 12 Mar 2012 16:03:20 +0000 (09:03 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 12 Mar 2012 16:03:20 +0000 (09:03 -0700)
Updates to localized messages for zn_CN and sv locales.

via Jiang Xin
* https://github.com/git-l10n/git-po:
l10n: Improve zh_CN translation for msg "not something we can merge"
l10n: Improve zh_CN trans for msg that cannot fast-forward
l10n: Update zh_CN translation for 1.7.10-rc0
Update Swedish translation (732t0f0u).
po/sv.po: add Swedish translation
l10n: Update git.pot (1 new message)
l10n: Update zh_CN translation for 1.7.9.2
l10n: Improve commit msg for zh_CN translation
l10n: Improve zh_CN translation for msg that make empty commit when amend.
l10n: Improve zh_CN translation for empty cherry-pick msg.
l10n: Improve zh_CN translation for msg about branch deletion deny
l10n: Improve zh_CN translation for lines insertion and deletion.

Documentation/RelNotes/1.7.10.txt
Documentation/git-branch.txt
builtin/prune-packed.c
builtin/prune.c
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/t7400-submodule-basic.sh
t/t7406-submodule-update.sh
index ae446e0c2cde17d10e0552ac07cdb2e1521b54f0..a8fd0ace4739e48f3a29e7e39f094f1fbf5e4713 100644 (file)
@@ -43,20 +43,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 +74,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 +88,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 +104,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
@@ -149,6 +158,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.
 
 
@@ -179,9 +192,14 @@ details).
    accessed in a repository whose HEAD does not point at a valid
    branch.
 
+ * "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.
+   (merge e65ceb6 jn/maint-do-not-match-with-unsanitized-searchtext later to maint).
+
 ---
 exec >/var/tmp/1
-O=v1.7.9.3-366-g1e4d087
+O=v1.7.10-rc0-15-g9a4c97e
 echo O=$(git describe)
 git log --first-parent --oneline ^maint $O..
 echo
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 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 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 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