aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2007-10-16 23:32:03 -0400
committerShawn O. Pearce <spearce@spearce.org>2007-10-16 23:32:03 -0400
commit317efa63fc457d1a726902ddf97298c201df627c (patch)
treed4f38c3fd8ec2a422c4db76e00b784f760540f1f
parent54f0db79ca11d08a448e45cfcb6e4304c6d16014 (diff)
parent09955207d148c5f3964002b7f3a4e13db3050777 (diff)
downloadgit-317efa63fc457d1a726902ddf97298c201df627c.tar.gz
git-317efa63fc457d1a726902ddf97298c201df627c.tar.xz
Merge branch 'maint'
* maint: Document additional 1.5.3.5 fixes in release notes Avoid 'expr index' on Mac OS X as it isn't supported filter-branch: update current branch when rewritten fix filter-branch documentation helpful error message when send-pack finds no refs in common. Fix setup_git_directory_gently() with relative GIT_DIR & GIT_WORK_TREE Correct typos in release notes for 1.5.3.5
-rw-r--r--Documentation/RelNotes-1.5.3.5.txt19
-rw-r--r--Documentation/git-filter-branch.txt3
-rwxr-xr-xgit-filter-branch.sh15
-rwxr-xr-xgit-instaweb.sh3
-rw-r--r--send-pack.c3
-rw-r--r--setup.c13
-rwxr-xr-xt/t1501-worktree.sh9
-rwxr-xr-xt/t7003-filter-branch.sh4
8 files changed, 60 insertions, 9 deletions
diff --git a/Documentation/RelNotes-1.5.3.5.txt b/Documentation/RelNotes-1.5.3.5.txt
index 6a1901a96..de38a84ad 100644
--- a/Documentation/RelNotes-1.5.3.5.txt
+++ b/Documentation/RelNotes-1.5.3.5.txt
@@ -4,21 +4,36 @@ GIT v1.5.3.5 Release Notes
Fixes since v1.5.3.4
--------------------
- * "git-config" silently ignored options after --list; now it wilh
+ * "git-config" silently ignored options after --list; now it will
error out with a usage message.
* "git-config --file" failed if the argument used a relative path
as it changed directories before opening the file.
+ * "git-config", "git-diff", "git-apply" failed if run from a
+ subdirectory with relative GIT_DIR and GIT_WORK_TREE set.
+
* "git-add -i" did not handle single line hunks correctly.
+ * "git-rebase -i" failed if external diff drivers were used for one
+ or more files in a commit. It now avoids calling the external
+ diff drivers.
+
* "git-log --follow" did not work unless diff generation (e.g. -p)
was also requested.
* "git-log" printed extra newlines between commits when a diff
was generated internally (e.g. -S or --follow) but not displayed.
- * Documention updates for supported (but previously undocumented)
+ * "git-push" error message is more helpful when pushing to a
+ repository with no matching refs and none specified.
+
+ * "git-filter-branch" now updates the working directory when it
+ has finished filtering the current branch.
+
+ * "git-instaweb" no longer fails on Mac OS X.
+
+ * Documentation updates for supported (but previously undocumented)
options of "git-archive" and "git-reflog".
* "make clean" no longer deletes the configure script that ships
diff --git a/Documentation/git-filter-branch.txt b/Documentation/git-filter-branch.txt
index c878ed395..ba9b4fbca 100644
--- a/Documentation/git-filter-branch.txt
+++ b/Documentation/git-filter-branch.txt
@@ -180,8 +180,7 @@ A significantly faster version:
git filter-branch --index-filter 'git update-index --remove filename' HEAD
--------------------------------------------------------------------------
-Now, you will get the rewritten history saved in the branch 'newbranch'
-(your current branch is left untouched).
+Now, you will get the rewritten history saved in HEAD.
To set a commit (which typically is at the tip of another
history) to be the parent of the current initial commit, in
diff --git a/git-filter-branch.sh b/git-filter-branch.sh
index a12f6c2d4..ffcc408ee 100755
--- a/git-filter-branch.sh
+++ b/git-filter-branch.sh
@@ -94,6 +94,10 @@ USAGE="[--env-filter <command>] [--tree-filter <command>] \
. git-sh-setup
+git diff-files --quiet &&
+ git diff-index --cached --quiet HEAD ||
+ die "Cannot rewrite branch(es) with a dirty working directory."
+
tempdir=.git-rewrite
filter_env=
filter_tree=
@@ -196,6 +200,9 @@ do
esac
done < "$tempdir"/backup-refs
+ORIG_GIT_DIR="$GIT_DIR"
+ORIG_GIT_WORK_TREE="$GIT_WORK_TREE"
+ORIG_GIT_INDEX_FILE="$GIT_INDEX_FILE"
export GIT_DIR GIT_WORK_TREE=.
# These refs should be updated if their heads were rewritten
@@ -413,4 +420,12 @@ echo
test $count -gt 0 && echo "These refs were rewritten:"
git show-ref | grep ^"$orig_namespace"
+unset GIT_DIR GIT_WORK_TREE GIT_INDEX_FILE
+test -z "$ORIG_GIT_DIR" || GIT_DIR="$ORIG_GIT_DIR" && export GIT_DIR
+test -z "$ORIG_GIT_WORK_TREE" || GIT_WORK_TREE="$ORIG_GIT_WORK_TREE" &&
+ export GIT_WORK_TREE
+test -z "$ORIG_GIT_INDEX_FILE" || GIT_INDEX_FILE="$ORIG_GIT_INDEX_FILE" &&
+ export GIT_INDEX_FILE
+git read-tree -u -m HEAD
+
exit $ret
diff --git a/git-instaweb.sh b/git-instaweb.sh
index 2e4eeccac..95c3e5aa1 100755
--- a/git-instaweb.sh
+++ b/git-instaweb.sh
@@ -30,8 +30,7 @@ test -z "$port" && port=1234
start_httpd () {
httpd_only="`echo $httpd | cut -f1 -d' '`"
- if test "`expr index $httpd_only /`" -eq '1' || \
- which $httpd_only >/dev/null
+ if case "$httpd_only" in /*) : ;; *) which $httpd_only >/dev/null;; esac
then
$httpd $fqgitdir/gitweb/httpd.conf
else
diff --git a/send-pack.c b/send-pack.c
index 16ed51f6a..c1807f079 100644
--- a/send-pack.c
+++ b/send-pack.c
@@ -205,7 +205,8 @@ static int send_pack(int in, int out, struct remote *remote, int nr_refspec, cha
return -1;
if (!remote_refs) {
- fprintf(stderr, "No refs in common and none specified; doing nothing.\n");
+ fprintf(stderr, "No refs in common and none specified; doing nothing.\n"
+ "Perhaps you should specify a branch such as 'master'.\n");
return 0;
}
diff --git a/setup.c b/setup.c
index 06004f158..145eca50f 100644
--- a/setup.c
+++ b/setup.c
@@ -227,9 +227,20 @@ const char *setup_git_directory_gently(int *nongit_ok)
if (PATH_MAX - 40 < strlen(gitdirenv))
die("'$%s' too big", GIT_DIR_ENVIRONMENT);
if (is_git_directory(gitdirenv)) {
+ static char buffer[1024 + 1];
+ const char *retval;
+
if (!work_tree_env)
return set_work_tree(gitdirenv);
- return NULL;
+ retval = get_relative_cwd(buffer, sizeof(buffer) - 1,
+ get_git_work_tree());
+ if (!retval || !*retval)
+ return NULL;
+ set_git_dir(make_absolute_path(gitdirenv));
+ if (chdir(work_tree_env) < 0)
+ die ("Could not chdir to %s", work_tree_env);
+ strcat(buffer, "/");
+ return retval;
}
if (nongit_ok) {
*nongit_ok = 1;
diff --git a/t/t1501-worktree.sh b/t/t1501-worktree.sh
index 732216184..7ee3820ce 100755
--- a/t/t1501-worktree.sh
+++ b/t/t1501-worktree.sh
@@ -103,4 +103,13 @@ test_expect_success 'repo finds its work tree from work tree, too' '
test sub/dir/tracked = "$(git ls-files)")
'
+test_expect_success '_gently() groks relative GIT_DIR & GIT_WORK_TREE' '
+ cd repo.git/work/sub/dir &&
+ GIT_DIR=../../.. GIT_WORK_TREE=../.. GIT_PAGER= \
+ git diff --exit-code tracked &&
+ echo changed > tracked &&
+ ! GIT_DIR=../../.. GIT_WORK_TREE=../.. GIT_PAGER= \
+ git diff --exit-code tracked
+'
+
test_done
diff --git a/t/t7003-filter-branch.sh b/t/t7003-filter-branch.sh
index e935b2000..2089351f7 100755
--- a/t/t7003-filter-branch.sh
+++ b/t/t7003-filter-branch.sh
@@ -41,7 +41,9 @@ test_expect_success 'rewrite, renaming a specific file' '
'
test_expect_success 'test that the file was renamed' '
- test d = $(git show HEAD:doh)
+ test d = $(git show HEAD:doh) &&
+ test -f doh &&
+ test d = $(cat doh)
'
git tag oldD HEAD~4