summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2007-10-03 03:03:15 -0700
committerJunio C Hamano <gitster@pobox.com>2007-10-03 03:03:15 -0700
commitfed276e7524d6a80ae5dec037d586bd28543fc79 (patch)
tree979ede5142a918b8d0de5249789f697389e3d0b8
parent34c6dbdef439f7cd93d3fe22493a3c1496ce96f7 (diff)
parent4c75136f7697f76b31641db775163f5c75906ee2 (diff)
downloadgit-fed276e7524d6a80ae5dec037d586bd28543fc79.tar.gz
Sync with GIT 1.5.3.4
Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--Documentation/RelNotes-1.5.3.4.txt27
-rw-r--r--Documentation/config.txt2
-rw-r--r--Documentation/diff-options.txt4
-rw-r--r--Documentation/git-branch.txt19
-rw-r--r--Documentation/git-checkout.txt4
-rw-r--r--INSTALL3
-rw-r--r--builtin-for-each-ref.c10
-rw-r--r--builtin-ls-files.c3
-rw-r--r--configure.ac2
-rw-r--r--diff.c4
-rw-r--r--diffcore-rename.c4
-rw-r--r--diffcore.h2
-rwxr-xr-xgit-commit.sh1
-rwxr-xr-xgit-pull.sh22
-rwxr-xr-xt/t3060-ls-files-with-tree.sh71
15 files changed, 149 insertions, 29 deletions
diff --git a/Documentation/RelNotes-1.5.3.4.txt b/Documentation/RelNotes-1.5.3.4.txt
index 47ba2870a2..b04b3a45a5 100644
--- a/Documentation/RelNotes-1.5.3.4.txt
+++ b/Documentation/RelNotes-1.5.3.4.txt
@@ -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.
diff --git a/Documentation/config.txt b/Documentation/config.txt
index 015910f27a..f59fbb3024 100644
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
@@ -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::
diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt
index 228ccaf10a..b1f528ae88 100644
--- a/Documentation/diff-options.txt
+++ b/Documentation/diff-options.txt
@@ -179,8 +179,8 @@
--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.
diff --git a/Documentation/git-branch.txt b/Documentation/git-branch.txt
index 33bc31b0d4..b7285bcdbc 100644
--- a/Documentation/git-branch.txt
+++ b/Documentation/git-branch.txt
@@ -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
diff --git a/Documentation/git-checkout.txt b/Documentation/git-checkout.txt
index 734928bf96..2e58481ed6 100644
--- a/Documentation/git-checkout.txt
+++ b/Documentation/git-checkout.txt
@@ -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 289b046a44..f1eb4049b9 100644
--- 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
diff --git a/builtin-for-each-ref.c b/builtin-for-each-ref.c
index 0afa1c5c41..29f70aabc3 100644
--- a/builtin-for-each-ref.c
+++ b/builtin-for-each-ref.c
@@ -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';
}
}
}
diff --git a/builtin-ls-files.c b/builtin-ls-files.c
index 6c1db86e80..171d449048 100644
--- a/builtin-ls-files.c
+++ b/builtin-ls-files.c
@@ -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;
diff --git a/configure.ac b/configure.ac
index 84fd7f1e1f..ed7cc895d2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -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 35e3c61986..71b340c536 100644
--- 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;
}
diff --git a/diffcore-rename.c b/diffcore-rename.c
index 4fc200064a..142e5376dd 100644
--- a/diffcore-rename.c
+++ b/diffcore-rename.c
@@ -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 */
diff --git a/diffcore.h b/diffcore.h
index 4bf175bda9..eb618b1ec0 100644
--- a/diffcore.h
+++ b/diffcore.h
@@ -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 {
diff --git a/git-commit.sh b/git-commit.sh
index cb14f06216..c3b881bfad 100755
--- a/git-commit.sh
+++ b/git-commit.sh
@@ -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"
diff --git a/git-pull.sh b/git-pull.sh
index c3f05f56de..74bfc16744 100755
--- a/git-pull.sh
+++ b/git-pull.sh
@@ -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
index 0000000000..68eb266d73
--- /dev/null
+++ b/t/t3060-ls-files-with-tree.sh
@@ -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