Sync with GIT 1.5.3.4
authorJunio C Hamano <gitster@pobox.com>
Wed, 3 Oct 2007 10:03:15 +0000 (03:03 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 3 Oct 2007 10:03:15 +0000 (03:03 -0700)
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 files changed:
Documentation/RelNotes-1.5.3.4.txt
Documentation/config.txt
Documentation/diff-options.txt
Documentation/git-branch.txt
Documentation/git-checkout.txt
INSTALL
builtin-for-each-ref.c
builtin-ls-files.c
configure.ac
diff.c
diffcore-rename.c
diffcore.h
git-commit.sh
git-pull.sh
t/t3060-ls-files-with-tree.sh [new file with mode: 0755]
index 47ba2870a2808f6c14b8646c60b650801924fd27..b04b3a45a5629cf852c970ac995bfb80bde846d2 100644 (file)
@@ -4,25 +4,32 @@ GIT v1.5.3.4 Release Notes
 Fixes since v1.5.3.3
 --------------------
 
- * Sample 'post-receive-hook' incorrectly sent out push
+ * Change to "git-ls-files" in v1.5.3.3 that was introduced to support
+   partial commit of removal better had a segfaulting bug, which was
+   diagnosed and fixed by Keith and Carl.
+
+ * Performance improvements for rename detection has been backported
+   from the 'master' branch.
+
+ * "git-for-each-ref --format='%(numparent)'" was not working
+   correctly at all, and --format='%(parent)' was not working for
+   merge commits.
+
+ * Sample "post-receive-hook" incorrectly sent out push
    notification e-mails marked as "From: " the committer of the
    commit that happened to be at the tip of the branch that was
    pushed, not from the person who pushed.
 
- * git-remote did not exit non-zero status upon error.
+ * "git-remote" did not exit non-zero status upon error.
 
  * "git-add -i" did not respond very well to EOF from tty nor
    bogus input.
 
- * "git rebase -i" squash subcommand incorrectly made the
+ * "git-rebase -i" squash subcommand incorrectly made the
    author of later commit the author of resulting commit,
    instead of taking from the first one in the squashed series.
 
- * "git stash apply --index" was not documented.
-
+ * "git-stash apply --index" was not documented.
 
---
-exec >/var/tmp/1
-O=v1.5.3.3-6-g0bdcac5
-echo O=`git describe refs/heads/maint`
-git shortlog --no-merges $O..refs/heads/maint
+ * autoconfiguration learned that "ar" command is found as "gas" on
+   some systems.
index 015910f27a450cdaec80f3bfc2679243126736c0..f59fbb30248d9ac1f8e0d44364957359a3f152cb 100644 (file)
@@ -579,7 +579,7 @@ merge.summary::
 
 merge.tool::
        Controls which merge resolution program is used by
-       gitlink:git-mergetool[l].  Valid values are: "kdiff3", "tkdiff",
+       gitlink:git-mergetool[1].  Valid values are: "kdiff3", "tkdiff",
        "meld", "xxdiff", "emerge", "vimdiff", "gvimdiff", and "opendiff".
 
 merge.verbosity::
index 228ccaf10ab6bf7e4a3909d31ac31afbd2361d8c..b1f528ae8864e429a509365a79d16bb8341620e1 100644 (file)
 
 --ext-diff::
        Allow an external diff helper to be executed. If you set an
-       external diff driver with gitlink:gitattributes(5), you need
-       to use this option with gitlink:git-log(1) and friends.
+       external diff driver with gitlink:gitattributes[5], you need
+       to use this option with gitlink:git-log[1] and friends.
 
 --no-ext-diff::
        Disallow external diff drivers.
index 33bc31b0d4491169cdbfb06f3dc6c42ec84b1365..b7285bcdbc80a2aa574fa13050c00f1ce9975419 100644 (file)
@@ -26,6 +26,10 @@ It will start out with a head equal to the one given as <start-point>.
 If no <start-point> is given, the branch will be created with a head
 equal to that of the currently checked out branch.
 
+Note that this will create the new branch, but it will not switch the
+working tree to it; use "git checkout <newbranch>" to switch to the
+new branch.
+
 When a local branch is started off a remote branch, git can setup the
 branch so that gitlink:git-pull[1] will appropriately merge from that
 remote branch.  If this behavior is desired, it is possible to make it
@@ -91,6 +95,21 @@ OPTIONS
 --no-abbrev::
        Display the full sha1s in output listing rather than abbreviating them.
 
+--track::
+       Set up configuration so that git-pull will automatically
+       retrieve data from the remote branch.  Use this if you always
+       pull from the same remote branch into the new branch, or if you
+       don't want to use "git pull <repository> <refspec>" explicitly.  Set the
+       branch.autosetupmerge configuration variable to true if you
+       want git-checkout and git-branch to always behave as if
+       '--track' were given.
+
+--no-track::
+       When -b is given and a branch is created off a remote branch,
+       set up configuration so that git-pull will not retrieve data
+       from the remote branch, ignoring the branch.autosetupmerge
+       configuration variable.
+
 <branchname>::
        The name of the branch to create or delete.
        The new branch name must pass all checks defined by
index 734928bf96c35fbe3f66c6693415e0a0d05f9412..2e58481ed68b0cc8540b7126a9c5c389e3f67197 100644 (file)
@@ -50,7 +50,9 @@ OPTIONS
 --track::
        When -b is given and a branch is created off a remote branch,
        set up configuration so that git-pull will automatically
-       retrieve data from the remote branch.  Set the
+       retrieve data from the remote branch.  Use this if you always
+       pull from the same remote branch into the new branch, or if you
+       don't want to use "git pull <repository> <refspec>" explicitly.  Set the
        branch.autosetupmerge configuration variable to true if you
        want git-checkout and git-branch to always behave as if
        '--track' were given.
diff --git a/INSTALL b/INSTALL
index 289b046a443c0647624607d471289b2c7dcd470b..f1eb4049b9f839c1b3d1aa5a4d7387d0e93f0f5c 100644 (file)
--- a/INSTALL
+++ b/INSTALL
@@ -79,6 +79,9 @@ Issues of note:
        - "perl" and POSIX-compliant shells are needed to use most of
          the barebone Porcelainish scripts.
 
+       - "cpio" is used by git-merge for saving and restoring the index,
+         and by git-clone when doing a local (possibly hardlinked) clone.
+
  - Some platform specific issues are dealt with Makefile rules,
    but depending on your specific installation, you may not
    have all the libraries/tools needed, or you may have
index 0afa1c5c41e79a05ddebb7d874956163510daf0b..29f70aabc3f1df027f59dfdbac82e025653a8d87 100644 (file)
@@ -43,7 +43,7 @@ static struct {
        { "objectsize", FIELD_ULONG },
        { "objectname" },
        { "tree" },
-       { "parent" }, /* NEEDSWORK: how to address 2nd and later parents? */
+       { "parent" },
        { "numparent", FIELD_ULONG },
        { "object" },
        { "type" },
@@ -262,24 +262,26 @@ static void grab_commit_values(struct atom_value *val, int deref, struct object
                }
                if (!strcmp(name, "numparent")) {
                        char *s = xmalloc(40);
+                       v->ul = num_parents(commit);
                        sprintf(s, "%lu", v->ul);
                        v->s = s;
-                       v->ul = num_parents(commit);
                }
                else if (!strcmp(name, "parent")) {
                        int num = num_parents(commit);
                        int i;
                        struct commit_list *parents;
-                       char *s = xmalloc(42 * num);
+                       char *s = xmalloc(41 * num + 1);
                        v->s = s;
                        for (i = 0, parents = commit->parents;
                             parents;
-                            parents = parents->next, i = i + 42) {
+                            parents = parents->next, i = i + 41) {
                                struct commit *parent = parents->item;
                                strcpy(s+i, sha1_to_hex(parent->object.sha1));
                                if (parents->next)
                                        s[i+40] = ' ';
                        }
+                       if (!i)
+                               *s = '\0';
                }
        }
 }
index 6c1db86e8056285cb25359d55f5ebf9dd0e6f489..171d449048d304b043ed33776fab4bf95434e30a 100644 (file)
@@ -280,7 +280,8 @@ static void prune_cache(const char *prefix)
 
        if (pos < 0)
                pos = -pos-1;
-       active_cache += pos;
+       memmove(active_cache, active_cache + pos,
+               (active_nr - pos) * sizeof(struct cache_entry *));
        active_nr -= pos;
        first = 0;
        last = active_nr;
index 84fd7f1e1f2fd670de38a43bfe65d3988fc4767e..ed7cc895d276ac4d7548211a364a4e6952f9b7bd 100644 (file)
@@ -104,7 +104,7 @@ AC_MSG_NOTICE([CHECKS for programs])
 #
 AC_PROG_CC([cc gcc])
 #AC_PROG_INSTALL               # needs install-sh or install.sh in sources
-AC_CHECK_TOOL(AR, ar, :)
+AC_CHECK_TOOLS(AR, [gar ar], :)
 AC_CHECK_PROGS(TAR, [gtar tar])
 # TCLTK_PATH will be set to some value if we want Tcl/Tk
 # or will be empty otherwise.
diff --git a/diff.c b/diff.c
index 35e3c619864809a46cd5b6a36d08e8103b5ce485..71b340c5368fb287ce7d7b242aa51436ed5dda93 100644 (file)
--- a/diff.c
+++ b/diff.c
@@ -1675,7 +1675,7 @@ int diff_populate_filespec(struct diff_filespec *s, int size_only)
        return 0;
 }
 
-void diff_free_filespec_data_large(struct diff_filespec *s)
+void diff_free_filespec_blob(struct diff_filespec *s)
 {
        if (s->should_free)
                free(s->data);
@@ -1690,7 +1690,7 @@ void diff_free_filespec_data_large(struct diff_filespec *s)
 
 void diff_free_filespec_data(struct diff_filespec *s)
 {
-       diff_free_filespec_data_large(s);
+       diff_free_filespec_blob(s);
        free(s->cnt_data);
        s->cnt_data = NULL;
 }
index 4fc200064ae655c6936828c6bf04234afde778ce..142e5376dd741377c311075816f139a0949ee82f 100644 (file)
@@ -378,10 +378,10 @@ void diffcore_rename(struct diff_options *options)
                        m->score = estimate_similarity(one, two,
                                                       minimum_score);
                        m->name_score = basename_same(one, two);
-                       diff_free_filespec_data_large(one);
+                       diff_free_filespec_blob(one);
                }
                /* We do not need the text anymore */
-               diff_free_filespec_data_large(two);
+               diff_free_filespec_blob(two);
                dst_cnt++;
        }
        /* cost matrix sorted by most to least similar pair */
index 4bf175bda99f51f8df1445349d87bc59b56095e7..eb618b1ec00113dabcd5231f141f82e1cdfdca46 100644 (file)
@@ -48,7 +48,7 @@ extern void fill_filespec(struct diff_filespec *, const unsigned char *,
 
 extern int diff_populate_filespec(struct diff_filespec *, int);
 extern void diff_free_filespec_data(struct diff_filespec *);
-extern void diff_free_filespec_data_large(struct diff_filespec *);
+extern void diff_free_filespec_blob(struct diff_filespec *);
 extern int diff_filespec_is_binary(struct diff_filespec *);
 
 struct diff_filepair {
index cb14f0621651d2006b08d1eddf67ab3269df84d0..c3b881bfadd7ca20d9e14ab6f1c53a9c365fca72 100755 (executable)
@@ -25,6 +25,7 @@ refuse_partial () {
        exit 1
 }
 
+TMP_INDEX=
 THIS_INDEX="$GIT_DIR/index"
 NEXT_INDEX="$GIT_DIR/next-index$$"
 rm -f "$NEXT_INDEX"
index c3f05f56de300ad48d940def184698fb37c40028..74bfc16744d69d8394f89b6f77d81697a8336032 100755 (executable)
@@ -97,10 +97,24 @@ case "$merge_head" in
        esac
        curr_branch=${curr_branch#refs/heads/}
 
-       echo >&2 "Warning: No merge candidate found because value of config option
-         \"branch.${curr_branch}.merge\" does not match any remote branch fetched."
-       echo >&2 "No changes."
-       exit 0
+       echo >&2 "You asked me to pull without telling me which branch you"
+       echo >&2 "want to merge with, and 'branch.${curr_branch}.merge' in"
+       echo >&2 "your configuration file does not tell me either.  Please"
+       echo >&2 "name which branch you want to merge on the command line and"
+       echo >&2 "try again (e.g. 'git pull <repository> <refspec>')."
+       echo >&2 "See git-pull(1) for details on the refspec."
+       echo >&2
+       echo >&2 "If you often merge with the same branch, you may want to"
+       echo >&2 "configure the following variables in your configuration"
+       echo >&2 "file:"
+       echo >&2
+       echo >&2 "    branch.${curr_branch}.remote = <nickname>"
+       echo >&2 "    branch.${curr_branch}.merge = <remote-ref>"
+       echo >&2 "    remote.<nickname>.url = <url>"
+       echo >&2 "    remote.<nickname>.fetch = <refspec>"
+       echo >&2
+       echo >&2 "See git-config(1) for details."
+       exit 1
        ;;
 ?*' '?*)
        if test -z "$orig_head"
diff --git a/t/t3060-ls-files-with-tree.sh b/t/t3060-ls-files-with-tree.sh
new file mode 100755 (executable)
index 0000000..68eb266
--- /dev/null
@@ -0,0 +1,71 @@
+#!/bin/sh
+#
+# Copyright (c) 2007 Carl D. Worth
+#
+
+test_description='git ls-files test (--with-tree).
+
+This test runs git ls-files --with-tree and in particular in
+a scenario known to trigger a crash with some versions of git.
+'
+. ./test-lib.sh
+
+test_expect_success setup '
+
+       # The bug we are exercising requires a fair number of entries
+       # in a sub-directory so that add_index_entry will trigger a
+       # realloc.
+
+       echo file >expected &&
+       mkdir sub &&
+       bad= &&
+       for n in 0 1 2 3 4 5
+       do
+               for m in 0 1 2 3 4 5 6 7 8 9
+               do
+                       num=00$n$m &&
+                       >sub/file-$num &&
+                       echo file-$num >>expected || {
+                               bad=t
+                               break
+                       }
+               done && test -z "$bad" || {
+                       bad=t
+                       break
+               }
+       done && test -z "$bad" &&
+       git add . &&
+       git commit -m "add a bunch of files" &&
+
+       # We remove them all so that we will have something to add
+       # back with --with-tree and so that we will definitely be
+       # under the realloc size to trigger the bug.
+       rm -rf sub &&
+       git commit -a -m "remove them all" &&
+
+       # The bug also requires some entry before our directory so that
+       # prune_path will modify the_index.cache
+
+       mkdir a_directory_that_sorts_before_sub &&
+       >a_directory_that_sorts_before_sub/file &&
+       mkdir sub &&
+       >sub/file &&
+       git add .
+'
+
+# We have to run from a sub-directory to trigger prune_path
+# Then we finally get to run our --with-tree test
+cd sub
+
+test_expect_success 'git -ls-files --with-tree should succeed from subdir' '
+
+       git ls-files --with-tree=HEAD~1 >../output
+
+'
+
+cd ..
+test_expect_success \
+    'git -ls-files --with-tree should add entries from named tree.' \
+    'diff -u expected output'
+
+test_done