Merge branch 'bw/cp-a-is-gnuism' into maint
authorJunio C Hamano <gitster@pobox.com>
Wed, 17 Oct 2012 17:28:48 +0000 (10:28 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 17 Oct 2012 17:28:48 +0000 (10:28 -0700)
* bw/cp-a-is-gnuism:
tests: "cp -a" is a GNUism

29 files changed:
Documentation/Makefile
Documentation/RelNotes/1.7.12.3.txt
Documentation/fetch-options.txt
Documentation/git-add.txt
Documentation/git-blame.txt
Documentation/git-branch.txt
Documentation/git-clean.txt
Documentation/git-clone.txt
Documentation/git.txt
Documentation/gitattributes.txt
Documentation/gitcli.txt
Documentation/gitignore.txt
Documentation/merge-strategies.txt
GIT-VERSION-GEN
attr.c
builtin/clone.c
builtin/commit.c
builtin/mailinfo.c
builtin/receive-pack.c
contrib/hooks/post-receive-email
gitweb/gitweb.perl
ll-merge.c
po/de.po
t/t0000-basic.sh
t/t1450-fsck.sh
t/t5504-fetch-receive-strict.sh
t/t5709-clone-refspec.sh [new file with mode: 0755]
t/t6037-merge-ours-theirs.sh
t/test-lib.sh
index cf5916fe8b79e39eb57f97b36e82697694f41d7a..267dfe135ddef1d5e6cc452d6fdcd8b22b9e36a2 100644 (file)
@@ -44,9 +44,10 @@ man5dir=$(mandir)/man5
 man7dir=$(mandir)/man7
 # DESTDIR=
 
-ASCIIDOC=asciidoc
+ASCIIDOC = asciidoc
 ASCIIDOC_EXTRA =
 MANPAGE_XSL = manpage-normal.xsl
+XMLTO = xmlto
 XMLTO_EXTRA =
 INSTALL?=install
 RM ?= rm -f
@@ -245,7 +246,7 @@ manpage-base-url.xsl: manpage-base-url.xsl.in
 
 %.1 %.5 %.7 : %.xml manpage-base-url.xsl
        $(QUIET_XMLTO)$(RM) $@ && \
-       xmlto -m $(MANPAGE_XSL) $(XMLTO_EXTRA) man $<
+       $(XMLTO) -m $(MANPAGE_XSL) $(XMLTO_EXTRA) man $<
 
 %.xml : %.txt
        $(QUIET_ASCIIDOC)$(RM) $@+ $@ && \
index 8d4f879458e9b3110a4825ff0abfabf73719b1c0..ecda427a35efb4ade682a314f2f05724ea37e67e 100644 (file)
@@ -4,6 +4,18 @@ Git 1.7.12.3 Release Notes
 Fixes since v1.7.12.2
 ---------------------
 
+ * "git am" mishandled a patch attached as application/octet-stream
+   (e.g. not text/*); Content-Transfer-Encoding (e.g. base64) was not
+   honored correctly.
+
+ * It was unclear in the documentation for "git blame" that it is
+   unnecessary for users to use the "--follow" option.
+
+ * A repository created with "git clone --single" had its fetch
+   refspecs set up just like a clone without "--single", leading the
+   subsequent "git fetch" to slurp all the other branches, defeating
+   the whole point of specifying "only this branch".
+
  * "git fetch" over http had an old workaround for an unlikely server
    misconfiguration; it turns out that this hurts debuggability of the
    configuration in general, and has been reverted.
@@ -12,6 +24,10 @@ Fixes since v1.7.12.2
    is much less common, and did not advertise the more common "gzip" on
    its Accept-Encoding header.
 
+ * "git receive-pack" (the counterpart to "git push") did not give
+   progress output while processing objects it received to the puser
+   when run over the smart-http protocol.
+
  * "git status" honored the ignore=dirty settings in .gitmodules but
    "git commit" didn't.
 
index 39d326abc63af01d7cffe3d6f0c3df9279bc667e..b4d6476ac898db8ff99ab3639efce08050ef71c4 100644 (file)
@@ -10,7 +10,8 @@
 --depth=<depth>::
        Deepen the history of a 'shallow' repository created by
        `git clone` with `--depth=<depth>` option (see linkgit:git-clone[1])
-       by the specified number of commits.
+       to the specified number of commits from the tip of each remote
+       branch history. Tags for the deepened commits are not fetched.
 
 ifndef::git-pull[]
 --dry-run::
index 9c1d3957223355e00eea917d4a7dff6d50343f32..fd9e36b99f5506964ac8352b82bb7af05551a523 100644 (file)
@@ -155,7 +155,7 @@ Configuration
 The optional configuration variable `core.excludesfile` indicates a path to a
 file containing patterns of file names to exclude from git-add, similar to
 $GIT_DIR/info/exclude.  Patterns in the exclude file are used in addition to
-those in info/exclude.  See linkgit:gitrepository-layout[5].
+those in info/exclude.  See linkgit:gitignore[5].
 
 
 EXAMPLES
index 7ee923629ecc0dbf12a845f18d02c317b6266066..e44173f66afa9e1e1656e7b388fd707c417a1d28 100644 (file)
@@ -20,6 +20,12 @@ last modified the line. Optionally, start annotating from the given revision.
 
 The command can also limit the range of lines annotated.
 
+The origin of lines is automatically followed across whole-file
+renames (currently there is no option to turn the rename-following
+off). To follow lines moved from one file to another, or to follow
+lines that were copied and pasted from another file, etc., see the
+`-C` and `-M` options.
+
 The report does not tell you anything about lines which have been deleted or
 replaced; you need to use a tool such as 'git diff' or the "pickaxe"
 interface briefly mentioned in the following paragraph.
index 47235bea0403bf25fa73529a37a7c5f87d0d7eb9..4f441311c27766da6e1dfa4b1cfe8f228842626a 100644 (file)
@@ -129,11 +129,13 @@ This option is only applicable in non-verbose mode.
        use `git branch --list <pattern>` to list matching branches.
 
 -v::
+-vv::
 --verbose::
        When in list mode,
        show sha1 and commit subject line for each head, along with
        relationship to upstream branch (if any). If given twice, print
-       the name of the upstream branch, as well.
+       the name of the upstream branch, as well (see also `git remote
+       show <remote>`).
 
 -q::
 --quiet::
index 79fb9841441d02cd635dcdd2aecef42d38c6b59d..9f42c0d0e63e8d23bfbf4b582a6a9a60280cca47 100644 (file)
@@ -63,6 +63,10 @@ OPTIONS
        Remove only files ignored by git.  This may be useful to rebuild
        everything from scratch, but keep manually created files.
 
+SEE ALSO
+--------
+linkgit:gitignore[5]
+
 GIT
 ---
 Part of the linkgit:git[1] suite
index c1ddd4c2cc78e078a0849fc8fb82f8de0aa7fc9b..6d98ef3d2ab8c8e63e026dbd7e242d3c3bc3c79a 100644 (file)
@@ -29,7 +29,8 @@ currently active branch.
 After the clone, a plain `git fetch` without arguments will update
 all the remote-tracking branches, and a `git pull` without
 arguments will in addition merge the remote master branch into the
-current master branch, if any.
+current master branch, if any (this is untrue when "--single-branch"
+is given; see below).
 
 This default configuration is achieved by creating references to
 the remote branch heads under `refs/remotes/origin` and
@@ -152,9 +153,10 @@ objects from the source repository into a pack in the cloned repository.
 -b <name>::
        Instead of pointing the newly created HEAD to the branch pointed
        to by the cloned repository's HEAD, point to `<name>` branch
-       instead. `--branch` can also take tags and treat them like
-       detached HEAD. In a non-bare repository, this is the branch
-       that will be checked out.
+       instead. In a non-bare repository, this is the branch that will
+       be checked out.
+       `--branch` can also take tags and detaches the HEAD at that commit
+       in the resulting repository.
 
 --upload-pack <upload-pack>::
 -u <upload-pack>::
@@ -193,6 +195,11 @@ objects from the source repository into a pack in the cloned repository.
        clone with the `--depth` option, this is the default, unless
        `--no-single-branch` is given to fetch the histories near the
        tips of all branches.
+       Further fetches into the resulting repository will only update the
+       remote tracking branch for the branch this option was used for the
+       initial cloning.  If the HEAD at the remote did not point at any
+       branch when `--single-branch` clone was made, no remote tracking
+       branch is created.
 
 --recursive::
 --recurse-submodules::
index 48bd04e22d3bef2c9a4bbeb5e776ece42cedff9a..d1d227a32d1b110239fc4a789839dd2dadc12d80 100644 (file)
@@ -43,9 +43,10 @@ unreleased) version of git, that is available from 'master'
 branch of the `git.git` repository.
 Documentation for older releases are available here:
 
-* link:v1.7.12.2/git.html[documentation for release 1.7.12.2]
+* link:v1.7.12.3/git.html[documentation for release 1.7.12.3]
 
 * release notes for
+  link:RelNotes/1.7.12.3.txt[1.7.12.3],
   link:RelNotes/1.7.12.2.txt[1.7.12.2],
   link:RelNotes/1.7.12.1.txt[1.7.12.1],
   link:RelNotes/1.7.12.txt[1.7.12].
index e16f3e175bd8915d139961c649be209b0afc535f..52ab93d2c286d1f91fde8f14eaf6c3742443dcf2 100644 (file)
@@ -66,6 +66,11 @@ is from the path in question, the lower its precedence). Finally
 global and system-wide files are considered (they have the lowest
 precedence).
 
+When the `.gitattributes` file is missing from the work tree, the
+path in the index is used as a fall-back.  During checkout process,
+`.gitattributes` in the index is used and then the file in the
+working tree is used as a fall-back.
+
 If you wish to affect only a single repository (i.e., to assign
 attributes to files that are particular to
 one user's workflow for that repository), then
@@ -927,7 +932,7 @@ file at the toplevel (i.e. not in any subdirectory).  The built-in
 macro attribute "binary" is equivalent to:
 
 ------------
-[attr]binary -diff -text
+[attr]binary -diff -merge -text
 ------------
 
 
index f6ba90c2da8f381bc714762f24bbfc33fa82b356..3bc1500eda540cf7277e602b3d0ade1a3c1dc1be 100644 (file)
@@ -93,7 +93,7 @@ ENHANCED OPTION PARSER
 From the git 1.5.4 series and further, many git commands (not all of them at the
 time of the writing though) come with an enhanced option parser.
 
-Here is an exhaustive list of the facilities provided by this option parser.
+Here is a list of the facilities provided by this option parser.
 
 
 Magic Options
@@ -137,6 +137,16 @@ options. This means that you can for example use `git rm -rf` or
 `git clean -fdx`.
 
 
+Abbreviating long options
+~~~~~~~~~~~~~~~~~~~~~~~~~
+Commands that support the enhanced option parser accepts unique
+prefix of a long option as if it is fully spelled out, but use this
+with a caution.  For example, `git commit --amen` behaves as if you
+typed `git commit --amend`, but that is true only until a later version
+of Git introduces another option that shares the same prefix,
+e.g `git commit --amenity" option.
+
+
 Separating argument from the option
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 You can write the mandatory option parameter to an option as a separate
index c1f692a71e54e01f813d84f83eaff4a9514a27b3..1b82fe1969ed1cf965d946178a423771dd3cfe5f 100644 (file)
@@ -41,18 +41,24 @@ precedence, the last matching pattern decides the outcome):
    variable 'core.excludesfile'.
 
 Which file to place a pattern in depends on how the pattern is meant to
-be used. Patterns which should be version-controlled and distributed to
-other repositories via clone (i.e., files that all developers will want
-to ignore) should go into a `.gitignore` file. Patterns which are
-specific to a particular repository but which do not need to be shared
-with other related repositories (e.g., auxiliary files that live inside
-the repository but are specific to one user's workflow) should go into
-the `$GIT_DIR/info/exclude` file.  Patterns which a user wants git to
-ignore in all situations (e.g., backup or temporary files generated by
-the user's editor of choice) generally go into a file specified by
-`core.excludesfile` in the user's `~/.gitconfig`. Its default value is
-$XDG_CONFIG_HOME/git/ignore. If $XDG_CONFIG_HOME is either not set or empty,
-$HOME/.config/git/ignore is used instead.
+be used.
+
+ * Patterns which should be version-controlled and distributed to
+   other repositories via clone (i.e., files that all developers will want
+   to ignore) should go into a `.gitignore` file.
+
+ * Patterns which are
+   specific to a particular repository but which do not need to be shared
+   with other related repositories (e.g., auxiliary files that live inside
+   the repository but are specific to one user's workflow) should go into
+   the `$GIT_DIR/info/exclude` file.
+
+ * Patterns which a user wants git to
+   ignore in all situations (e.g., backup or temporary files generated by
+   the user's editor of choice) generally go into a file specified by
+   `core.excludesfile` in the user's `~/.gitconfig`. Its default value is
+   $XDG_CONFIG_HOME/git/ignore. If $XDG_CONFIG_HOME is either not set or
+   empty, $HOME/.config/git/ignore is used instead.
 
 The underlying git plumbing tools, such as
 'git ls-files' and 'git read-tree', read
@@ -68,11 +74,15 @@ PATTERN FORMAT
    for readability.
 
  - A line starting with # serves as a comment.
+   Put a backslash ("`\`") in front of the first hash for patterns
+   that begin with a hash.
 
- - An optional prefix '!' which negates the pattern; any
+ - An optional prefix "`!`" which negates the pattern; any
    matching file excluded by a previous pattern will become
    included again.  If a negated pattern matches, this will
    override lower precedence patterns sources.
+   Put a backslash ("`\`") in front of the first "`!`" for patterns
+   that begin with a literal "`!`", for example, "`\!important!.txt`".
 
  - If the pattern ends with a slash, it is removed for the
    purpose of the following description, but it would only find
index 595a3cf1a7118ba29a1d57d7fc17d233d89cd3d0..66db80296f505a9bd830c746f82bb54e3f49f313 100644 (file)
@@ -32,13 +32,14 @@ ours;;
        This option forces conflicting hunks to be auto-resolved cleanly by
        favoring 'our' version.  Changes from the other tree that do not
        conflict with our side are reflected to the merge result.
+       For a binary file, the entire contents are taken from our side.
 +
 This should not be confused with the 'ours' merge strategy, which does not
 even look at what the other tree contains at all.  It discards everything
 the other tree did, declaring 'our' history contains all that happened in it.
 
 theirs;;
-       This is opposite of 'ours'.
+       This is the opposite of 'ours'.
 
 patience;;
        With this option, 'merge-recursive' spends a little extra time
index d98481a10c2e202257225eb48aac14ae6224cbec..ecdbf905a32288937e1a3eec65aa7f925ea30446 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 GVF=GIT-VERSION-FILE
-DEF_VER=v1.7.12.2
+DEF_VER=v1.7.12.3
 
 LF='
 '
diff --git a/attr.c b/attr.c
index 056d702f6e244e4188abc3c8dc4db647699ec4d1..887a9ae46b7044489845abf2072339271caf2d4a 100644 (file)
--- a/attr.c
+++ b/attr.c
@@ -306,7 +306,7 @@ static void free_attr_elem(struct attr_stack *e)
 }
 
 static const char *builtin_attr[] = {
-       "[attr]binary -diff -text",
+       "[attr]binary -diff -merge -text",
        NULL,
 };
 
index e314b0b6d2133b09307dc09fa256577e6cdba03a..0d663e34f78431280eb7f79d581262a7c28820d3 100644 (file)
@@ -610,6 +610,54 @@ static void write_config(struct string_list *config)
        }
 }
 
+static void write_refspec_config(const char* src_ref_prefix,
+               const struct ref* our_head_points_at,
+               const struct ref* remote_head_points_at, struct strbuf* branch_top)
+{
+       struct strbuf key = STRBUF_INIT;
+       struct strbuf value = STRBUF_INIT;
+
+       if (option_mirror || !option_bare) {
+               if (option_single_branch && !option_mirror) {
+                       if (option_branch) {
+                               if (strstr(our_head_points_at->name, "refs/tags/"))
+                                       strbuf_addf(&value, "+%s:%s", our_head_points_at->name,
+                                               our_head_points_at->name);
+                               else
+                                       strbuf_addf(&value, "+%s:%s%s", our_head_points_at->name,
+                                               branch_top->buf, option_branch);
+                       } else if (remote_head_points_at) {
+                               strbuf_addf(&value, "+%s:%s%s", remote_head_points_at->name,
+                                               branch_top->buf,
+                                               skip_prefix(remote_head_points_at->name, "refs/heads/"));
+                       }
+                       /*
+                        * otherwise, the next "git fetch" will
+                        * simply fetch from HEAD without updating
+                        * any remote tracking branch, which is what
+                        * we want.
+                        */
+               } else {
+                       strbuf_addf(&value, "+%s*:%s*", src_ref_prefix, branch_top->buf);
+               }
+               /* Configure the remote */
+               if (value.len) {
+                       strbuf_addf(&key, "remote.%s.fetch", option_origin);
+                       git_config_set_multivar(key.buf, value.buf, "^$", 0);
+                       strbuf_reset(&key);
+
+                       if (option_mirror) {
+                               strbuf_addf(&key, "remote.%s.mirror", option_origin);
+                               git_config_set(key.buf, "true");
+                               strbuf_reset(&key);
+                       }
+               }
+       }
+
+       strbuf_release(&key);
+       strbuf_release(&value);
+}
+
 int cmd_clone(int argc, const char **argv, const char *prefix)
 {
        int is_bundle = 0, is_local;
@@ -755,20 +803,6 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
        }
 
        strbuf_addf(&value, "+%s*:%s*", src_ref_prefix, branch_top.buf);
-
-       if (option_mirror || !option_bare) {
-               /* Configure the remote */
-               strbuf_addf(&key, "remote.%s.fetch", option_origin);
-               git_config_set_multivar(key.buf, value.buf, "^$", 0);
-               strbuf_reset(&key);
-
-               if (option_mirror) {
-                       strbuf_addf(&key, "remote.%s.mirror", option_origin);
-                       git_config_set(key.buf, "true");
-                       strbuf_reset(&key);
-               }
-       }
-
        strbuf_addf(&key, "remote.%s.url", option_origin);
        git_config_set(key.buf, repo);
        strbuf_reset(&key);
@@ -853,6 +887,9 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
                                              "refs/heads/master");
        }
 
+       write_refspec_config(src_ref_prefix, our_head_points_at,
+                       remote_head_points_at, &branch_top);
+
        if (is_local)
                clone_local(path, git_dir);
        else if (refs && complete_refs_before_fetch)
index 62028e7b44b206e9722eef750be8c067aae31b32..7a83cae6ff9d0168c3d9be4241e3cd94f1128a23 100644 (file)
@@ -1452,6 +1452,7 @@ int cmd_commit(int argc, const char **argv, const char *prefix)
                usage_with_options(builtin_commit_usage, builtin_commit_options);
 
        wt_status_prepare(&s);
+       gitmodules_config();
        git_config(git_commit_config, &s);
        determine_whence(&s);
        s.colopts = 0;
index 9973bd9099c7b65ad2ce56bb1b1b806279b0beab..fe128572f7780c4544d8023be2989f5e037b5bef 100644 (file)
@@ -19,9 +19,6 @@ static struct strbuf email = STRBUF_INIT;
 static enum  {
        TE_DONTCARE, TE_QP, TE_BASE64
 } transfer_encoding;
-static enum  {
-       TYPE_TEXT, TYPE_OTHER
-} message_type;
 
 static struct strbuf charset = STRBUF_INIT;
 static int patch_lines;
@@ -184,8 +181,6 @@ static void handle_content_type(struct strbuf *line)
        struct strbuf *boundary = xmalloc(sizeof(struct strbuf));
        strbuf_init(boundary, line->len);
 
-       if (!strcasestr(line->buf, "text/"))
-                message_type = TYPE_OTHER;
        if (slurp_attr(line->buf, "boundary=", boundary)) {
                strbuf_insert(boundary, 0, "--", 2);
                if (++content_top > &content[MAX_BOUNDARIES]) {
@@ -681,7 +676,6 @@ static int handle_boundary(void)
        /* set some defaults */
        transfer_encoding = TE_DONTCARE;
        strbuf_reset(&charset);
-       message_type = TYPE_TEXT;
 
        /* slurp in this section's info */
        while (read_one_header_line(&line, fin))
@@ -895,11 +889,6 @@ static void handle_body(void)
                        strbuf_insert(&line, 0, prev.buf, prev.len);
                        strbuf_reset(&prev);
 
-                       /* binary data most likely doesn't have newlines */
-                       if (message_type != TYPE_TEXT) {
-                               handle_filter(&line);
-                               break;
-                       }
                        /*
                         * This is a decoded line that may contain
                         * multiple new lines.  Pass only one chunk
index 2cb854feb4b3a701201ef683c6644aaa852d50b5..165a633204bed5ffc279e3af703a3d275e3e3822 100644 (file)
@@ -701,7 +701,7 @@ static void execute_commands(struct command *commands, const char *unpacker_erro
 
        if (unpacker_error) {
                for (cmd = commands; cmd; cmd = cmd->next)
-                       cmd->error_string = "n/a (unpacker error)";
+                       cmd->error_string = "unpacker error";
                return;
        }
 
@@ -801,7 +801,7 @@ static const char *parse_pack_header(struct pack_header *hdr)
 
 static const char *pack_lockfile;
 
-static const char *unpack(void)
+static const char *unpack(int err_fd)
 {
        struct pack_header hdr;
        const char *hdr_err;
@@ -821,6 +821,7 @@ static const char *unpack(void)
 
        if (ntohl(hdr.hdr_entries) < unpack_limit) {
                int code, i = 0;
+               struct child_process child;
                const char *unpacker[5];
                unpacker[i++] = "unpack-objects";
                if (quiet)
@@ -829,7 +830,12 @@ static const char *unpack(void)
                        unpacker[i++] = "--strict";
                unpacker[i++] = hdr_arg;
                unpacker[i++] = NULL;
-               code = run_command_v_opt(unpacker, RUN_GIT_CMD);
+               memset(&child, 0, sizeof(child));
+               child.argv = unpacker;
+               child.no_stdout = 1;
+               child.err = err_fd;
+               child.git_cmd = 1;
+               code = run_command(&child);
                if (!code)
                        return NULL;
                return "unpack-objects abnormal exit";
@@ -854,6 +860,7 @@ static const char *unpack(void)
                memset(&ip, 0, sizeof(ip));
                ip.argv = keeper;
                ip.out = -1;
+               ip.err = err_fd;
                ip.git_cmd = 1;
                status = start_command(&ip);
                if (status) {
@@ -870,6 +877,26 @@ static const char *unpack(void)
        }
 }
 
+static const char *unpack_with_sideband(void)
+{
+       struct async muxer;
+       const char *ret;
+
+       if (!use_sideband)
+               return unpack(0);
+
+       memset(&muxer, 0, sizeof(muxer));
+       muxer.proc = copy_to_sideband;
+       muxer.in = -1;
+       if (start_async(&muxer))
+               return NULL;
+
+       ret = unpack(muxer.in);
+
+       finish_async(&muxer);
+       return ret;
+}
+
 static void report(struct command *commands, const char *unpack_status)
 {
        struct command *cmd;
@@ -967,7 +994,7 @@ int cmd_receive_pack(int argc, const char **argv, const char *prefix)
                const char *unpack_status = NULL;
 
                if (!delete_only(commands))
-                       unpack_status = unpack();
+                       unpack_status = unpack_with_sideband();
                execute_commands(commands, unpack_status);
                if (pack_lockfile)
                        unlink_or_warn(pack_lockfile);
index 01af9df15e180288723caadf42b500fe78a8c694..b2171a092eafef4cf1e5e1abfa37695a0c111927 100755 (executable)
@@ -403,7 +403,7 @@ generate_update_branch_email()
                        echo "            \\"
                        echo "             O -- O -- O ($oldrev)"
                        echo ""
-                       echo "The removed revisions are not necessarilly gone - if another reference"
+                       echo "The removed revisions are not necessarily gone - if another reference"
                        echo "still refers to them they will stay in the repository."
                        rewind_only=1
                else
index 7f8c1878d407e07c3ac4ac16d840557a18176d29..10ed9e51a5880430f7f109ff83f950a768a7c530 100755 (executable)
@@ -8028,7 +8028,7 @@ sub git_feed {
                %latest_commit = %{$commitlist[0]};
                my $latest_epoch = $latest_commit{'committer_epoch'};
                exit_if_unmodified_since($latest_epoch);
-               %latest_date = parse_date($latest_epoch, $latest_commit{'comitter_tz'});
+               %latest_date = parse_date($latest_epoch, $latest_commit{'committer_tz'});
        }
        print $cgi->header(
                -type => $content_type,
index f3f7692158666ffd2ab6f65f4040462e4a7d2d00..acea33bf1babfe541c319081f14625ac779bb582 100644 (file)
@@ -35,7 +35,7 @@ struct ll_merge_driver {
  */
 static int ll_binary_merge(const struct ll_merge_driver *drv_unused,
                           mmbuffer_t *result,
-                          const char *path_unused,
+                          const char *path,
                           mmfile_t *orig, const char *orig_name,
                           mmfile_t *src1, const char *name1,
                           mmfile_t *src2, const char *name2,
@@ -46,16 +46,34 @@ static int ll_binary_merge(const struct ll_merge_driver *drv_unused,
        assert(opts);
 
        /*
-        * The tentative merge result is "ours" for the final round,
-        * or common ancestor for an internal merge.  Still return
-        * "conflicted merge" status.
+        * The tentative merge result is the or common ancestor for an internal merge.
         */
-       stolen = opts->virtual_ancestor ? orig : src1;
+       if (opts->virtual_ancestor) {
+               stolen = orig;
+       } else {
+               switch (opts->variant) {
+               default:
+                       warning("Cannot merge binary files: %s (%s vs. %s)",
+                               path, name1, name2);
+                       /* fallthru */
+               case XDL_MERGE_FAVOR_OURS:
+                       stolen = src1;
+                       break;
+               case XDL_MERGE_FAVOR_THEIRS:
+                       stolen = src2;
+                       break;
+               }
+       }
 
        result->ptr = stolen->ptr;
        result->size = stolen->size;
        stolen->ptr = NULL;
-       return 1;
+
+       /*
+        * With -Xtheirs or -Xours, we have cleanly merged;
+        * otherwise we got a conflict.
+        */
+       return (opts->variant ? 0 : 1);
 }
 
 static int ll_xdl_merge(const struct ll_merge_driver *drv_unused,
@@ -73,8 +91,6 @@ static int ll_xdl_merge(const struct ll_merge_driver *drv_unused,
        if (buffer_is_binary(orig->ptr, orig->size) ||
            buffer_is_binary(src1->ptr, src1->size) ||
            buffer_is_binary(src2->ptr, src2->size)) {
-               warning("Cannot merge binary files: %s (%s vs. %s)",
-                       path, name1, name2);
                return ll_binary_merge(drv_unused, result,
                                       path,
                                       orig, orig_name,
index a3cf695d3366b1f9790c3f41a663c202245bad54..9e9f2da47c00681f0d9d93cbbcce5f9526cf1c3f 100644 (file)
--- a/po/de.po
+++ b/po/de.po
@@ -55,7 +55,7 @@ msgstr "Konnte '%s' nicht öffnen"
 
 #: bundle.c:140
 msgid "Repository lacks these prerequisite commits:"
-msgstr "Dem Projektarchiv fehlen folgende vorrausgesetzte Versionen:"
+msgstr "Dem Projektarchiv fehlen folgende vorausgesetzte Versionen:"
 
 #: bundle.c:164 sequencer.c:550 sequencer.c:982 builtin/log.c:290
 #: builtin/log.c:726 builtin/log.c:1316 builtin/log.c:1535 builtin/merge.c:347
@@ -1758,7 +1758,7 @@ msgstr "Anzahl"
 #: builtin/apply.c:4291
 msgid "remove <num> leading slashes from traditional diff paths"
 msgstr ""
-"entfernt <Anzahl> vorrangestellte Schrägstriche von herkömmlichen "
+"entfernt <Anzahl> vorangestellte Schrägstriche von herkömmlichen "
 "Differenzpfaden"
 
 #: builtin/apply.c:4294
@@ -2065,7 +2065,7 @@ msgstr "Konnte einige Referenzen nicht lesen"
 #: builtin/branch.c:613
 msgid "cannot rename the current branch while not on any."
 msgstr ""
-"Kann aktuellen Zweig nicht umbennen, solange du dich auf keinem befindest."
+"Kann aktuellen Zweig nicht umbenennen, solange du dich auf keinem befindest."
 
 #: builtin/branch.c:623
 #, c-format
@@ -2353,7 +2353,7 @@ msgid ""
 "git checkout: --ours/--theirs, --force and --merge are incompatible when\n"
 "checking out of the index."
 msgstr ""
-"git checkout: --ours/--theirs, --force and --merge sind inkompatibel wenn\n"
+"git checkout: --ours/--theirs, --force und --merge sind inkompatibel wenn\n"
 "du aus der Bereitstellung auscheckst."
 
 #: builtin/checkout.c:1093
@@ -3666,7 +3666,7 @@ msgstr "Konnte %s nicht nach %s verschieben"
 #: builtin/init-db.c:363
 #, c-format
 msgid "Could not create git link %s"
-msgstr "Konnte git-Verknüfung %s nicht erstellen"
+msgstr "Konnte git-Verknüpfung %s nicht erstellen"
 
 #.
 #. * TRANSLATORS: The first '%s' is either "Reinitialized
@@ -3778,11 +3778,11 @@ msgstr "unechte Einreicher-Informationen %s"
 
 #: builtin/log.c:1205
 msgid "-n and -k are mutually exclusive."
-msgstr "-n und -k schliessen sich gegenseitig aus"
+msgstr "-n und -k schließen sich gegenseitig aus"
 
 #: builtin/log.c:1207
 msgid "--subject-prefix and -k are mutually exclusive."
-msgstr "--subject-prefix und -k schliessen sich gegenseitig aus"
+msgstr "--subject-prefix und -k schließen sich gegenseitig aus"
 
 #: builtin/log.c:1215
 msgid "--name-only does not make sense"
index ccb5435b2a7dd4724f3bc8e0b0186f248dbad448..741b6b6d166ed5b59917d010f777b8f54d0928cc 100755 (executable)
@@ -18,16 +18,6 @@ swapping compression and hashing order, the person who is making the
 modification *should* take notice and update the test vectors here.
 '
 
-################################################################
-# It appears that people try to run tests without building...
-
-../git >/dev/null
-if test $? != 1
-then
-       echo >&2 'You do not seem to have built git yet.'
-       exit 1
-fi
-
 . ./test-lib.sh
 
 ################################################################
index bf7a2cd6fb649e3b210b537d4d25312ba2921f16..08aa24ca15a377826b9e1cdad73fb232853aea7f 100755 (executable)
@@ -177,9 +177,7 @@ test_expect_success 'tag pointing to something else than its type' '
        test_when_finished "remove_object $tag" &&
        echo $tag >.git/refs/tags/wrong &&
        test_when_finished "git update-ref -d refs/tags/wrong" &&
-       test_must_fail git fsck --tags 2>out &&
-       cat out &&
-       grep "error in tag.*broken links" out
+       test_must_fail git fsck --tags
 '
 
 test_expect_success 'cleaned up' '
index 35ec294d9a56d5fc6b22ee2a39166325352bd639..69ee13c8bebbdb1303378288597420cdf70b7b88 100755 (executable)
@@ -89,7 +89,7 @@ test_expect_success 'push with !receive.fsckobjects' '
 
 cat >exp <<EOF
 To dst
-!      refs/heads/master:refs/heads/test       [remote rejected] (n/a (unpacker error))
+!      refs/heads/master:refs/heads/test       [remote rejected] (unpacker error)
 EOF
 
 test_expect_success 'push with receive.fsckobjects' '
diff --git a/t/t5709-clone-refspec.sh b/t/t5709-clone-refspec.sh
new file mode 100755 (executable)
index 0000000..6f1ea98
--- /dev/null
@@ -0,0 +1,156 @@
+#!/bin/sh
+
+test_description='test refspec written by clone-command'
+. ./test-lib.sh
+
+test_expect_success 'setup' '
+       # Make two branches, "master" and "side"
+       echo one >file &&
+       git add file &&
+       git commit -m one &&
+       echo two >file &&
+       git commit -a -m two &&
+       git tag two &&
+       echo three >file &&
+       git commit -a -m three &&
+       git checkout -b side &&
+       echo four >file &&
+       git commit -a -m four &&
+       git checkout master &&
+
+       # default clone
+       git clone . dir_all &&
+
+       # default --single that follows HEAD=master
+       git clone --single-branch . dir_master &&
+
+       # default --single that follows HEAD=side
+       git checkout side &&
+       git clone --single-branch . dir_side &&
+
+       # explicit --single that follows side
+       git checkout master &&
+       git clone --single-branch --branch side . dir_side2 &&
+
+       # default --single with --mirror
+       git clone --single-branch --mirror . dir_mirror &&
+
+       # default --single with --branch and --mirror
+       git clone --single-branch --mirror --branch side . dir_mirror_side &&
+
+       # --single that does not know what branch to follow
+       git checkout two^ &&
+       git clone --single-branch . dir_detached &&
+
+       # explicit --single with tag
+       git clone --single-branch --branch two . dir_tag &&
+
+       # advance both "master" and "side" branches
+       git checkout side &&
+       echo five >file &&
+       git commit -a -m five &&
+       git checkout master &&
+       echo six >file &&
+       git commit -a -m six &&
+
+       # update tag
+       git tag -d two && git tag two
+'
+
+test_expect_success 'by default all branches will be kept updated' '
+       (
+               cd dir_all && git fetch &&
+               git for-each-ref refs/remotes/origin |
+               sed -e "/HEAD$/d" \
+                   -e "s|/remotes/origin/|/heads/|" >../actual
+       ) &&
+       # follow both master and side
+       git for-each-ref refs/heads >expect &&
+       test_cmp expect actual
+'
+
+test_expect_success 'by default no tags will be kept updated' '
+       (
+               cd dir_all && git fetch &&
+               git for-each-ref refs/tags >../actual
+       ) &&
+       git for-each-ref refs/tags >expect &&
+       test_must_fail test_cmp expect actual
+'
+
+test_expect_success '--single-branch while HEAD pointing at master' '
+       (
+               cd dir_master && git fetch &&
+               git for-each-ref refs/remotes/origin |
+               sed -e "/HEAD$/d" \
+                   -e "s|/remotes/origin/|/heads/|" >../actual
+       ) &&
+       # only follow master
+       git for-each-ref refs/heads/master >expect &&
+       test_cmp expect actual
+'
+
+test_expect_success '--single-branch while HEAD pointing at side' '
+       (
+               cd dir_side && git fetch &&
+               git for-each-ref refs/remotes/origin |
+               sed -e "/HEAD$/d" \
+                   -e "s|/remotes/origin/|/heads/|" >../actual
+       ) &&
+       # only follow side
+       git for-each-ref refs/heads/side >expect &&
+       test_cmp expect actual
+'
+
+test_expect_success '--single-branch with explicit --branch side' '
+       (
+               cd dir_side2 && git fetch &&
+               git for-each-ref refs/remotes/origin |
+               sed -e "/HEAD$/d" \
+                   -e "s|/remotes/origin/|/heads/|" >../actual
+       ) &&
+       # only follow side
+       git for-each-ref refs/heads/side >expect &&
+       test_cmp expect actual
+'
+
+test_expect_success '--single-branch with explicit --branch with tag fetches updated tag' '
+       (
+               cd dir_tag && git fetch &&
+               git for-each-ref refs/tags >../actual
+       ) &&
+       git for-each-ref refs/tags >expect &&
+       test_cmp expect actual
+'
+
+test_expect_success '--single-branch with --mirror' '
+       (
+               cd dir_mirror && git fetch &&
+               git for-each-ref refs > ../actual
+       ) &&
+       git for-each-ref refs >expect &&
+       test_cmp expect actual
+'
+
+test_expect_success '--single-branch with explicit --branch and --mirror' '
+       (
+               cd dir_mirror_side && git fetch &&
+               git for-each-ref refs > ../actual
+       ) &&
+       git for-each-ref refs >expect &&
+       test_cmp expect actual
+'
+
+test_expect_success '--single-branch with detached' '
+       (
+               cd dir_detached && git fetch &&
+               git for-each-ref refs/remotes/origin |
+               sed -e "/HEAD$/d" \
+                   -e "s|/remotes/origin/|/heads/|" >../actual
+       )
+       # nothing
+       >expect &&
+       test_cmp expect actual
+'
+
+test_done
index 2cf42c73f14ef5069d096fb29e67dac571227cfe..3889eca4ae8524cd62eaf45b4d7a2394e53da429 100755 (executable)
@@ -53,7 +53,19 @@ test_expect_success 'recursive favouring ours' '
        ! grep 1 file
 '
 
-test_expect_success 'pull with -X' '
+test_expect_success 'binary file with -Xours/-Xtheirs' '
+       echo file binary >.gitattributes &&
+
+       git reset --hard master &&
+       git merge -s recursive -X theirs side &&
+       git diff --exit-code side HEAD -- file &&
+
+       git reset --hard master &&
+       git merge -s recursive -X ours side &&
+       git diff --exit-code master HEAD -- file
+'
+
+test_expect_success 'pull passes -X to underlying merge' '
        git reset --hard master && git pull -s recursive -Xours . side &&
        git reset --hard master && git pull -s recursive -X ours . side &&
        git reset --hard master && git pull -s recursive -Xtheirs . side &&
index 78c428619e99ea0225f61a1fe257e444d464ad0b..b8ee3486b174caf656e620e2bc888c820d37d60d 100644 (file)
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see http://www.gnu.org/licenses/ .
 
-# if --tee was passed, write the output not only to the terminal, but
-# additionally to the file test-results/$BASENAME.out, too.
-case "$GIT_TEST_TEE_STARTED, $* " in
-done,*)
-       # do not redirect again
-       ;;
-*' --tee '*|*' --va'*)
-       mkdir -p test-results
-       BASE=test-results/$(basename "$0" .sh)
-       (GIT_TEST_TEE_STARTED=done ${SHELL-sh} "$0" "$@" 2>&1;
-        echo $? > $BASE.exit) | tee $BASE.out
-       test "$(cat $BASE.exit)" = 0
-       exit
-       ;;
-esac
-
 # Keep the original TERM for say_color
 ORIGINAL_TERM=$TERM
 
@@ -51,9 +35,34 @@ then
 fi
 GIT_BUILD_DIR="$TEST_DIRECTORY"/..
 
+################################################################
+# It appears that people try to run tests without building...
+"$GIT_BUILD_DIR/git" >/dev/null
+if test $? != 1
+then
+       echo >&2 'error: you do not seem to have built git yet.'
+       exit 1
+fi
+
 . "$GIT_BUILD_DIR"/GIT-BUILD-OPTIONS
 export PERL_PATH SHELL_PATH
 
+# if --tee was passed, write the output not only to the terminal, but
+# additionally to the file test-results/$BASENAME.out, too.
+case "$GIT_TEST_TEE_STARTED, $* " in
+done,*)
+       # do not redirect again
+       ;;
+*' --tee '*|*' --va'*)
+       mkdir -p test-results
+       BASE=test-results/$(basename "$0" .sh)
+       (GIT_TEST_TEE_STARTED=done ${SHELL_PATH} "$0" "$@" 2>&1;
+        echo $? > $BASE.exit) | tee $BASE.out
+       test "$(cat $BASE.exit)" = 0
+       exit
+       ;;
+esac
+
 # For repeatability, reset the environment to known value.
 LANG=C
 LC_ALL=C