Merge branch 'rh/autoconf-rhel3'
authorJunio C Hamano <gitster@pobox.com>
Wed, 14 Jan 2015 20:37:21 +0000 (12:37 -0800)
committerJunio C Hamano <gitster@pobox.com>
Wed, 14 Jan 2015 20:37:21 +0000 (12:37 -0800)
Build update for older RHEL.

* rh/autoconf-rhel3:
configure.ac: check for HMAC_CTX_cleanup
configure.ac: check for clock_gettime and CLOCK_MONOTONIC
configure.ac: check 'tv_nsec' field in 'struct stat'

44 files changed:
Documentation/RelNotes/2.2.2.txt
Documentation/RelNotes/2.3.0.txt
Documentation/SubmittingPatches
Documentation/git-add.txt
Documentation/git-pack-objects.txt
Documentation/git-rev-list.txt
Documentation/git-send-email.txt
Documentation/git.txt
Documentation/rev-list-options.txt
GIT-VERSION-GEN
builtin/cat-file.c
builtin/checkout-index.c
builtin/commit-tree.c
builtin/log.c
builtin/merge.c
builtin/pack-objects.c
builtin/remote.c
builtin/show-branch.c
contrib/completion/git-completion.bash
contrib/completion/git-prompt.sh
contrib/subtree/git-subtree.txt
git-bisect.sh
git-compat-util.h
git.c
imap-send.c
list-objects.c
refs.c
revision.c
revision.h
send-pack.c
server-info.c
t/t0090-cache-tree.sh
t/t1301-shared-repo.sh
t/t1450-fsck.sh
t/t2004-checkout-cache-temp.sh
t/t5505-remote.sh
t/t6030-bisect-porcelain.sh
t/t9903-bash-prompt.sh
t/test-lib.sh
templates/hooks--pre-push.sample
transport.c
update_unicode.sh
upload-pack.c
utf8.c
index 29e1a3b324e7f06c390f68f0c428ce2aa3e2b86a..b19a35d94f683f8e9cea99ebb82f712817ac2d0d 100644 (file)
@@ -30,4 +30,34 @@ Fixes since v2.2.1
  * The build procedure did not bother fixing perl and python scripts
    when NO_PERL and NO_PYTHON build-time configuration changed.
 
+ * The code that reads the reflog from the newer to the older entries
+   did not handle an entry that crosses a boundary of block it uses to
+   read them correctly.
+
+ * "git apply" was described in the documentation to take --ignore-date
+   option, which it does not.
+
+ * Traditionally we tried to avoid interpreting date strings given by
+   the user as future dates, e.g. GIT_COMMITTER_DATE=2014-12-10 when
+   used early November 2014 was taken as "October 12, 2014" because it
+   is likely that a date in the future, December 10, is a mistake.
+   This heuristics has been loosened to allow people to express future
+   dates (most notably, --until=<date> may want to be far in the
+   future) and we no longer tiebreak by future-ness of the date when
+
+    (1) ISO-like format is used, and
+    (2) the string can make sense interpreted as both y-m-d and y-d-m.
+
+   Git may still have to use the heuristics to tiebreak between dd/mm/yy
+   and mm/dd/yy, though.
+
+ * The code to abbreviate an object name to its short unique prefix
+   has been optimized when no abbreviation was requested.
+
+ * "git add --ignore-errors ..." did not ignore an error to
+   give a file that did not exist.
+
+ * Git did not correctly read an overlong refname from a packed refs
+   file.
+
 Also contains typofixes, documentation updates and trivial code clean-ups.
index 1b1dcbb5840c86b62fbe2f8cb9a758b1498d4ef0..72db8d211fbf94ae94f8f372237b4b1de153b932 100644 (file)
@@ -26,9 +26,19 @@ UI, Workflows & Features
  * "git am" learned "--message-id" option to copy the message ID of
    the incoming e-mail to the log message of resulting commit.
 
+ * "git clone --reference=<over there>" learned the "--dissociate"
+   option to go with it; it borrows objects from the reference object
+   store while cloning only to reduce network traffic and then
+   dissociates the resulting clone from the reference by performing
+   local copies of borrowed objects.
+
  * "git send-email" learned "--transfer-encoding" option to force a
    non-fault Content-Transfer-Encoding header (e.g. base64).
 
+ * "git send-email" normally identifies itself via X-Mailer: header in
+   the message it sends out.  A new command line flag --no-xmailer
+   allows the user to squelch the header.
+
  * "git push" into a repository with a working tree normally refuses
    to modify the branch that is checked out.  The command learned to
    optionally do an equivalent of "git reset --hard" only when there
@@ -53,9 +63,31 @@ UI, Workflows & Features
  * "diff-highlight" filter (in contrib/) allows its color output to be
    customized via configuration variables.
 
+ * "git imap-send" learned to take "-v" (verbose) and "-q" (quiet)
+   command line options.
+
+ * "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.
+
 
 Performance, Internal Implementation, Development Support etc.
 
+ * Earlier we made "rev-list --object-edge" more aggressively list the
+   objects at the edge commits, in order to reduce number of objects 
+   fetched into a shallow repository, but the change affected cases
+   other than "fetching into a shallow repository" and made it
+   unusably slow (e.g. fetching into a normal repository should not
+   have to suffer the overhead from extra processing).  Limit it to a
+   more specific case by introducing --objects-edge-aggressive, a new
+   option to rev-list.
+
+ * Squelched useless compiler warnings on Mac OS X regarding the
+   crypto API.
+
+ * The procedure to generate unicode table has been simplified.
+
  * Some filesystems assign filemodes in a strange way, fooling then
    automatic "filemode trustability" check done during a new
    repository creation.  The initialization codepath has been hardened
@@ -64,6 +96,9 @@ Performance, Internal Implementation, Development Support etc.
  * The codepath in "git remote update --prune" to drop many refs has
    been optimized.
 
+ * The API into get_merge_bases*() family of functions was easy to
+   misuse, which has been corrected to make it harder to do so.
+
  * Long overdue departure from the assumption that S_IFMT is shared by
    everybody made in 2005, which was necessary to port to z/OS.
 
@@ -87,10 +122,49 @@ Unless otherwise noted, all the fixes since v2.2 in the maintenance
 track are contained in this release (see the maintenance releases'
 notes for details).
 
+ * The logic in "git bisect bad HEAD" etc. to avoid forcing the test
+   of the common ancestor of bad and good commits was broken.
+   (merge 07913d5 cc/bisect-rev-parsing later to maint).
+
+ * "git checkout-index --temp=$target $path" did not work correctly
+   for paths outside the current subdirectory in the project.
+   (merge 74c4de5 es/checkout-index-temp later to maint).
+
+ * The report from "git checkout" on a branch that builds on another
+   local branch by setting its branch.*.merge to branch name (not a
+   full refname) incorrectly said that the upstream is gone.
+   (merge 05e7368 jc/checkout-local-track-report later to maint).
+
+ * With The git-prompt support (in contrib/), using the exit status of
+   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).
+
+
  * Recent update to "git commit" broke amending an existing commit
    with bogus author/committer lines without a valid e-mail address.
    (merge c83a509 jk/commit-date-approxidate later to maint).
 
+ * The lockfile API used to get confused which file to clean up when
+   the process moved the $cwd after creating a lockfile.
+   (merge fa137f6 nd/lockfile-absolute later to maint).
+
+ * Traditionally we tried to avoid interpreting date strings given by
+   the user as future dates, e.g. GIT_COMMITTER_DATE=2014-12-10 when
+   used early November 2014 was taken as "October 12, 2014" because it
+   is likely that a date in the future, December 10, is a mistake.
+   This heuristics has been loosened to allow people to express future
+   dates (most notably, --until=<date> may want to be far in the
+   future) and we no longer tiebreak by future-ness of the date when
+
+    (1) ISO-like format is used, and
+    (2) the string can make sense interpreted as both y-m-d and y-d-m.
+
+   Git may still have to use the heuristics to tiebreak between dd/mm/yy
+   and mm/dd/yy, though.
+   (merge d372395 jk/approxidate-avoid-y-d-m-over-future-dates later to maint).
+
  * Git did not correctly read an overlong refname from a packed refs
    file.
    (merge ea41783 jk/read-packed-refs-without-path-max later to maint).
@@ -99,6 +173,14 @@ notes for details).
    option, which it does not.
    (merge 0cef4e7 rw/apply-does-not-take-ignore-date later to maint).
 
+ * "git add -i" did not notice when the interactive command input
+   stream went away and kept asking the same question.
+   (merge a8bec7a jk/add-i-read-error later to maint).
+
+ * "git send-email" did not handle RFC 2047 encoded headers quite
+   right.
+   (merge ab47e2a rd/send-email-2047-fix later to maint).
+
  * New tag object format validation added in 2.2 showed garbage after
    a tagname it reported in its error message.
    (merge a1e920a js/fsck-tag-validation later to maint).
@@ -108,6 +190,23 @@ notes for details).
    read them correctly.
    (merge 69216bf jk/for-each-reflog-ent-reverse later to maint).
 
+ * "git diff -B -M" after making a new copy B out of an existing file
+   A and then editing A extensively ought to report that B was created
+   by copying A and A was modified, which is what "git diff -C"
+   reports, but it instead said A was renamed to B and A was edited
+   heavily in place.  This was not just incoherent but also failed to
+   apply with "git apply".  The report has been corrected to match what
+   "git diff -C" produces for this case.
+   (merge 6936b58 jc/diff-b-m later to maint).
+
+ * In files we pre-populate for the user to edit with commented hints,
+   a line of hint that is indented with a tab used to show as '#' (or
+   any comment char), ' ' (space), and then the hint text that began
+   with the tab, which some editors flag as an indentation error (tab
+   following space).  We now omit the space after the comment char in
+   such a case.
+   (merge d55aeb7 jc/strbuf-add-lines-avoid-sp-ht-sequence later to maint).
+
  * "git ls-tree" does not support path selection based on negative
    pathspecs, but did not error out when negative pathspecs are given.
    (merge f1f6224 nd/ls-tree-pathspec later to maint).
index e3c942e57902abc2767c202978a4bd5060ca449f..ef0eeb40cd225925b1cd034221c426eea1c88f1b 100644 (file)
@@ -176,8 +176,11 @@ message starts, you can put a "From: " line to name that person.
 
 You often want to add additional explanation about the patch,
 other than the commit message itself.  Place such "cover letter"
-material between the three dash lines and the diffstat. Git-notes
-can also be inserted using the `--notes` option.
+material between the three-dash line and the diffstat.  For
+patches requiring multiple iterations of review and discussion,
+an explanation of changes between each iteration can be kept in
+Git-notes and inserted automatically following the three-dash
+line via `git format-patch --notes`.
 
 Do not attach the patch as a MIME attachment, compressed or not.
 Do not let your e-mail client send quoted-printable.  Do not let
@@ -255,15 +258,15 @@ pretty simple: if you can certify the below:
             person who certified (a), (b) or (c) and I have not modified
             it.
 
-       (d) I understand and agree that this project and the contribution
-           are public and that a record of the contribution (including all
-           personal information I submit with it, including my sign-off) is
-           maintained indefinitely and may be redistributed consistent with
-           this project or the open source license(s) involved.
+        (d) I understand and agree that this project and the contribution
+            are public and that a record of the contribution (including all
+            personal information I submit with it, including my sign-off) is
+            maintained indefinitely and may be redistributed consistent with
+            this project or the open source license(s) involved.
 
 then you just add a line saying
 
-       Signed-off-by: Random J Developer <random@developer.example.org>
+        Signed-off-by: Random J Developer <random@developer.example.org>
 
 This line can be automatically added by Git if you run the git-commit
 command with the -s option.
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 d2d8f4792afaf5dc1105457493b070bcf163ecef..c2f76fb1ea476aa551963349ee976ad8745f10e2 100644 (file)
@@ -13,7 +13,7 @@ SYNOPSIS
        [--no-reuse-delta] [--delta-base-offset] [--non-empty]
        [--local] [--incremental] [--window=<n>] [--depth=<n>]
        [--revs [--unpacked | --all]] [--stdout | base-name]
-       [--keep-true-parents] < object-list
+       [--shallow] [--keep-true-parents] < object-list
 
 
 DESCRIPTION
@@ -190,6 +190,11 @@ required objects and is thus unusable by Git without making it
 self-contained. Use `git index-pack --fix-thin`
 (see linkgit:git-index-pack[1]) to restore the self-contained property.
 
+--shallow::
+       Optimize a pack that will be provided to a client with a shallow
+       repository.  This option, combined with \--thin, can result in a
+       smaller pack at the cost of speed.
+
 --delta-base-offset::
        A packed archive can express the base object of a delta as
        either a 20-byte object name or as an offset in the
index fd7f8b5bc1840bc93273dd7b076d86499626912a..5b119220bf168153d63bf2051a065e40b68c1ed3 100644 (file)
@@ -46,7 +46,8 @@ SYNOPSIS
             [ \--extended-regexp | -E ]
             [ \--fixed-strings | -F ]
             [ \--date=(local|relative|default|iso|iso-strict|rfc|short) ]
-            [ [\--objects | \--objects-edge] [ \--unpacked ] ]
+            [ [ \--objects | \--objects-edge | \--objects-edge-aggressive ]
+              [ \--unpacked ] ]
             [ \--pretty | \--header ]
             [ \--bisect ]
             [ \--bisect-vars ]
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 179615195fd260d4d6d87bc1cda6f5c8a699719d..9d334314270003d4ce54ef233691506dd4f10197 100644 (file)
@@ -43,9 +43,10 @@ unreleased) version of Git, that is available from the 'master'
 branch of the `git.git` repository.
 Documentation for older releases are available here:
 
-* link:v2.2.1/git.html[documentation for release 2.2.1]
+* link:v2.2.2/git.html[documentation for release 2.2.2]
 
 * release notes for
+  link:RelNotes/2.2.2.txt[2.2.2],
   link:RelNotes/2.2.1.txt[2.2.1],
   link:RelNotes/2.2.0.txt[2.2].
 
index afccfdc23a38f2dca84ebeff2cc8624eb8a0e23e..2984f407a9f3084235fd0207a82ea44a424942ed 100644 (file)
@@ -653,10 +653,15 @@ These options are mostly targeted for packing of Git repositories.
 --objects-edge::
        Similar to `--objects`, but also print the IDs of excluded
        commits prefixed with a ``-'' character.  This is used by
-       linkgit:git-pack-objects[1] to build ``thin'' pack, which records
+       linkgit:git-pack-objects[1] to build ``thin'' pack, which records
        objects in deltified form based on objects contained in these
        excluded commits to reduce network traffic.
 
+--objects-edge-aggressive::
+       Similar to `--objects-edge`, but it tries harder to find excluded
+       commits at the cost of increased time.  This is used instead of
+       `--objects-edge` to build ``thin'' packs for shallow repositories.
+
 --unpacked::
        Only useful with `--objects`; print the object IDs that are not
        in packs.
index 53dd6b328563c143181a932c119754c62b4dc9b3..57dc9635aaf9f699bb56418701e05473d983de91 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 GVF=GIT-VERSION-FILE
-DEF_VER=v2.2.0.GIT
+DEF_VER=v2.3.0-rc0
 
 LF='
 '
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 383dccf93ef4eceb873eee4cd63e6781854b295c..031780f49e0b3a3e7a8e1aa4904e33858f11542d 100644 (file)
@@ -18,7 +18,7 @@ static char topath[4][TEMPORARY_FILENAME_LENGTH + 1];
 
 static struct checkout state;
 
-static void write_tempfile_record(const char *name, int prefix_length)
+static void write_tempfile_record(const char *name, const char *prefix)
 {
        int i;
 
@@ -35,14 +35,14 @@ static void write_tempfile_record(const char *name, int prefix_length)
                fputs(topath[checkout_stage], stdout);
 
        putchar('\t');
-       write_name_quoted(name + prefix_length, stdout, line_termination);
+       write_name_quoted_relative(name, prefix, stdout, line_termination);
 
        for (i = 0; i < 4; i++) {
                topath[i][0] = 0;
        }
 }
 
-static int checkout_file(const char *name, int prefix_length)
+static int checkout_file(const char *name, const char *prefix)
 {
        int namelen = strlen(name);
        int pos = cache_name_pos(name, namelen);
@@ -71,7 +71,7 @@ static int checkout_file(const char *name, int prefix_length)
 
        if (did_checkout) {
                if (to_tempfile)
-                       write_tempfile_record(name, prefix_length);
+                       write_tempfile_record(name, prefix);
                return errs > 0 ? -1 : 0;
        }
 
@@ -106,7 +106,7 @@ static void checkout_all(const char *prefix, int prefix_length)
                if (last_ce && to_tempfile) {
                        if (ce_namelen(last_ce) != ce_namelen(ce)
                            || memcmp(last_ce->name, ce->name, ce_namelen(ce)))
-                               write_tempfile_record(last_ce->name, prefix_length);
+                               write_tempfile_record(last_ce->name, prefix);
                }
                if (checkout_entry(ce, &state,
                    to_tempfile ? topath[ce_stage(ce)] : NULL) < 0)
@@ -114,7 +114,7 @@ static void checkout_all(const char *prefix, int prefix_length)
                last_ce = ce;
        }
        if (last_ce && to_tempfile)
-               write_tempfile_record(last_ce->name, prefix_length);
+               write_tempfile_record(last_ce->name, prefix);
        if (errs)
                /* we have already done our error reporting.
                 * exit with the same code as die().
@@ -248,7 +248,7 @@ int cmd_checkout_index(int argc, const char **argv, const char *prefix)
                if (read_from_stdin)
                        die("git checkout-index: don't mix '--stdin' and explicit filenames");
                p = prefix_path(prefix, prefix_length, arg);
-               checkout_file(p, prefix_length);
+               checkout_file(p, prefix);
                if (p < arg || p > arg + strlen(arg))
                        free((char *)p);
        }
@@ -268,7 +268,7 @@ int cmd_checkout_index(int argc, const char **argv, const char *prefix)
                                strbuf_swap(&buf, &nbuf);
                        }
                        p = prefix_path(prefix, prefix_length, buf.buf);
-                       checkout_file(p, prefix_length);
+                       checkout_file(p, prefix);
                        if (p < buf.buf || p > buf.buf + buf.len)
                                free((char *)p);
                }
index 8a66c74e0fd405a06e6c767d385013ff7150db04..25aa2cdef3557c67a9482492a4d0294bc7b89b04 100644 (file)
@@ -66,10 +66,8 @@ int cmd_commit_tree(int argc, const char **argv, const char *prefix)
                        continue;
                }
 
-               if (!memcmp(arg, "-S", 2)) {
-                       sign_commit = arg + 2;
+               if (skip_prefix(arg, "-S", &sign_commit))
                        continue;
-               }
 
                if (!strcmp(arg, "--no-gpg-sign")) {
                        sign_commit = NULL;
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 9effed7ff15d087a6d6768044ffaa70db1ddac73..c638fd5a9a8165c58d46d4edeeb0f3bbe8c0f9a1 100644 (file)
@@ -894,6 +894,7 @@ static int suggest_conflicts(void)
 
        append_conflicts_hint(&msgbuf);
        fputs(msgbuf.buf, fp);
+       strbuf_release(&msgbuf);
        fclose(fp);
        rerere(allow_rerere_auto);
        printf(_("Automatic merge failed; "
index 3f9f5c7760a63bc2deb32b75f500ac0d1bc87538..d8165878e1d466e49719038b1badc524d5627270 100644 (file)
@@ -2613,6 +2613,7 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix)
 {
        int use_internal_rev_list = 0;
        int thin = 0;
+       int shallow = 0;
        int all_progress_implied = 0;
        struct argv_array rp = ARGV_ARRAY_INIT;
        int rev_list_unpacked = 0, rev_list_all = 0, rev_list_reflog = 0;
@@ -2677,6 +2678,8 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix)
                  PARSE_OPT_OPTARG, option_parse_unpack_unreachable },
                OPT_BOOL(0, "thin", &thin,
                         N_("create thin packs")),
+               OPT_BOOL(0, "shallow", &shallow,
+                        N_("create packs suitable for shallow fetches")),
                OPT_BOOL(0, "honor-pack-keep", &ignore_packed_keep,
                         N_("ignore packs that have companion .keep file")),
                OPT_INTEGER(0, "compression", &pack_compression_level,
@@ -2711,7 +2714,9 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix)
        argv_array_push(&rp, "pack-objects");
        if (thin) {
                use_internal_rev_list = 1;
-               argv_array_push(&rp, "--objects-edge");
+               argv_array_push(&rp, shallow
+                               ? "--objects-edge-aggressive"
+                               : "--objects-edge");
        } else
                argv_array_push(&rp, "--objects");
 
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 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 729f7694795d1116ccedfc653f82da757e6e4ef4..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,8 @@ __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
        local ps1pc_start='\u@\h:\w '
@@ -299,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
 
@@ -350,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
@@ -369,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=""
@@ -412,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: }"
@@ -511,4 +523,6 @@ __git_ps1 ()
        else
                printf -- "$printf_format" "$gitstring"
        fi
+
+       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 6cda2b5a601c54d138ab3126a25c59371f6f7188..2fc07acb0f242154fec868207cfd77f448929200 100755 (executable)
@@ -237,15 +237,18 @@ bisect_state() {
                check_expected_revs "$rev" ;;
        2,bad|*,good|*,skip)
                shift
-               eval=''
+               hash_list=''
                for rev in "$@"
                do
                        sha=$(git rev-parse --verify "$rev^{commit}") ||
                                die "$(eval_gettext "Bad rev input: \$rev")"
-                       eval="$eval bisect_write '$state' '$sha'; "
+                       hash_list="$hash_list $sha"
                done
-               eval "$eval"
-               check_expected_revs "$@" ;;
+               for rev in $hash_list
+               do
+                       bisect_write "$state" "$rev"
+               done
+               check_expected_revs $hash_list ;;
        *,bad)
                die "$(gettext "'git bisect bad' can take only one argument.")" ;;
        *)
index 09ccebbd4958a18918d29170c9b86c91ed61cfc7..eb9b0ff32829ef62bf2d1af432742841b9720906 100644 (file)
@@ -212,8 +212,12 @@ extern char *gitbasename(char *);
 #endif
 
 #ifndef NO_OPENSSL
+#define __AVAILABILITY_MACROS_USES_AVAILABILITY 0
+#define MAC_OS_X_VERSION_MIN_REQUIRED MAC_OS_X_VERSION_10_6
 #include <openssl/ssl.h>
 #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
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 2910becd6c65b66670215aefdf08e1933895aa39..2a139b6ced68809f3a324f493325ec62c3a44044 100644 (file)
@@ -157,7 +157,7 @@ void mark_edges_uninteresting(struct rev_info *revs, show_edge_fn show_edge)
 
                if (commit->object.flags & UNINTERESTING) {
                        mark_tree_uninteresting(commit->tree);
-                       if (revs->edge_hint && !(commit->object.flags & SHOWN)) {
+                       if (revs->edge_hint_aggressive && !(commit->object.flags & SHOWN)) {
                                commit->object.flags |= SHOWN;
                                show_edge(commit);
                        }
@@ -165,7 +165,7 @@ void mark_edges_uninteresting(struct rev_info *revs, show_edge_fn show_edge)
                }
                mark_edge_parents_uninteresting(commit, revs, show_edge);
        }
-       if (revs->edge_hint) {
+       if (revs->edge_hint_aggressive) {
                for (i = 0; i < revs->cmdline.nr; i++) {
                        struct object *obj = revs->cmdline.rev[i].item;
                        struct commit *commit = (struct commit *)obj;
diff --git a/refs.c b/refs.c
index 5fcacc6c41e6c7033367cc9c4cf7c18b33eea286..ed3b2cb405cc576f16e5b94d83683953b94e1e89 100644 (file)
--- a/refs.c
+++ b/refs.c
@@ -2334,7 +2334,7 @@ static struct ref_lock *lock_ref_sha1_basic(const char *refname,
                        struct strbuf err = STRBUF_INIT;
                        unable_to_lock_message(ref_file, errno, &err);
                        error("%s", err.buf);
-                       strbuf_reset(&err);
+                       strbuf_release(&err);
                        goto error_return;
                }
        }
index 14e0e0358cf19dc95a5509ec441335a70a277503..86406a26a2d4599ea401d1faa9a817cadb3b7bcd 100644 (file)
@@ -1853,6 +1853,12 @@ static int handle_revision_opt(struct rev_info *revs, int argc, const char **arg
                revs->tree_objects = 1;
                revs->blob_objects = 1;
                revs->edge_hint = 1;
+       } else if (!strcmp(arg, "--objects-edge-aggressive")) {
+               revs->tag_objects = 1;
+               revs->tree_objects = 1;
+               revs->blob_objects = 1;
+               revs->edge_hint = 1;
+               revs->edge_hint_aggressive = 1;
        } else if (!strcmp(arg, "--verify-objects")) {
                revs->tag_objects = 1;
                revs->tree_objects = 1;
index 9cb5adc4ea25bfdc37ced8b8a98b1fd58661c9e9..033a24460e71b723f95ef91f4b6f0dbfd8c2c390 100644 (file)
@@ -93,6 +93,7 @@ struct rev_info {
                        blob_objects:1,
                        verify_objects:1,
                        edge_hint:1,
+                       edge_hint_aggressive:1,
                        limited:1,
                        unpacked:1,
                        boundary:2,
index 949cb61aa0d681e30b7e8199ef9e31ff0caee089..25947d7df9dd3af6e665d5d5eb63ec970617aef1 100644 (file)
@@ -47,6 +47,7 @@ static int pack_objects(int fd, struct ref *refs, struct sha1_array *extra, stru
                NULL,
                NULL,
                NULL,
+               NULL,
        };
        struct child_process po = CHILD_PROCESS_INIT;
        int i;
@@ -60,6 +61,8 @@ static int pack_objects(int fd, struct ref *refs, struct sha1_array *extra, stru
                argv[i++] = "-q";
        if (args->progress)
                argv[i++] = "--progress";
+       if (is_repository_shallow())
+               argv[i++] = "--shallow";
        po.argv = argv;
        po.in = -1;
        po.out = args->stateless_rpc ? -1 : fd;
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 067f4c6e52abe86e952367d8cf576a80aa5139bd..601d02d71f735b4247528cc45b0ea055299ee7a0 100755 (executable)
@@ -22,7 +22,7 @@ generate_expected_cache_tree_rec () {
        # ls-files might have foo/bar, foo/bar/baz, and foo/bar/quux
        # We want to count only foo because it's the only direct child
        subtrees=$(git ls-files|grep /|cut -d / -f 1|uniq) &&
-       subtree_count=$(echo "$subtrees"|awk -v c=0 '$1 {++c} END {print c}') &&
+       subtree_count=$(echo "$subtrees"|awk -v c=0 '$1 != "" {++c} END {print c}') &&
        entries=$(git ls-files|wc -l) &&
        printf "SHA $dir (%d entries, %d subtrees)\n" "$entries" "$subtree_count" &&
        for subtree in $subtrees
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 1f04b8aa3ff925f469ffa60ce47f9d5659b9acaa..cfb32b62420dc162e79aaea29a36f7d78f3353f5 100755 (executable)
@@ -349,6 +349,21 @@ dot-backslash-case .\\\\.GIT\\\\foobar
 dotgit-case-backslash .git\\\\foobar
 EOF
 
+test_expect_success 'fsck allows .Ňit' '
+       (
+               git init not-dotgit &&
+               cd not-dotgit &&
+               echo content >file &&
+               git add file &&
+               git commit -m base &&
+               blob=$(git rev-parse :file) &&
+               printf "100644 blob $blob\t.\\305\\207it" >tree &&
+               tree=$(git mktree <tree) &&
+               git fsck 2>err &&
+               test_line_count = 0 err
+       )
+'
+
 # create a static test repo which is broken by omitting
 # one particular object ($1, which is looked up via rev-parse
 # in the new repository).
index f171a5578b6b81e4d7cb03ef0b6b9272ef610ffc..a12afe93f32948dd994d55418ed93485757d2ba8 100755 (executable)
@@ -10,202 +10,212 @@ rather than the tracked path.'
 
 . ./test-lib.sh
 
-test_expect_success \
-'preparation' '
-mkdir asubdir &&
-echo tree1path0 >path0 &&
-echo tree1path1 >path1 &&
-echo tree1path3 >path3 &&
-echo tree1path4 >path4 &&
-echo tree1asubdir/path5 >asubdir/path5 &&
-git update-index --add path0 path1 path3 path4 asubdir/path5 &&
-t1=$(git write-tree) &&
-rm -f path* .merge_* out .git/index &&
-echo tree2path0 >path0 &&
-echo tree2path1 >path1 &&
-echo tree2path2 >path2 &&
-echo tree2path4 >path4 &&
-git update-index --add path0 path1 path2 path4 &&
-t2=$(git write-tree) &&
-rm -f path* .merge_* out .git/index &&
-echo tree2path0 >path0 &&
-echo tree3path1 >path1 &&
-echo tree3path2 >path2 &&
-echo tree3path3 >path3 &&
-git update-index --add path0 path1 path2 path3 &&
-t3=$(git write-tree)'
-
-test_expect_success \
-'checkout one stage 0 to temporary file' '
-rm -f path* .merge_* out .git/index &&
-git read-tree $t1 &&
-git checkout-index --temp -- path1 >out &&
-test_line_count = 1 out &&
-test $(cut "-d " -f2 out) = path1 &&
-p=$(cut "-d    " -f1 out) &&
-test -f $p &&
-test $(cat $p) = tree1path1'
-
-test_expect_success \
-'checkout all stage 0 to temporary files' '
-rm -f path* .merge_* out .git/index &&
-git read-tree $t1 &&
-git checkout-index -a --temp >out &&
-test_line_count = 5 out &&
-for f in path0 path1 path3 path4 asubdir/path5
-do
-       test $(grep $f out | cut "-d    " -f2) = $f &&
-       p=$(grep $f out | cut "-d       " -f1) &&
+test_expect_success 'setup' '
+       mkdir asubdir &&
+       echo tree1path0 >path0 &&
+       echo tree1path1 >path1 &&
+       echo tree1path3 >path3 &&
+       echo tree1path4 >path4 &&
+       echo tree1asubdir/path5 >asubdir/path5 &&
+       git update-index --add path0 path1 path3 path4 asubdir/path5 &&
+       t1=$(git write-tree) &&
+       rm -f path* .merge_* actual .git/index &&
+       echo tree2path0 >path0 &&
+       echo tree2path1 >path1 &&
+       echo tree2path2 >path2 &&
+       echo tree2path4 >path4 &&
+       git update-index --add path0 path1 path2 path4 &&
+       t2=$(git write-tree) &&
+       rm -f path* .merge_* actual .git/index &&
+       echo tree2path0 >path0 &&
+       echo tree3path1 >path1 &&
+       echo tree3path2 >path2 &&
+       echo tree3path3 >path3 &&
+       git update-index --add path0 path1 path2 path3 &&
+       t3=$(git write-tree)
+'
+
+test_expect_success 'checkout one stage 0 to temporary file' '
+       rm -f path* .merge_* actual .git/index &&
+       git read-tree $t1 &&
+       git checkout-index --temp -- path1 >actual &&
+       test_line_count = 1 actual &&
+       test $(cut "-d  " -f2 actual) = path1 &&
+       p=$(cut "-d     " -f1 actual) &&
        test -f $p &&
-       test $(cat $p) = tree1$f
-done'
-
-test_expect_success \
-'prepare 3-way merge' '
-rm -f path* .merge_* out .git/index &&
-git read-tree -m $t1 $t2 $t3'
-
-test_expect_success \
-'checkout one stage 2 to temporary file' '
-rm -f path* .merge_* out &&
-git checkout-index --stage=2 --temp -- path1 >out &&
-test_line_count = 1 out &&
-test $(cut "-d " -f2 out) = path1 &&
-p=$(cut "-d    " -f1 out) &&
-test -f $p &&
-test $(cat $p) = tree2path1'
-
-test_expect_success \
-'checkout all stage 2 to temporary files' '
-rm -f path* .merge_* out &&
-git checkout-index --all --stage=2 --temp >out &&
-test_line_count = 3 out &&
-for f in path1 path2 path4
-do
-       test $(grep $f out | cut "-d    " -f2) = $f &&
-       p=$(grep $f out | cut "-d       " -f1) &&
+       test $(cat $p) = tree1path1
+'
+
+test_expect_success 'checkout all stage 0 to temporary files' '
+       rm -f path* .merge_* actual .git/index &&
+       git read-tree $t1 &&
+       git checkout-index -a --temp >actual &&
+       test_line_count = 5 actual &&
+       for f in path0 path1 path3 path4 asubdir/path5
+       do
+               test $(grep $f actual | cut "-d " -f2) = $f &&
+               p=$(grep $f actual | cut "-d    " -f1) &&
+               test -f $p &&
+               test $(cat $p) = tree1$f
+       done
+'
+
+test_expect_success 'setup 3-way merge' '
+       rm -f path* .merge_* actual .git/index &&
+       git read-tree -m $t1 $t2 $t3
+'
+
+test_expect_success 'checkout one stage 2 to temporary file' '
+       rm -f path* .merge_* actual &&
+       git checkout-index --stage=2 --temp -- path1 >actual &&
+       test_line_count = 1 actual &&
+       test $(cut "-d  " -f2 actual) = path1 &&
+       p=$(cut "-d     " -f1 actual) &&
        test -f $p &&
-       test $(cat $p) = tree2$f
-done'
-
-test_expect_success \
-'checkout all stages/one file to nothing' '
-rm -f path* .merge_* out &&
-git checkout-index --stage=all --temp -- path0 >out &&
-test_line_count = 0 out'
-
-test_expect_success \
-'checkout all stages/one file to temporary files' '
-rm -f path* .merge_* out &&
-git checkout-index --stage=all --temp -- path1 >out &&
-test_line_count = 1 out &&
-test $(cut "-d " -f2 out) = path1 &&
-cut "-d        " -f1 out | (read s1 s2 s3 &&
-test -f $s1 &&
-test -f $s2 &&
-test -f $s3 &&
-test $(cat $s1) = tree1path1 &&
-test $(cat $s2) = tree2path1 &&
-test $(cat $s3) = tree3path1)'
-
-test_expect_success \
-'checkout some stages/one file to temporary files' '
-rm -f path* .merge_* out &&
-git checkout-index --stage=all --temp -- path2 >out &&
-test_line_count = 1 out &&
-test $(cut "-d " -f2 out) = path2 &&
-cut "-d        " -f1 out | (read s1 s2 s3 &&
-test $s1 = . &&
-test -f $s2 &&
-test -f $s3 &&
-test $(cat $s2) = tree2path2 &&
-test $(cat $s3) = tree3path2)'
-
-test_expect_success \
-'checkout all stages/all files to temporary files' '
-rm -f path* .merge_* out &&
-git checkout-index -a --stage=all --temp >out &&
-test_line_count = 5 out'
-
-test_expect_success \
-'-- path0: no entry' '
-test x$(grep path0 out | cut "-d       " -f2) = x'
-
-test_expect_success \
-'-- path1: all 3 stages' '
-test $(grep path1 out | cut "-d        " -f2) = path1 &&
-grep path1 out | cut "-d       " -f1 | (read s1 s2 s3 &&
-test -f $s1 &&
-test -f $s2 &&
-test -f $s3 &&
-test $(cat $s1) = tree1path1 &&
-test $(cat $s2) = tree2path1 &&
-test $(cat $s3) = tree3path1)'
-
-test_expect_success \
-'-- path2: no stage 1, have stage 2 and 3' '
-test $(grep path2 out | cut "-d        " -f2) = path2 &&
-grep path2 out | cut "-d       " -f1 | (read s1 s2 s3 &&
-test $s1 = . &&
-test -f $s2 &&
-test -f $s3 &&
-test $(cat $s2) = tree2path2 &&
-test $(cat $s3) = tree3path2)'
-
-test_expect_success \
-'-- path3: no stage 2, have stage 1 and 3' '
-test $(grep path3 out | cut "-d        " -f2) = path3 &&
-grep path3 out | cut "-d       " -f1 | (read s1 s2 s3 &&
-test -f $s1 &&
-test $s2 = . &&
-test -f $s3 &&
-test $(cat $s1) = tree1path3 &&
-test $(cat $s3) = tree3path3)'
-
-test_expect_success \
-'-- path4: no stage 3, have stage 1 and 3' '
-test $(grep path4 out | cut "-d        " -f2) = path4 &&
-grep path4 out | cut "-d       " -f1 | (read s1 s2 s3 &&
-test -f $s1 &&
-test -f $s2 &&
-test $s3 = . &&
-test $(cat $s1) = tree1path4 &&
-test $(cat $s2) = tree2path4)'
-
-test_expect_success \
-'-- asubdir/path5: no stage 2 and 3 have stage 1' '
-test $(grep asubdir/path5 out | cut "-d        " -f2) = asubdir/path5 &&
-grep asubdir/path5 out | cut "-d       " -f1 | (read s1 s2 s3 &&
-test -f $s1 &&
-test $s2 = . &&
-test $s3 = . &&
-test $(cat $s1) = tree1asubdir/path5)'
-
-test_expect_success \
-'checkout --temp within subdir' '
-(cd asubdir &&
- git checkout-index -a --stage=all >out &&
- test_line_count = 1 out &&
- test $(grep path5 out | cut "-d       " -f2) = path5 &&
- grep path5 out | cut "-d      " -f1 | (read s1 s2 s3 &&
- test -f ../$s1 &&
- test $s2 = . &&
- test $s3 = . &&
- test $(cat ../$s1) = tree1asubdir/path5)
-)'
-
-test_expect_success \
-'checkout --temp symlink' '
-rm -f path* .merge_* out .git/index &&
-test_ln_s_add b a &&
-t4=$(git write-tree) &&
-rm -f .git/index &&
-git read-tree $t4 &&
-git checkout-index --temp -a >out &&
-test_line_count = 1 out &&
-test $(cut "-d " -f2 out) = a &&
-p=$(cut "-d    " -f1 out) &&
-test -f $p &&
-test $(cat $p) = b'
+       test $(cat $p) = tree2path1
+'
+
+test_expect_success 'checkout all stage 2 to temporary files' '
+       rm -f path* .merge_* actual &&
+       git checkout-index --all --stage=2 --temp >actual &&
+       test_line_count = 3 actual &&
+       for f in path1 path2 path4
+       do
+               test $(grep $f actual | cut "-d " -f2) = $f &&
+               p=$(grep $f actual | cut "-d    " -f1) &&
+               test -f $p &&
+               test $(cat $p) = tree2$f
+       done
+'
+
+test_expect_success 'checkout all stages/one file to nothing' '
+       rm -f path* .merge_* actual &&
+       git checkout-index --stage=all --temp -- path0 >actual &&
+       test_line_count = 0 actual
+'
+
+test_expect_success 'checkout all stages/one file to temporary files' '
+       rm -f path* .merge_* actual &&
+       git checkout-index --stage=all --temp -- path1 >actual &&
+       test_line_count = 1 actual &&
+       test $(cut "-d  " -f2 actual) = path1 &&
+       cut "-d " -f1 actual | (read s1 s2 s3 &&
+       test -f $s1 &&
+       test -f $s2 &&
+       test -f $s3 &&
+       test $(cat $s1) = tree1path1 &&
+       test $(cat $s2) = tree2path1 &&
+       test $(cat $s3) = tree3path1)
+'
+
+test_expect_success 'checkout some stages/one file to temporary files' '
+       rm -f path* .merge_* actual &&
+       git checkout-index --stage=all --temp -- path2 >actual &&
+       test_line_count = 1 actual &&
+       test $(cut "-d  " -f2 actual) = path2 &&
+       cut "-d " -f1 actual | (read s1 s2 s3 &&
+       test $s1 = . &&
+       test -f $s2 &&
+       test -f $s3 &&
+       test $(cat $s2) = tree2path2 &&
+       test $(cat $s3) = tree3path2)
+'
+
+test_expect_success 'checkout all stages/all files to temporary files' '
+       rm -f path* .merge_* actual &&
+       git checkout-index -a --stage=all --temp >actual &&
+       test_line_count = 5 actual
+'
+
+test_expect_success '-- path0: no entry' '
+       test x$(grep path0 actual | cut "-d     " -f2) = x
+'
+
+test_expect_success '-- path1: all 3 stages' '
+       test $(grep path1 actual | cut "-d      " -f2) = path1 &&
+       grep path1 actual | cut "-d     " -f1 | (read s1 s2 s3 &&
+       test -f $s1 &&
+       test -f $s2 &&
+       test -f $s3 &&
+       test $(cat $s1) = tree1path1 &&
+       test $(cat $s2) = tree2path1 &&
+       test $(cat $s3) = tree3path1)
+'
+
+test_expect_success '-- path2: no stage 1, have stage 2 and 3' '
+       test $(grep path2 actual | cut "-d      " -f2) = path2 &&
+       grep path2 actual | cut "-d     " -f1 | (read s1 s2 s3 &&
+       test $s1 = . &&
+       test -f $s2 &&
+       test -f $s3 &&
+       test $(cat $s2) = tree2path2 &&
+       test $(cat $s3) = tree3path2)
+'
+
+test_expect_success '-- path3: no stage 2, have stage 1 and 3' '
+       test $(grep path3 actual | cut "-d      " -f2) = path3 &&
+       grep path3 actual | cut "-d     " -f1 | (read s1 s2 s3 &&
+       test -f $s1 &&
+       test $s2 = . &&
+       test -f $s3 &&
+       test $(cat $s1) = tree1path3 &&
+       test $(cat $s3) = tree3path3)
+'
+
+test_expect_success '-- path4: no stage 3, have stage 1 and 3' '
+       test $(grep path4 actual | cut "-d      " -f2) = path4 &&
+       grep path4 actual | cut "-d     " -f1 | (read s1 s2 s3 &&
+       test -f $s1 &&
+       test -f $s2 &&
+       test $s3 = . &&
+       test $(cat $s1) = tree1path4 &&
+       test $(cat $s2) = tree2path4)
+'
+
+test_expect_success '-- asubdir/path5: no stage 2 and 3 have stage 1' '
+       test $(grep asubdir/path5 actual | cut "-d      " -f2) = asubdir/path5 &&
+       grep asubdir/path5 actual | cut "-d     " -f1 | (read s1 s2 s3 &&
+       test -f $s1 &&
+       test $s2 = . &&
+       test $s3 = . &&
+       test $(cat $s1) = tree1asubdir/path5)
+'
+
+test_expect_success 'checkout --temp within subdir' '
+       (
+               cd asubdir &&
+               git checkout-index -a --stage=all >actual &&
+               test_line_count = 1 actual &&
+               test $(grep path5 actual | cut "-d      " -f2) = path5 &&
+               grep path5 actual | cut "-d     " -f1 | (read s1 s2 s3 &&
+               test -f ../$s1 &&
+               test $s2 = . &&
+               test $s3 = . &&
+               test $(cat ../$s1) = tree1asubdir/path5)
+       )
+'
+
+test_expect_success 'checkout --temp symlink' '
+       rm -f path* .merge_* actual .git/index &&
+       test_ln_s_add path7 path6 &&
+       git checkout-index --temp -a >actual &&
+       test_line_count = 1 actual &&
+       test $(cut "-d  " -f2 actual) = path6 &&
+       p=$(cut "-d     " -f1 actual) &&
+       test -f $p &&
+       test $(cat $p) = path7
+'
+
+test_expect_success 'emit well-formed relative path' '
+       rm -f path* .merge_* actual .git/index &&
+       >path0123456789 &&
+       git update-index --add path0123456789 &&
+       (
+               cd asubdir &&
+               git checkout-index --temp -- ../path0123456789 >actual &&
+               test_line_count = 1 actual &&
+               test $(cut "-d  " -f2 actual) = ../path0123456789
+       )
+'
 
 test_done
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 064f5cefeb4cf7e3bfa2c104384094492dc54f91..e6abe65d5c3370a53e3f034486101a8e9ee4055b 100755 (executable)
@@ -779,4 +779,13 @@ test_expect_success 'bisect log: only skip commits left' '
        git bisect reset
 '
 
+test_expect_success '"git bisect bad HEAD" behaves as "git bisect bad"' '
+       git checkout parallel &&
+       git bisect start HEAD $HASH1 &&
+       git bisect good HEAD &&
+       git bisect bad HEAD &&
+       test "$HASH6" = $(git rev-parse --verify HEAD) &&
+       git bisect reset
+'
+
 test_done
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"
index 69e3c67b00f482449e77945eb114f58244078b1e..6187dbf4390fc6e28445dd3d988aefb9d1111988 100755 (executable)
@@ -24,7 +24,6 @@ url="$2"
 
 z40=0000000000000000000000000000000000000000
 
-IFS=' '
 while read local_ref local_sha remote_ref remote_sha
 do
        if [ "$local_sha" = $z40 ]
index 70d38e4c4b35c6207e226ab7cb54095c34bb4766..08bcd3a4eba42d2e72b9d84ec89e190c763300fa 100644 (file)
@@ -971,9 +971,7 @@ struct transport *transport_get(struct remote *remote, const char *url)
        } else {
                /* Unknown protocol in URL. Pass to external handler. */
                int len = external_specification_len(url);
-               char *handler = xmalloc(len + 1);
-               handler[len] = 0;
-               strncpy(handler, url, len);
+               char *handler = xmemdupz(url, len);
                transport_helper_init(ret, handler);
        }
 
index 000b937e6828d378829cfe8a25e93ce07c531574..27af77c7df63f8a9039d77b332ebb06d69f02f65 100755 (executable)
@@ -27,11 +27,14 @@ fi &&
                fi &&
                make
        ) &&
-       echo "static const struct interval zero_width[] = {" >$UNICODEWIDTH_H &&
-       UNICODE_DIR=. ./uniset/uniset --32 cat:Me,Mn,Cf + U+1160..U+11FF - U+00AD |
-       grep -v plane >>$UNICODEWIDTH_H &&
-       echo "};" >>$UNICODEWIDTH_H &&
-       echo "static const struct interval double_width[] = {" >>$UNICODEWIDTH_H &&
-       UNICODE_DIR=. ./uniset/uniset --32 eaw:F,W >>$UNICODEWIDTH_H &&
-       echo "};" >>$UNICODEWIDTH_H
+       UNICODE_DIR=. && export UNICODE_DIR &&
+       cat >$UNICODEWIDTH_H <<-EOF
+       static const struct interval zero_width[] = {
+               $(uniset/uniset --32 cat:Me,Mn,Cf + U+1160..U+11FF - U+00AD |
+                 grep -v plane)
+       };
+       static const struct interval double_width[] = {
+               $(uniset/uniset --32 eaw:F,W)
+       };
+       EOF
 )
index ac9ac1592d818da5ae90ec065581e3bf218ffc39..b531a325d2864e94bdc86e689f78663255bb7cf2 100644 (file)
@@ -86,7 +86,7 @@ static void create_pack_file(void)
                "corruption on the remote side.";
        int buffered = -1;
        ssize_t sz;
-       const char *argv[12];
+       const char *argv[13];
        int i, arg = 0;
        FILE *pipe_fd;
 
@@ -100,6 +100,8 @@ static void create_pack_file(void)
                argv[arg++] = "--thin";
 
        argv[arg++] = "--stdout";
+       if (shallow_nr)
+               argv[arg++] = "--shallow";
        if (!no_progress)
                argv[arg++] = "--progress";
        if (use_ofs_delta)
diff --git a/utf8.c b/utf8.c
index 9a3f4ad23293bf6a3fc06a1942fd324fa1b74ded..520fbb4994ab1bdcfa0bc4589a0ca5131a89c490 100644 (file)
--- a/utf8.c
+++ b/utf8.c
@@ -563,8 +563,8 @@ int mbs_chrlen(const char **text, size_t *remainder_p, const char *encoding)
 }
 
 /*
- * Pick the next char from the stream, folding as an HFS+ filename comparison
- * would. Note that this is _not_ complete by any means. It's just enough
+ * Pick the next char from the stream, ignoring codepoints an HFS+ would.
+ * Note that this is _not_ complete by any means. It's just enough
  * to make is_hfs_dotgit() work, and should not be used otherwise.
  */
 static ucs_char_t next_hfs_char(const char **in)
@@ -601,12 +601,7 @@ static ucs_char_t next_hfs_char(const char **in)
                        continue;
                }
 
-               /*
-                * there's a great deal of other case-folding that occurs,
-                * but this is enough to catch anything that will convert
-                * to ".git"
-                */
-               return tolower(out);
+               return out;
        }
 }
 
@@ -614,10 +609,23 @@ int is_hfs_dotgit(const char *path)
 {
        ucs_char_t c;
 
-       if (next_hfs_char(&path) != '.' ||
-           next_hfs_char(&path) != 'g' ||
-           next_hfs_char(&path) != 'i' ||
-           next_hfs_char(&path) != 't')
+       c = next_hfs_char(&path);
+       if (c != '.')
+               return 0;
+       c = next_hfs_char(&path);
+
+       /*
+        * there's a great deal of other case-folding that occurs
+        * in HFS+, but this is enough to catch anything that will
+        * convert to ".git"
+        */
+       if (c != 'g' && c != 'G')
+               return 0;
+       c = next_hfs_char(&path);
+       if (c != 'i' && c != 'I')
+               return 0;
+       c = next_hfs_char(&path);
+       if (c != 't' && c != 'T')
                return 0;
        c = next_hfs_char(&path);
        if (c && !is_dir_sep(c))