From 33c8d38c7879ee9af0365481eecb4b3906da111a Mon Sep 17 00:00:00 2001 From: "Shawn O. Pearce" Date: Tue, 16 Oct 2007 20:09:21 -0400 Subject: Correct typos in release notes for 1.5.3.5 Noticed by Michele Ballabio. Signed-off-by: Shawn O. Pearce --- Documentation/RelNotes-1.5.3.5.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/RelNotes-1.5.3.5.txt b/Documentation/RelNotes-1.5.3.5.txt index 6a1901a96d..47891ffa4a 100644 --- a/Documentation/RelNotes-1.5.3.5.txt +++ b/Documentation/RelNotes-1.5.3.5.txt @@ -4,7 +4,7 @@ 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 @@ -18,7 +18,7 @@ Fixes since v1.5.3.4 * "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) + * Documentation updates for supported (but previously undocumented) options of "git-archive" and "git-reflog". * "make clean" no longer deletes the configure script that ships -- cgit v1.2.3 From dd5c8af176bb935a0b01a7dc2d5e022565c3aac3 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Wed, 17 Oct 2007 00:37:36 +0100 Subject: Fix setup_git_directory_gently() with relative GIT_DIR & GIT_WORK_TREE There are a few programs, such as config and diff, which allow running without a git repository. Therefore, they have to call setup_git_directory_gently(). However, when GIT_DIR and GIT_WORK_TREE were set, and the current directory was a subdirectory of the work tree, setup_git_directory_gently() would return a bogus NULL prefix. This patch fixes that. Noticed by REPLeffect on IRC. Signed-off-by: Johannes Schindelin Signed-off-by: Shawn O. Pearce --- setup.c | 13 ++++++++++++- t/t1501-worktree.sh | 9 +++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/setup.c b/setup.c index 06004f1587..145eca50f4 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 732216184f..7ee3820ce9 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 -- cgit v1.2.3 From 7e23b06d5972ebf6377380b2dba97aeea9b7c02d Mon Sep 17 00:00:00 2001 From: Andrew Clausen Date: Tue, 16 Oct 2007 17:16:05 -0400 Subject: helpful error message when send-pack finds no refs in common. Signed-off-by: Andrew Clausen Signed-off-by: Shawn O. Pearce --- send-pack.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/send-pack.c b/send-pack.c index 9fc8a812f4..fd985ed28d 100644 --- a/send-pack.c +++ b/send-pack.c @@ -204,7 +204,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; } -- cgit v1.2.3 From 8ef44519a64d3ac863a9a3a6dbdba09ea275c822 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Wed, 17 Oct 2007 03:22:25 +0100 Subject: fix filter-branch documentation The man page for filter-branch still talked about writing the result to the branch "newbranch". This is hopefully the last place where the old behaviour was described. Noticed by Bill Lear. Signed-off-by: Johannes Schindelin Signed-off-by: Shawn O. Pearce --- Documentation/git-filter-branch.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Documentation/git-filter-branch.txt b/Documentation/git-filter-branch.txt index c878ed395e..ba9b4fbca7 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 -- cgit v1.2.3 From 46eb449cbefac461659c42c4ba4b36de1959e7ca Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Wed, 17 Oct 2007 03:23:10 +0100 Subject: filter-branch: update current branch when rewritten Earlier, "git filter-branch -- HEAD" would not update the working tree after rewriting the branch. This commit fixes it. Signed-off-by: Johannes Schindelin Signed-off-by: Shawn O. Pearce --- git-filter-branch.sh | 15 +++++++++++++++ t/t7003-filter-branch.sh | 4 +++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/git-filter-branch.sh b/git-filter-branch.sh index a12f6c2d4c..ffcc408ee5 100755 --- a/git-filter-branch.sh +++ b/git-filter-branch.sh @@ -94,6 +94,10 @@ USAGE="[--env-filter ] [--tree-filter ] \ . 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/t/t7003-filter-branch.sh b/t/t7003-filter-branch.sh index e935b2000a..2089351f7d 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 -- cgit v1.2.3 From f5f30699c078be289daaabb61ed69e1f84747a78 Mon Sep 17 00:00:00 2001 From: "Shawn O. Pearce" Date: Tue, 16 Oct 2007 21:33:11 -0400 Subject: Avoid 'expr index' on Mac OS X as it isn't supported This fixes git-instaweb so it can start an httpd without warning about an invalid test command. Yes its ugly, but its also quite portable. Signed-off-by: Shawn O. Pearce --- git-instaweb.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/git-instaweb.sh b/git-instaweb.sh index f5629e7439..41ff08f8e4 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 -- cgit v1.2.3 From 09955207d148c5f3964002b7f3a4e13db3050777 Mon Sep 17 00:00:00 2001 From: "Shawn O. Pearce" Date: Tue, 16 Oct 2007 23:31:58 -0400 Subject: Document additional 1.5.3.5 fixes in release notes Signed-off-by: Shawn O. Pearce --- Documentation/RelNotes-1.5.3.5.txt | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Documentation/RelNotes-1.5.3.5.txt b/Documentation/RelNotes-1.5.3.5.txt index 47891ffa4a..de38a84ad6 100644 --- a/Documentation/RelNotes-1.5.3.5.txt +++ b/Documentation/RelNotes-1.5.3.5.txt @@ -10,14 +10,29 @@ Fixes since v1.5.3.4 * "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. + * "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". -- cgit v1.2.3