Merge branch 'master' of git://github.com/git-l10n/git-po
authorJiang Xin <worldhello.net@gmail.com>
Sun, 18 Jan 2015 03:24:00 +0000 (11:24 +0800)
committerJiang Xin <worldhello.net@gmail.com>
Sun, 18 Jan 2015 03:24:00 +0000 (11:24 +0800)
* 'master' of git://github.com/git-l10n/git-po:
l10n: de.po: translate 13 new messages
l10n: de.po: fix typo
l10n: de.po: translate "track" as "versionieren"
l10n: zh_CN: translations for git v2.3.0-rc0
l10n: sv.po: Update Swedish translation (2298t0f0u)
l10n: fr.po v2.3.0 round 1
l10n: vi.po(2298t): Updated and change Plural-Forms
l10n: git.pot: v2.3.0 round 1 (13 new, 11 removed)
l10n: ca.po: various fixes

27 files changed:
Documentation/RelNotes/2.3.0.txt
Documentation/config.txt
Documentation/git-add.txt
Documentation/git-send-email.txt
Makefile
builtin/cat-file.c
builtin/for-each-ref.c
builtin/log.c
builtin/remote.c
builtin/show-branch.c
config.mak.uname
configure.ac
contrib/completion/git-completion.bash
contrib/completion/git-prompt.sh
contrib/subtree/git-subtree.txt
git-compat-util.h
git-svn.perl
git.c
imap-send.c
perl/Git/SVN.pm
server-info.c
t/t1301-shared-repo.sh
t/t5505-remote.sh
t/t6300-for-each-ref.sh
t/t9903-bash-prompt.sh
t/test-lib.sh
trace.c
index 72db8d211fbf94ae94f8f372237b4b1de153b932..72ef007a002176708bbbac28692ec4aabfa80dcc 100644 (file)
@@ -9,6 +9,10 @@ Ports
  * Recent gcc toolchain on Cygwin started throwing compilation warning,
    which has been squelched.
 
+ * A few updates to build on platforms that lack tv_nsec,
+   clock_gettime, CLOCK_MONOTONIC and HMAC_CTX_cleanup (e.g. older
+   RHEL) have been added.
+
 
 UI, Workflows & Features
 
@@ -66,11 +70,21 @@ UI, Workflows & Features
  * "git imap-send" learned to take "-v" (verbose) and "-q" (quiet)
    command line options.
 
+ * "git remote add $name $URL" is now allowed when "url.$URL.insteadOf"
+   is already defined.
+
  * "git imap-send" now can be built to use cURL library to talk to
    IMAP servers (if the library is recent enough, of course).
    This allows you to use authenticate method other than CRAM-MD5,
    among other things.
 
+ * "git imap-send" now allows GIT_CURL_VERBOSE environment variable to
+   control the verbosity when talking via the cURL library.
+
+ * The prompt script (in contrib/) learned to optionally hide prompt
+   when in an ignored directory by setting GIT_PS1_HIDE_IF_PWD_IGNORED
+   shell variable.
+
 
 Performance, Internal Implementation, Development Support etc.
 
@@ -139,8 +153,7 @@ notes for details).
    the last command in the prompt, e.g.  PS1='$(__git_ps1) $? ', did
    not work well, because the helper function stomped on the exit
    status.
-   (merge eb443e3 tf/prompt-preserve-exit-status later to maint).
-
+   (merge 6babe76 tf/prompt-preserve-exit-status later to maint).
 
  * Recent update to "git commit" broke amending an existing commit
    with bogus author/committer lines without a valid e-mail address.
@@ -249,6 +262,10 @@ notes for details).
    configuration file .git/config with x-bit by mistake.
    (merge 1f32ecf mh/config-flip-xbit-back-after-checking later to maint).
 
+ * Recent update in Git 2.2 started creating objects/info/packs and
+   info/refs files with permission bits tighter than user's umask.
+   (merge d91175b jk/prune-packed-server-info later to maint).
+
  * Git 2.0 was supposed to make the "simple" mode for the default of
    "git push", but it didn't.
    (merge 00a6fa0 jk/push-simple later to maint).
@@ -262,3 +279,11 @@ notes for details).
  * The build procedure did not bother fixing perl and python scripts
    when NO_PERL and NO_PYTHON build-time configuration changed.
    (merge ca2051d jk/rebuild-perl-scripts-with-no-perl-seting-change later to maint).
+
+ * The usage string of "git log" command was marked incorrectly for
+   l10n.
+   (merge e66dc0c km/log-usage-string-i18n later to maint).
+
+ * "git for-each-ref" mishandled --format="%(upstream:track)" when a
+   branch is marked to have forked from a non-existing branch.
+   (merge b6160d9 rc/for-each-ref-tracking later to maint).
index cc887b1279cb04c33cc2e67c373c6ed61daff520..04e2a71687922bbf78a493df6ca6dc5730359eb1 100644 (file)
@@ -375,14 +375,19 @@ This is useful for excluding servers inside a firewall from
 proxy use, while defaulting to a common proxy for external domains.
 
 core.ignoreStat::
-       If true, commands which modify both the working tree and the index
-       will mark the updated paths with the "assume unchanged" bit in the
-       index. These marked files are then assumed to stay unchanged in the
-       working tree, until you mark them otherwise manually - Git will not
-       detect the file changes by lstat() calls. This is useful on systems
-       where those are very slow, such as Microsoft Windows.
-       See linkgit:git-update-index[1].
-       False by default.
+       If true, Git will avoid using lstat() calls to detect if files have
+       changed by setting the "assume-unchanged" bit for those tracked files
+       which it has updated identically in both the index and working tree.
++
+When files are modified outside of Git, the user will need to stage
+the modified files explicitly (e.g. see 'Examples' section in
+linkgit:git-update-index[1]).
+Git will not normally detect changes to those files.
++
+This is useful on systems where lstat() calls are very slow, such as
+CIFS/Microsoft Windows.
++
+False by default.
 
 core.preferSymlinkRefs::
        Instead of the default "symref" format for HEAD
index 96315261102953b8f34694e0a793f023eea795f5..1c74907dd4c9021f41d88cf9f766c4855c0d6f97 100644 (file)
@@ -8,7 +8,7 @@ git-add - Add file contents to the index
 SYNOPSIS
 --------
 [verse]
-'git add' [-n] [-v] [--force | -f] [--interactive | -i] [--patch | -p]
+'git add' [--verbose | -v] [--dry-run | -n] [--force | -f] [--interactive | -i] [--patch | -p]
          [--edit | -e] [--[no-]all | --[no-]ignore-removal | [--update | -u]]
          [--intent-to-add | -N] [--refresh] [--ignore-errors] [--ignore-missing]
          [--] [<pathspec>...]
index e04849e3961257500f86441611e738e9b4d0f330..f248a8665e1f775edb6932af69b68b7081e1687c 100644 (file)
@@ -214,10 +214,15 @@ must be used for each option.
        Legacy alias for '--smtp-encryption ssl'.
 
 --smtp-ssl-cert-path::
-       Path to ca-certificates (either a directory or a single file).
-       Set it to an empty string to disable certificate verification.
-       Defaults to the value set to the 'sendemail.smtpsslcertpath'
-       configuration variable, if set, or `/etc/ssl/certs` otherwise.
+       Path to a store of trusted CA certificates for SMTP SSL/TLS
+       certificate validation (either a directory that has been processed
+       by 'c_rehash', or a single file containing one or more PEM format
+       certificates concatenated together: see verify(1) -CAfile and
+       -CApath for more information on these). Set it to an empty string
+       to disable certificate verification. Defaults to the value of the
+       'sendemail.smtpsslcertpath' configuration variable, if set, or the
+       backing SSL library's compiled-in default otherwise (which should
+       be the best choice on most platforms).
 
 --smtp-user=<user>::
        Username for SMTP-AUTH. Default is the value of 'sendemail.smtpuser';
index 06e5d24312e47e9a6e7e33def74c70f54c21f2e1..c44eb3a8511c1d179113c241245f4a0ba8dc2787 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -343,6 +343,11 @@ all::
 # return NULL when it receives a bogus time_t.
 #
 # Define HAVE_CLOCK_GETTIME if your platform has clock_gettime in librt.
+#
+# Define HAVE_CLOCK_MONOTONIC if your platform has CLOCK_MONOTONIC in librt.
+#
+# Define NO_HMAC_CTX_CLEANUP if your OpenSSL is version 0.9.6b or earlier to
+# cleanup the HMAC context with the older HMAC_cleanup function.
 
 GIT-VERSION-FILE: FORCE
        @$(SHELL_PATH) ./GIT-VERSION-GEN
@@ -1075,6 +1080,9 @@ ifndef NO_OPENSSL
        ifdef NEEDS_CRYPTO_WITH_SSL
                OPENSSL_LIBSSL += -lcrypto
        endif
+       ifdef NO_HMAC_CTX_CLEANUP
+               BASIC_CFLAGS += -DNO_HMAC_CTX_CLEANUP
+       endif
 else
        BASIC_CFLAGS += -DNO_OPENSSL
        BLK_SHA1 = 1
@@ -1402,6 +1410,10 @@ ifdef HAVE_CLOCK_GETTIME
        EXTLIBS += -lrt
 endif
 
+ifdef HAVE_CLOCK_MONOTONIC
+       BASIC_CFLAGS += -DHAVE_CLOCK_MONOTONIC
+endif
+
 ifeq ($(TCLTK_PATH),)
 NO_TCLTK = NoThanks
 endif
index f8d81291b9913a769f79405720210aa4eaf6daee..750b5a24b4e7c1781adde09ac2717f7cbf02b872 100644 (file)
@@ -4,12 +4,8 @@
  * Copyright (C) Linus Torvalds, 2005
  */
 #include "cache.h"
-#include "exec_cmd.h"
-#include "tag.h"
-#include "tree.h"
 #include "builtin.h"
 #include "parse-options.h"
-#include "diff.h"
 #include "userdiff.h"
 #include "streaming.h"
 
index f3ce004d53c55e3f53d6a90d21d2877368676f08..a0123f6146b53de295d01b438b72fb3dc7d76a0c 100644 (file)
@@ -717,7 +717,10 @@ static void populate_value(struct refinfo *ref)
                                 starts_with(name, "upstream")) {
                                char buf[40];
 
-                               stat_tracking_info(branch, &num_ours, &num_theirs);
+                               if (stat_tracking_info(branch, &num_ours,
+                                                      &num_theirs) != 1)
+                                       continue;
+
                                if (!num_ours && !num_theirs)
                                        v->s = "";
                                else if (!num_ours) {
@@ -735,7 +738,11 @@ static void populate_value(struct refinfo *ref)
                        } else if (!strcmp(formatp, "trackshort") &&
                                   starts_with(name, "upstream")) {
                                assert(branch);
-                               stat_tracking_info(branch, &num_ours, &num_theirs);
+
+                               if (stat_tracking_info(branch, &num_ours,
+                                                       &num_theirs) != 1)
+                                       continue;
+
                                if (!num_ours && !num_theirs)
                                        v->s = "=";
                                else if (!num_ours)
index f2a9f0156d8a8b15c7c879355b137b669dea8cf2..923ffe72ced41f12a2258f732be418731bc2e4a8 100644 (file)
@@ -38,8 +38,8 @@ static const char *fmt_patch_subject_prefix = "PATCH";
 static const char *fmt_pretty;
 
 static const char * const builtin_log_usage[] = {
-       N_("git log [<options>] [<revision range>] [[--] <path>...]\n")
-       N_("   or: git show [options] <object>..."),
+       N_("git log [<options>] [<revision range>] [[--] <path>...]"),
+       N_("git show [options] <object>..."),
        NULL
 };
 
index 46ecfd9f7b0dd0b28169341d14132df376e509bc..b4ff4689770e402675faba2ce400150b4803a360 100644 (file)
@@ -180,7 +180,9 @@ static int add(int argc, const char **argv)
        url = argv[1];
 
        remote = remote_get(name);
-       if (remote && (remote->url_nr > 1 || strcmp(name, remote->url[0]) ||
+       if (remote && (remote->url_nr > 1 ||
+                       (strcmp(name, remote->url[0]) &&
+                               strcmp(url, remote->url[0])) ||
                        remote->fetch_refspec_nr))
                die(_("remote %s already exists."), name);
 
index 270e39c6c1b0855181a19b12739425035db9ad1d..691eeda345361bea8be20d73b32b312b08b58a4e 100644 (file)
@@ -6,7 +6,10 @@
 #include "parse-options.h"
 
 static const char* show_branch_usage[] = {
-    N_("git show-branch [-a|--all] [-r|--remotes] [--topo-order | --date-order] [--current] [--color[=<when>] | --no-color] [--sparse] [--more=<n> | --list | --independent | --merge-base] [--no-name | --sha1-name] [--topics] [(<rev> | <glob>)...]"),
+    N_("git show-branch [-a|--all] [-r|--remotes] [--topo-order | --date-order]\n"
+       "                      [--current] [--color[=<when>] | --no-color] [--sparse]\n"
+       "                      [--more=<n> | --list | --independent | --merge-base]\n"
+       "              [--no-name | --sha1-name] [--topics] [(<rev> | <glob>)...]"),
     N_("git show-branch (-g|--reflog)[=<n>[,<base>]] [--list] [<ref>]"),
     NULL
 };
index f3c93f27c945193754090e97c2070c9e66759f02..b64b63c34c315561110c5d9f3e334ebd633d095b 100644 (file)
@@ -35,6 +35,7 @@ ifeq ($(uname_S),Linux)
        LIBC_CONTAINS_LIBINTL = YesPlease
        HAVE_DEV_TTY = YesPlease
        HAVE_CLOCK_GETTIME = YesPlease
+       HAVE_CLOCK_MONOTONIC = YesPlease
 endif
 ifeq ($(uname_S),GNU/kFreeBSD)
        HAVE_ALLOCA_H = YesPlease
index 5c1312f24a247fca9bdd7dc9d66aa05f8a7c60d5..55e5a9b3e6c39f15d9d4cf419a72ee963713b662 100644 (file)
@@ -754,6 +754,19 @@ AC_CHECK_TYPES([struct itimerval],
 [#include <sys/time.h>])
 GIT_CONF_SUBST([NO_STRUCT_ITIMERVAL])
 #
+# Define USE_ST_TIMESPEC=YesPlease when stat.st_mtimespec.tv_nsec exists.
+# Define NO_NSEC=YesPlease when neither stat.st_mtim.tv_nsec nor
+# stat.st_mtimespec.tv_nsec exists.
+AC_CHECK_MEMBER([struct stat.st_mtimespec.tv_nsec])
+AC_CHECK_MEMBER([struct stat.st_mtim.tv_nsec])
+if test x$ac_cv_member_struct_stat_st_mtimespec_tv_nsec = xyes; then
+       USE_ST_TIMESPEC=YesPlease
+       GIT_CONF_SUBST([USE_ST_TIMESPEC])
+elif test x$ac_cv_member_struct_stat_st_mtim_tv_nsec != xyes; then
+       NO_NSEC=YesPlease
+       GIT_CONF_SUBST([NO_NSEC])
+fi
+#
 # Define NO_D_INO_IN_DIRENT if you don't have d_ino in your struct dirent.
 AC_CHECK_MEMBER(struct dirent.d_ino,
 [NO_D_INO_IN_DIRENT=],
@@ -934,6 +947,32 @@ AC_CHECK_LIB([iconv], [locale_charset],
                      [CHARSET_LIB=-lcharset])])
 GIT_CONF_SUBST([CHARSET_LIB])
 #
+# Define NO_HMAC_CTX_CLEANUP=YesPlease if HMAC_CTX_cleanup is missing.
+AC_CHECK_LIB([crypto], [HMAC_CTX_cleanup],
+       [], [GIT_CONF_SUBST([NO_HMAC_CTX_CLEANUP], [YesPlease])])
+#
+# Define HAVE_CLOCK_GETTIME=YesPlease if clock_gettime is available.
+GIT_CHECK_FUNC(clock_gettime,
+       [HAVE_CLOCK_GETTIME=YesPlease],
+       [HAVE_CLOCK_GETTIME=])
+GIT_CONF_SUBST([HAVE_CLOCK_GETTIME])
+
+AC_DEFUN([CLOCK_MONOTONIC_SRC], [
+AC_LANG_PROGRAM([[
+#include <time.h>
+clockid_t id = CLOCK_MONOTONIC;
+]])])
+
+#
+# Define HAVE_CLOCK_MONOTONIC=YesPlease if CLOCK_MONOTONIC is available.
+AC_MSG_CHECKING([for CLOCK_MONOTONIC])
+AC_COMPILE_IFELSE([CLOCK_MONOTONIC_SRC],
+       [AC_MSG_RESULT([yes])
+       HAVE_CLOCK_MONOTONIC=YesPlease],
+       [AC_MSG_RESULT([no])
+       HAVE_CLOCK_MONOTONIC=])
+GIT_CONF_SUBST([HAVE_CLOCK_MONOTONIC])
+#
 # Define NO_SETITIMER if you don't have setitimer.
 GIT_CHECK_FUNC(setitimer,
 [NO_SETITIMER=],
index cd765795ae42edfdf21a054619b64d5c3800f4f6..8cfee95f88006269e4227f98701b9af8587af0bd 100644 (file)
@@ -1693,6 +1693,7 @@ _git_rebase ()
                        --committer-date-is-author-date --ignore-date
                        --ignore-whitespace --whitespace=
                        --autosquash --fork-point --no-fork-point
+                       --autostash
                        "
 
                return
index 3c3fc6d5d94c5dc6a9ec291fc217b590a11c5be3..214e859f99e7d896a6fa45a737b5b3e2a629176f 100644 (file)
 # GIT_PS1_SHOWCOLORHINTS to a nonempty value. The colors are based on
 # the colored output of "git status -sb" and are available only when
 # using __git_ps1 for PROMPT_COMMAND or precmd.
+#
+# If you would like __git_ps1 to do nothing in the case when the current
+# directory is set up to be ignored by git, then set
+# GIT_PS1_HIDE_IF_PWD_IGNORED to a nonempty value. Override this on the
+# repository level by setting bash.hideIfPwdIgnored to "false".
 
 # check whether printf supports -v
 __git_printf_supports_v=
@@ -288,6 +293,7 @@ __git_eread ()
 # In this mode you can request colored hints using GIT_PS1_SHOWCOLORHINTS=true
 __git_ps1 ()
 {
+       # preserve exit status
        local exit=$?
        local pcmode=no
        local detached=no
@@ -300,10 +306,14 @@ __git_ps1 ()
                        ps1pc_start="$1"
                        ps1pc_end="$2"
                        printf_format="${3:-$printf_format}"
+                       # set PS1 to a plain prompt so that we can
+                       # simply return early if the prompt should not
+                       # be decorated
+                       PS1="$ps1pc_start$ps1pc_end"
                ;;
                0|1)    printf_format="${1:-$printf_format}"
                ;;
-               *)      return
+               *)      return $exit
                ;;
        esac
 
@@ -351,11 +361,7 @@ __git_ps1 ()
        rev_parse_exit_code="$?"
 
        if [ -z "$repo_info" ]; then
-               if [ $pcmode = yes ]; then
-                       #In PC mode PS1 always needs to be set
-                       PS1="$ps1pc_start$ps1pc_end"
-               fi
-               return
+               return $exit
        fi
 
        local short_sha
@@ -370,6 +376,14 @@ __git_ps1 ()
        local inside_gitdir="${repo_info##*$'\n'}"
        local g="${repo_info%$'\n'*}"
 
+       if [ "true" = "$inside_worktree" ] &&
+          [ -n "${GIT_PS1_HIDE_IF_PWD_IGNORED-}" ] &&
+          [ "$(git config --bool bash.hideIfPwdIgnored)" != "false" ] &&
+          git check-ignore -q .
+       then
+               return $exit
+       fi
+
        local r=""
        local b=""
        local step=""
@@ -413,10 +427,7 @@ __git_ps1 ()
                else
                        local head=""
                        if ! __git_eread "$g/HEAD" head; then
-                               if [ $pcmode = yes ]; then
-                                       PS1="$ps1pc_start$ps1pc_end"
-                               fi
-                               return
+                               return $exit
                        fi
                        # is it a symbolic ref?
                        b="${head#ref: }"
@@ -513,6 +524,5 @@ __git_ps1 ()
                printf -- "$printf_format" "$gitstring"
        fi
 
-       # preserve exit status
        return $exit
 }
index 8272100ff56973417d426af33687f4e08c4a9e7b..54e4b4a24331045d97d92355b681b675048a5df7 100644 (file)
@@ -81,12 +81,11 @@ merge::
        changes into the latest <commit>.  With '--squash',
        creates only one commit that contains all the changes,
        rather than merging in the entire history.
-
-       If you use '--squash', the merge direction doesn't
-       always have to be forward; you can use this command to
-       go back in time from v2.5 to v2.4, for example.  If your
-       merge introduces a conflict, you can resolve it in the
-       usual ways.
++
+If you use '--squash', the merge direction doesn't always have to be
+forward; you can use this command to go back in time from v2.5 to v2.4,
+for example.  If your merge introduces a conflict, you can resolve it in
+the usual ways.
        
 pull::
        Exactly like 'merge', but parallels 'git pull' in that
@@ -107,21 +106,19 @@ split::
        contents of <prefix> at the root of the project instead
        of in a subdirectory.  Thus, the newly created history
        is suitable for export as a separate git repository.
-       
-       After splitting successfully, a single commit id is
-       printed to stdout.  This corresponds to the HEAD of the
-       newly created tree, which you can manipulate however you
-       want.
-       
-       Repeated splits of exactly the same history are
-       guaranteed to be identical (i.e. to produce the same
-       commit ids).  Because of this, if you add new commits
-       and then re-split, the new commits will be attached as
-       commits on top of the history you generated last time,
-       so 'git merge' and friends will work as expected.
-       
-       Note that if you use '--squash' when you merge, you
-       should usually not just '--rejoin' when you split.
++
+After splitting successfully, a single commit id is printed to stdout.
+This corresponds to the HEAD of the newly created tree, which you can
+manipulate however you want.
++
+Repeated splits of exactly the same history are guaranteed to be
+identical (i.e. to produce the same commit ids).  Because of this, if
+you add new commits and then re-split, the new commits will be attached
+as commits on top of the history you generated last time, so 'git merge'
+and friends will work as expected.
++
+Note that if you use '--squash' when you merge, you should usually not
+just '--rejoin' when you split.
 
 
 OPTIONS
@@ -151,109 +148,96 @@ OPTIONS FOR add, merge, push, pull
 --squash::
        This option is only valid for add, merge, push and pull
        commands.
-
-       Instead of merging the entire history from the subtree
-       project, produce only a single commit that contains all
-       the differences you want to merge, and then merge that
-       new commit into your project.
-       
-       Using this option helps to reduce log clutter. People
-       rarely want to see every change that happened between
-       v1.0 and v1.1 of the library they're using, since none of the
-       interim versions were ever included in their application.
-       
-       Using '--squash' also helps avoid problems when the same
-       subproject is included multiple times in the same
-       project, or is removed and then re-added.  In such a
-       case, it doesn't make sense to combine the histories
-       anyway, since it's unclear which part of the history
-       belongs to which subtree.
-       
-       Furthermore, with '--squash', you can switch back and
-       forth between different versions of a subtree, rather
-       than strictly forward.  'git subtree merge --squash'
-       always adjusts the subtree to match the exactly
-       specified commit, even if getting to that commit would
-       require undoing some changes that were added earlier.
-       
-       Whether or not you use '--squash', changes made in your
-       local repository remain intact and can be later split
-       and send upstream to the subproject.
++
+Instead of merging the entire history from the subtree project, produce
+only a single commit that contains all the differences you want to
+merge, and then merge that new commit into your project.
++
+Using this option helps to reduce log clutter. People rarely want to see
+every change that happened between v1.0 and v1.1 of the library they're
+using, since none of the interim versions were ever included in their
+application.
++
+Using '--squash' also helps avoid problems when the same subproject is
+included multiple times in the same project, or is removed and then
+re-added.  In such a case, it doesn't make sense to combine the
+histories anyway, since it's unclear which part of the history belongs
+to which subtree.
++
+Furthermore, with '--squash', you can switch back and forth between
+different versions of a subtree, rather than strictly forward.  'git
+subtree merge --squash' always adjusts the subtree to match the exactly
+specified commit, even if getting to that commit would require undoing
+some changes that were added earlier.
++
+Whether or not you use '--squash', changes made in your local repository
+remain intact and can be later split and send upstream to the
+subproject.
 
 
 OPTIONS FOR split
 -----------------
 --annotate=<annotation>::
        This option is only valid for the split command.
-
-       When generating synthetic history, add <annotation> as a
-       prefix to each commit message.  Since we're creating new
-       commits with the same commit message, but possibly
-       different content, from the original commits, this can help
-       to differentiate them and avoid confusion.
-       
-       Whenever you split, you need to use the same
-       <annotation>, or else you don't have a guarantee that
-       the new re-created history will be identical to the old
-       one.  That will prevent merging from working correctly. 
-       git subtree tries to make it work anyway, particularly
-       if you use --rejoin, but it may not always be effective.
++
+When generating synthetic history, add <annotation> as a prefix to each
+commit message.  Since we're creating new commits with the same commit
+message, but possibly different content, from the original commits, this
+can help to differentiate them and avoid confusion.
++
+Whenever you split, you need to use the same <annotation>, or else you
+don't have a guarantee that the new re-created history will be identical
+to the old one.  That will prevent merging from working correctly.  git
+subtree tries to make it work anyway, particularly if you use --rejoin,
+but it may not always be effective.
 
 -b <branch>::
 --branch=<branch>::
        This option is only valid for the split command.
-
-       After generating the synthetic history, create a new
-       branch called <branch> that contains the new history. 
-       This is suitable for immediate pushing upstream. 
-       <branch> must not already exist.
++
+After generating the synthetic history, create a new branch called
+<branch> that contains the new history.  This is suitable for immediate
+pushing upstream.  <branch> must not already exist.
 
 --ignore-joins::
        This option is only valid for the split command.
-
-       If you use '--rejoin', git subtree attempts to optimize
-       its history reconstruction to generate only the new
-       commits since the last '--rejoin'.  '--ignore-join'
-       disables this behaviour, forcing it to regenerate the
-       entire history.  In a large project, this can take a
-       long time.
++
+If you use '--rejoin', git subtree attempts to optimize its history
+reconstruction to generate only the new commits since the last
+'--rejoin'.  '--ignore-join' disables this behaviour, forcing it to
+regenerate the entire history.  In a large project, this can take a long
+time.
 
 --onto=<onto>::
        This option is only valid for the split command.
-
-       If your subtree was originally imported using something
-       other than git subtree, its history may not match what
-       git subtree is expecting.  In that case, you can specify
-       the commit id <onto> that corresponds to the first
-       revision of the subproject's history that was imported
-       into your project, and git subtree will attempt to build
-       its history from there.
-       
-       If you used 'git subtree add', you should never need
-       this option.
++
+If your subtree was originally imported using something other than git
+subtree, its history may not match what git subtree is expecting.  In
+that case, you can specify the commit id <onto> that corresponds to the
+first revision of the subproject's history that was imported into your
+project, and git subtree will attempt to build its history from there.
++
+If you used 'git subtree add', you should never need this option.
 
 --rejoin::
        This option is only valid for the split command.
-
-       After splitting, merge the newly created synthetic
-       history back into your main project.  That way, future
-       splits can search only the part of history that has
-       been added since the most recent --rejoin.
-       
-       If your split commits end up merged into the upstream
-       subproject, and then you want to get the latest upstream
-       version, this will allow git's merge algorithm to more
-       intelligently avoid conflicts (since it knows these
-       synthetic commits are already part of the upstream
-       repository).
-       
-       Unfortunately, using this option results in 'git log'
-       showing an extra copy of every new commit that was
-       created (the original, and the synthetic one).
-       
-       If you do all your merges with '--squash', don't use
-       '--rejoin' when you split, because you don't want the
-       subproject's history to be part of your project anyway.
++
+After splitting, merge the newly created synthetic history back into
+your main project.  That way, future splits can search only the part of
+history that has been added since the most recent --rejoin.
++
+If your split commits end up merged into the upstream subproject, and
+then you want to get the latest upstream version, this will allow git's
+merge algorithm to more intelligently avoid conflicts (since it knows
+these synthetic commits are already part of the upstream repository).
++
+Unfortunately, using this option results in 'git log' showing an extra
+copy of every new commit that was created (the original, and the
+synthetic one).
++
+If you do all your merges with '--squash', don't use '--rejoin' when you
+split, because you don't want the subproject's history to be part of
+your project anyway.
 
 
 EXAMPLE 1. Add command
index dcecd857f159357ff7d79cde218895f43795d944..eb9b0ff32829ef62bf2d1af432742841b9720906 100644 (file)
@@ -218,6 +218,9 @@ extern char *gitbasename(char *);
 #include <openssl/err.h>
 #undef MAC_OS_X_VERSION_MIN_REQUIRED
 #undef __AVAILABILITY_MACROS_USES_AVAILABILITY
+#ifdef NO_HMAC_CTX_CLEANUP
+#define HMAC_CTX_cleanup HMAC_cleanup
+#endif
 #endif
 
 /* On most systems <netdb.h> would have given us this, but
index 60f8814cc52fdfea17be989228a56a951cc0e867..32d109ebdf89399ac0d834cc98393324dfca7850 100755 (executable)
@@ -337,6 +337,12 @@ sub term_init {
 # make sure we're always running at the top-level working directory
 if ($cmd && $cmd =~ /(?:clone|init|multi-init)$/) {
        $ENV{GIT_DIR} ||= ".git";
+       # catch the submodule case
+       if (-f $ENV{GIT_DIR}) {
+               open(my $fh, '<', $ENV{GIT_DIR}) or
+                       die "failed to open $ENV{GIT_DIR}: $!\n";
+               $ENV{GIT_DIR} = $1 if <$fh> =~ /^gitdir: (.+)$/;
+       }
 } else {
        my ($git_dir, $cdup);
        git_cmd_try {
diff --git a/git.c b/git.c
index 82d7a1cfee806001c2d8b81a9dc822a513c75451..6b5ae6a2ace7fffdd2ec50ce915ad5dc01a9c7da 100644 (file)
--- a/git.c
+++ b/git.c
@@ -1,10 +1,7 @@
 #include "builtin.h"
-#include "cache.h"
 #include "exec_cmd.h"
 #include "help.h"
-#include "quote.h"
 #include "run-command.h"
-#include "commit.h"
 
 const char git_usage_string[] =
        "git [--version] [--help] [-C <path>] [-c name=value]\n"
index 4dfe4c25d76649e982858c69e6bc7ff1ec32f645..d69887da5a8530b204a5f5baf7081787224fc3bd 100644 (file)
@@ -1421,8 +1421,8 @@ static CURL *setup_curl(struct imap_server_conf *srvc)
                strbuf_release(&auth);
        }
 
-       if (server.use_ssl)
-               curl_easy_setopt(curl, CURLOPT_USE_SSL, (long)CURLUSESSL_ALL);
+       if (!server.use_ssl)
+               curl_easy_setopt(curl, CURLOPT_USE_SSL, (long)CURLUSESSL_TRY);
 
        curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, server.ssl_verify);
        curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, server.ssl_verify);
@@ -1431,7 +1431,7 @@ static CURL *setup_curl(struct imap_server_conf *srvc)
 
        curl_easy_setopt(curl, CURLOPT_UPLOAD, 1L);
 
-       if (0 < verbosity)
+       if (0 < verbosity || getenv("GIT_CURL_VERBOSE"))
                curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
 
        return curl;
index d9a52a52df338926cdc21ea925cebc2dd7c3a388..8e4af7153eb8a8957bd4172e0c044c1bfc748ddb 100644 (file)
@@ -2365,7 +2365,7 @@ sub _new {
 
        # Older repos imported by us used $GIT_DIR/svn/foo instead of
        # $GIT_DIR/svn/refs/remotes/foo when tracking refs/remotes/foo
-       if ($ref_id =~ m{^refs/remotes/(.*)}) {
+       if ($ref_id =~ m{^refs/remotes/(.+)}) {
                my $old_dir = "$ENV{GIT_DIR}/svn/$1";
                if (-d $old_dir && ! -d $dir) {
                        $dir = $old_dir;
index 31f4a749fbad73b9f7bc1f1ebf9b11fd743ab374..34b0253177a0e6d09e317064cd3ec31e26002520 100644 (file)
@@ -17,7 +17,7 @@ static int update_info_file(char *path, int (*generate)(FILE *))
        FILE *fp = NULL;
 
        safe_create_leading_directories(path);
-       fd = mkstemp(tmp);
+       fd = git_mkstemp_mode(tmp, 0666);
        if (fd < 0)
                goto out;
        fp = fdopen(fd, "w");
index de42d21c922045415abedf3c81163682d0754eb5..7eecfb836a05cac56b8eca1ac56f67e8b22b1fbd 100755 (executable)
@@ -111,7 +111,18 @@ do
 
 done
 
+test_expect_success POSIXPERM 'info/refs respects umask in unshared repo' '
+       rm -f .git/info/refs &&
+       test_unconfig core.sharedrepository &&
+       umask 002 &&
+       git update-server-info &&
+       echo "-rw-rw-r--" >expect &&
+       modebits .git/info/refs >actual &&
+       test_cmp expect actual
+'
+
 test_expect_success POSIXPERM 'git reflog expire honors core.sharedRepository' '
+       umask 077 &&
        git config core.sharedRepository group &&
        git reflog expire --all &&
        actual="$(ls -l .git/logs/refs/heads/master)" &&
index ac79dd915da4a520e90fca6a11a239aba6e688d7..17c6330f988ecc98735307fbfd8bded5283feb61 100755 (executable)
@@ -1113,4 +1113,9 @@ test_extra_arg set-url origin newurl oldurl
 # prune takes any number of args
 # update takes any number of args
 
+test_expect_success 'add remote matching the "insteadOf" URL' '
+       git config url.xyz@example.com.insteadOf backup &&
+       git remote add backup xyz@example.com
+'
+
 test_done
index bda354c1c48bce9fc6fdc442c3ec89fb034f20d3..c66bf7981c5328356005963e15262c8d870ac61c 100755 (executable)
@@ -334,6 +334,19 @@ test_expect_success 'Check that :track[short] cannot be used with other atoms' '
        test_must_fail git for-each-ref --format="%(refname:trackshort)" 2>/dev/null
 '
 
+test_expect_success 'Check that :track[short] works when upstream is invalid' '
+       cat >expected <<-\EOF &&
+
+
+       EOF
+       test_when_finished "git config branch.master.merge refs/heads/master" &&
+       git config branch.master.merge refs/heads/does-not-exist &&
+       git for-each-ref \
+               --format="%(upstream:track)$LF%(upstream:trackshort)" \
+               refs/heads >actual &&
+       test_cmp expected actual
+'
+
 cat >expected <<EOF
 $(git rev-parse --short HEAD)
 EOF
index 915098418495b488b748db9e610c79f81223a960..51ecd3e4c157ea267557a4484d574748b9757bd4 100755 (executable)
@@ -35,6 +35,8 @@ test_expect_success 'setup for prompt tests' '
        git commit -m "another b2" file &&
        echo 000 >file &&
        git commit -m "yet another b2" file &&
+       mkdir ignored_dir &&
+       echo "ignored_dir/" >>.gitignore &&
        git checkout master
 '
 
@@ -588,4 +590,108 @@ test_expect_success 'prompt - zsh color pc mode' '
        test_cmp expected "$actual"
 '
 
+test_expect_success 'prompt - hide if pwd ignored - env var unset, config disabled' '
+       printf " (master)" >expected &&
+       test_config bash.hideIfPwdIgnored false &&
+       (
+               cd ignored_dir &&
+               __git_ps1 >"$actual"
+       ) &&
+       test_cmp expected "$actual"
+'
+
+test_expect_success 'prompt - hide if pwd ignored - env var unset, config disabled, pc mode' '
+       printf "BEFORE: (\${__git_ps1_branch_name}):AFTER" >expected &&
+       test_config bash.hideIfPwdIgnored false &&
+       (
+               cd ignored_dir &&
+               __git_ps1 "BEFORE:" ":AFTER" &&
+               printf "%s" "$PS1" >"$actual"
+       ) &&
+       test_cmp expected "$actual"
+'
+
+test_expect_success 'prompt - hide if pwd ignored - env var unset, config unset' '
+       printf " (master)" >expected &&
+       (
+               cd ignored_dir &&
+               __git_ps1 >"$actual"
+       ) &&
+       test_cmp expected "$actual"
+'
+
+test_expect_success 'prompt - hide if pwd ignored - env var unset, config unset, pc mode' '
+       printf "BEFORE: (\${__git_ps1_branch_name}):AFTER" >expected &&
+       (
+               cd ignored_dir &&
+               __git_ps1 "BEFORE:" ":AFTER" &&
+               printf "%s" "$PS1" >"$actual"
+       ) &&
+       test_cmp expected "$actual"
+'
+
+test_expect_success 'prompt - hide if pwd ignored - env var set, config disabled' '
+       printf " (master)" >expected &&
+       test_config bash.hideIfPwdIgnored false &&
+       (
+               cd ignored_dir &&
+               GIT_PS1_HIDE_IF_PWD_IGNORED=y &&
+               __git_ps1 >"$actual"
+       ) &&
+       test_cmp expected "$actual"
+'
+
+test_expect_success 'prompt - hide if pwd ignored - env var set, config disabled, pc mode' '
+       printf "BEFORE: (\${__git_ps1_branch_name}):AFTER" >expected &&
+       test_config bash.hideIfPwdIgnored false &&
+       (
+               cd ignored_dir &&
+               GIT_PS1_HIDE_IF_PWD_IGNORED=y &&
+               __git_ps1 "BEFORE:" ":AFTER" &&
+               printf "%s" "$PS1" >"$actual"
+       ) &&
+       test_cmp expected "$actual"
+'
+
+test_expect_success 'prompt - hide if pwd ignored - env var set, config unset' '
+       printf "" >expected &&
+       (
+               cd ignored_dir &&
+               GIT_PS1_HIDE_IF_PWD_IGNORED=y &&
+               __git_ps1 >"$actual"
+       ) &&
+       test_cmp expected "$actual"
+'
+
+test_expect_success 'prompt - hide if pwd ignored - env var set, config unset, pc mode' '
+       printf "BEFORE::AFTER" >expected &&
+       (
+               cd ignored_dir &&
+               GIT_PS1_HIDE_IF_PWD_IGNORED=y &&
+               __git_ps1 "BEFORE:" ":AFTER" &&
+               printf "%s" "$PS1" >"$actual"
+       ) &&
+       test_cmp expected "$actual"
+'
+
+test_expect_success 'prompt - hide if pwd ignored - inside gitdir (stdout)' '
+       printf " (GIT_DIR!)" >expected &&
+       (
+               GIT_PS1_HIDE_IF_PWD_IGNORED=y &&
+               cd .git &&
+               __git_ps1 >"$actual" 2>/dev/null
+       ) &&
+       test_cmp expected "$actual"
+'
+
+test_expect_success 'prompt - hide if pwd ignored - inside gitdir (stderr)' '
+       printf "" >expected &&
+       (
+               GIT_PS1_HIDE_IF_PWD_IGNORED=y &&
+               cd .git &&
+               __git_ps1 >/dev/null 2>"$actual"
+       ) &&
+       test_cmp expected "$actual"
+'
+
 test_done
index 9acdc8826fff1aabf9df5182a64109b7bd16cd8d..bb1402de944de11ee54a73dab7c33441ae1450c5 100644 (file)
@@ -184,16 +184,8 @@ export _x05 _x40 _z40 LF u200c
 # This test checks if command xyzzy does the right thing...
 # '
 # . ./test-lib.sh
-[ "x$ORIGINAL_TERM" != "xdumb" ] && (
-               TERM=$ORIGINAL_TERM &&
-               export TERM &&
-               [ -t 1 ] &&
-               tput bold >/dev/null 2>&1 &&
-               tput setaf 1 >/dev/null 2>&1 &&
-               tput sgr0 >/dev/null 2>&1
-       ) &&
-       color=t
 
+unset color
 while test "$#" -ne 0
 do
        case "$1" in
@@ -258,40 +250,6 @@ then
        verbose=t
 fi
 
-if test -n "$color"
-then
-       say_color () {
-               (
-               TERM=$ORIGINAL_TERM
-               export TERM
-               case "$1" in
-               error)
-                       tput bold; tput setaf 1;; # bold red
-               skip)
-                       tput setaf 4;; # blue
-               warn)
-                       tput setaf 3;; # brown/yellow
-               pass)
-                       tput setaf 2;; # green
-               info)
-                       tput setaf 6;; # cyan
-               *)
-                       test -n "$quiet" && return;;
-               esac
-               shift
-               printf "%s" "$*"
-               tput sgr0
-               echo
-               )
-       }
-else
-       say_color() {
-               test -z "$1" && test -n "$quiet" && return
-               shift
-               printf "%s\n" "$*"
-       }
-fi
-
 error () {
        say_color error "error: $*"
        GIT_EXIT_OK=t
@@ -684,7 +642,7 @@ test_done () {
                then
                        error "Can't use skip_all after running some tests"
                fi
-               [ -z "$skip_all" ] || skip_all=" # SKIP $skip_all"
+               test -z "$skip_all" || skip_all=" # SKIP $skip_all"
 
                if test $test_external_has_tap -eq 0
                then
@@ -857,6 +815,52 @@ HOME="$TRASH_DIRECTORY"
 GNUPGHOME="$HOME/gnupg-home-not-used"
 export HOME GNUPGHOME
 
+# run the tput tests *after* changing HOME (in case ncurses needs
+# ~/.terminfo for $TERM)
+test -n "${color+set}" || test "x$ORIGINAL_TERM" != "xdumb" && (
+               TERM=$ORIGINAL_TERM &&
+               export TERM &&
+               test -t 1 &&
+               tput bold >/dev/null 2>&1 &&
+               tput setaf 1 >/dev/null 2>&1 &&
+               tput sgr0 >/dev/null 2>&1
+       ) &&
+       color=t
+
+if test -n "$color"
+then
+       say_color () {
+               (
+               TERM=$ORIGINAL_TERM
+               export TERM
+               case "$1" in
+               error)
+                       tput bold; tput setaf 1;; # bold red
+               skip)
+                       tput setaf 4;; # blue
+               warn)
+                       tput setaf 3;; # brown/yellow
+               pass)
+                       tput setaf 2;; # green
+               info)
+                       tput setaf 6;; # cyan
+               *)
+                       test -n "$quiet" && return;;
+               esac
+               shift
+               printf "%s" "$*"
+               tput sgr0
+               echo
+               )
+       }
+else
+       say_color() {
+               test -z "$1" && test -n "$quiet" && return
+               shift
+               printf "%s\n" "$*"
+       }
+fi
+
 if test -z "$TEST_NO_CREATE_REPO"
 then
        test_create_repo "$TRASH_DIRECTORY"
diff --git a/trace.c b/trace.c
index f6f9f3a367242f5f3f10e1d33381f0a52d4fbe55..1dc5c7c912d000699b753b1aab5c09a114e26557 100644 (file)
--- a/trace.c
+++ b/trace.c
@@ -322,7 +322,7 @@ int trace_want(struct trace_key *key)
        return !!get_trace_fd(key);
 }
 
-#ifdef HAVE_CLOCK_GETTIME
+#if defined(HAVE_CLOCK_GETTIME) && defined(HAVE_CLOCK_MONOTONIC)
 
 static inline uint64_t highres_nanos(void)
 {