From 2ac8af1619feba08ec2285c0e305489a5cf815c9 Mon Sep 17 00:00:00 2001 From: Daniel Barkalow Date: Tue, 26 Feb 2008 17:15:31 -0500 Subject: Don't use GIT_CONFIG in t5505-remote For some reason, t5505-remote was setting GIT_CONFIG to .git/config and exporting it. This should have been no-op, as test framework did the same for a long time anyway. Signed-off-by: Daniel Barkalow Signed-off-by: Junio C Hamano --- t/t5505-remote.sh | 3 --- 1 file changed, 3 deletions(-) diff --git a/t/t5505-remote.sh b/t/t5505-remote.sh index 636aec2f7..4fc62f550 100755 --- a/t/t5505-remote.sh +++ b/t/t5505-remote.sh @@ -4,9 +4,6 @@ test_description='git remote porcelain-ish' . ./test-lib.sh -GIT_CONFIG=.git/config -export GIT_CONFIG - setup_repository () { mkdir "$1" && ( cd "$1" && -- cgit v1.2.1 From a50a5c8fa66bf7077c986bcc39b3fdad17931e37 Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Wed, 27 Feb 2008 14:13:00 +0100 Subject: Documentation/git svn log: add a note about timezones. git svn log mimics the timezone converting behaviour of svn log, but this was undocumented. Signed-off-by: Miklos Vajna Signed-off-by: Junio C Hamano --- Documentation/git-svn.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Documentation/git-svn.txt b/Documentation/git-svn.txt index b1d527f74..115b8bee0 100644 --- a/Documentation/git-svn.txt +++ b/Documentation/git-svn.txt @@ -159,6 +159,10 @@ New features: our version of --pretty=oneline -- + +NOTE: SVN itself only stores times in UTC and nothing else. The regular svn +client converts the UTC time to the local time (or based on the TZ= +environment). This command has the same behaviour. ++ Any other arguments are passed directly to `git log' -- -- cgit v1.2.1 From 0460fb449b18cd95805c1bf97013957ee9b8ff9b Mon Sep 17 00:00:00 2001 From: Jonathan del Strother Date: Wed, 27 Feb 2008 12:50:22 +0000 Subject: Prompt to continue when editing during rebase --interactive On hitting an edit point in an interactive rebase, git should prompt the user to run "git rebase --continue" Signed-off-by: Jonathan del Strother Signed-off-by: Junio C Hamano --- git-rebase--interactive.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh index fb12b03b2..c2bedd622 100755 --- a/git-rebase--interactive.sh +++ b/git-rebase--interactive.sh @@ -268,6 +268,10 @@ do_next () { warn warn " git commit --amend" warn + warn "Once you are satisfied with your changes, run" + warn + warn " git rebase --continue" + warn exit 0 ;; squash|s) -- cgit v1.2.1 From 9057f0a62c8681bcff8460fec80747a6aa5b43c8 Mon Sep 17 00:00:00 2001 From: Johan Herland Date: Wed, 13 Feb 2008 04:11:22 +0100 Subject: Add testcase for 'git cvsexportcommit -w $cvsdir ...' with relative $GIT_DIR The testcase verifies that 'git cvsexportcommit' functions correctly when the '-w' option is used, and GIT_DIR is set to a relative path (e.g. '.'). Signed-off-by: Johan Herland Signed-off-by: Junio C Hamano --- t/t9200-git-cvsexportcommit.sh | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/t/t9200-git-cvsexportcommit.sh b/t/t9200-git-cvsexportcommit.sh index a15222ced..7e25a392a 100755 --- a/t/t9200-git-cvsexportcommit.sh +++ b/t/t9200-git-cvsexportcommit.sh @@ -2,7 +2,7 @@ # # Copyright (c) Robin Rosenberg # -test_description='CVS export comit. ' +test_description='Test export of commits to CVS' . ./test-lib.sh @@ -246,4 +246,20 @@ test_expect_success \ ;; esac +test_expect_failure '-w option should work with relative GIT_DIR' ' + mkdir W && + echo foobar >W/file1.txt && + echo bazzle >W/file2.txt && + git add W/file1.txt && + git add W/file2.txt && + git commit -m "More updates" && + id=$(git rev-list --max-count=1 HEAD) && + (cd "$GIT_DIR" && + GIT_DIR=. git cvsexportcommit -w "$CVSWORK" -c $id && + check_entries "$CVSWORK/W" "file1.txt/1.1/|file2.txt/1.1/" && + diff -u "$CVSWORK/W/file1.txt" ../W/file1.txt && + diff -u "$CVSWORK/W/file2.txt" ../W/file2.txt + ) +' + test_done -- cgit v1.2.1 From 12f0a5ea7dc999bfe06973bf61261fc809c2b2fb Mon Sep 17 00:00:00 2001 From: Johan Herland Date: Tue, 12 Feb 2008 00:43:41 +0100 Subject: Fix 'git cvsexportcommit -w $cvsdir ...' when used with relative $GIT_DIR When using the '-w $cvsdir' option to cvsexportcommit, it will chdir into $cvsdir before executing several other git commands. If $GIT_DIR is set to a relative path (e.g. '.'), the git commands executed by cvsexportcommit will naturally fail. Therefore, ensure that $GIT_DIR is absolute before the chdir to $cvsdir. Signed-off-by: Johan Herland Signed-off-by: Junio C Hamano --- git-cvsexportcommit.perl | 11 +++++------ t/t9200-git-cvsexportcommit.sh | 2 +- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/git-cvsexportcommit.perl b/git-cvsexportcommit.perl index d2e50c342..2a8ad1e9f 100755 --- a/git-cvsexportcommit.perl +++ b/git-cvsexportcommit.perl @@ -5,6 +5,7 @@ use Getopt::Std; use File::Temp qw(tempdir); use Data::Dumper; use File::Basename qw(basename dirname); +use File::Spec; our ($opt_h, $opt_P, $opt_p, $opt_v, $opt_c, $opt_f, $opt_a, $opt_m, $opt_d, $opt_u, $opt_w); @@ -15,17 +16,15 @@ $opt_h && usage(); die "Need at least one commit identifier!" unless @ARGV; if ($opt_w) { + # Remember where GIT_DIR is before changing to CVS checkout unless ($ENV{GIT_DIR}) { - # Remember where our GIT_DIR is before changing to CVS checkout + # No GIT_DIR set. Figure it out for ourselves my $gd =`git-rev-parse --git-dir`; chomp($gd); - if ($gd eq '.git') { - my $wd = `pwd`; - chomp($wd); - $gd = $wd."/.git" ; - } $ENV{GIT_DIR} = $gd; } + # Make sure GIT_DIR is absolute + $ENV{GIT_DIR} = File::Spec->rel2abs($ENV{GIT_DIR}); if (! -d $opt_w."/CVS" ) { die "$opt_w is not a CVS checkout"; diff --git a/t/t9200-git-cvsexportcommit.sh b/t/t9200-git-cvsexportcommit.sh index 7e25a392a..49d57a81e 100755 --- a/t/t9200-git-cvsexportcommit.sh +++ b/t/t9200-git-cvsexportcommit.sh @@ -246,7 +246,7 @@ test_expect_success \ ;; esac -test_expect_failure '-w option should work with relative GIT_DIR' ' +test_expect_success '-w option should work with relative GIT_DIR' ' mkdir W && echo foobar >W/file1.txt && echo bazzle >W/file2.txt && -- cgit v1.2.1 From 6ecbc851fb30f540e1a25761f221aab963cfe619 Mon Sep 17 00:00:00 2001 From: Jay Soffian Date: Thu, 21 Feb 2008 19:16:04 -0500 Subject: send-email: fix In-Reply-To regression Fix a regression introduced by 1ca3d6e (send-email: squelch warning due to comparing undefined $_ to "") where if the user was prompted for an initial In-Reply-To and didn't provide one, messages would be sent out with an invalid In-Reply-To of "<>" Also add test cases for the regression and the fix. A small modification was needed to allow send-email to take its replies from stdin if the environment variable GIT_SEND_EMAIL_NOTTY is set. Signed-off-by: Jay Soffian Signed-off-by: Junio C Hamano --- git-send-email.perl | 9 ++++++--- t/t9001-send-email.sh | 21 +++++++++++++++++++++ 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/git-send-email.perl b/git-send-email.perl index 8e6f3b22c..e5d67f1b6 100755 --- a/git-send-email.perl +++ b/git-send-email.perl @@ -166,7 +166,9 @@ my $envelope_sender; my $repo = Git->repository(); my $term = eval { - new Term::ReadLine 'git-send-email'; + $ENV{"GIT_SEND_EMAIL_NOTTY"} + ? new Term::ReadLine 'git-send-email', \*STDIN, \*STDOUT + : new Term::ReadLine 'git-send-email'; }; if ($@) { $term = new FakeTerm "$@: going non-interactive"; @@ -407,8 +409,9 @@ if ($thread && !defined $initial_reply_to && $prompting) { $initial_reply_to = $_; } if (defined $initial_reply_to) { - $initial_reply_to =~ s/^\s*?\s*$/>/; + $initial_reply_to =~ s/^\s*?\s*$//; + $initial_reply_to = "<$initial_reply_to>" if $initial_reply_to ne ''; } if (!defined $smtp_server) { diff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh index 08f7c3d8d..2efaed441 100755 --- a/t/t9001-send-email.sh +++ b/t/t9001-send-email.sh @@ -108,4 +108,25 @@ test_expect_success 'allow long lines with --no-validate' ' 2>errors ' +test_expect_success 'Invalid In-Reply-To' ' + git send-email \ + --from="Example " \ + --to=nobody@example.com \ + --in-reply-to=" " \ + --smtp-server="$(pwd)/fake.sendmail" \ + $patches + 2>errors + ! grep "^In-Reply-To: < *>" msgtxt +' + +test_expect_success 'Valid In-Reply-To when prompting' ' + (echo "From Example " + echo "To Example " + echo "" + ) | env GIT_SEND_EMAIL_NOTTY=1 git send-email \ + --smtp-server="$(pwd)/fake.sendmail" \ + $patches 2>errors && + ! grep "^In-Reply-To: < *>" msgtxt +' + test_done -- cgit v1.2.1 From 7a0a34ca6f31c6bb5d24ccc0cdab606736d7a322 Mon Sep 17 00:00:00 2001 From: Brandon Casey Date: Fri, 22 Feb 2008 12:47:08 -0600 Subject: builtin-reflog.c: don't install new reflog on write failure When expiring reflog entries, a new temporary log is written which contains only the entries to retain. After it is written, it is renamed to replace the existing reflog. Currently, we check that writing of the new log is successful and print a message on failure, but the original reflog is still replaced with the new reflog even on failure. This patch causes the original reflog to be retained if we fail when writing the new reflog. Signed-off-by: Brandon Casey Signed-off-by: Junio C Hamano --- builtin-reflog.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/builtin-reflog.c b/builtin-reflog.c index 4836ec951..ab53c8cb7 100644 --- a/builtin-reflog.c +++ b/builtin-reflog.c @@ -276,10 +276,11 @@ static int expire_reflog(const char *ref, const unsigned char *sha1, int unused, for_each_reflog_ent(ref, expire_reflog_ent, &cb); finish: if (cb.newlog) { - if (fclose(cb.newlog)) + if (fclose(cb.newlog)) { status |= error("%s: %s", strerror(errno), newlog_path); - if (rename(newlog_path, log_file)) { + unlink(newlog_path); + } else if (rename(newlog_path, log_file)) { status |= error("cannot rename %s to %s", newlog_path, log_file); unlink(newlog_path); -- cgit v1.2.1 From 0f497e75f05cdf0c0c1278eaba898cda6f118d71 Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Sat, 23 Feb 2008 17:14:17 -0800 Subject: Eliminate confusing "won't bisect on seeked tree" failure This error message is very confusing---it doesn't tell the user anything about how to fix the situation. And the actual fix for the situation ("git bisect reset") does a checkout of a potentially random branch, (compared to what the user wants to be on for the bisect she is starting). The simplest way to eliminate the confusion is to just make "git bisect start" do the cleanup itself. There's no significant loss of safety here since we already have a general safety in the form of the reflog. Note: We preserve the warning for any cogito users. We do this by switching from .git/head-name to .git/BISECT_START for the extra state, (which is a more descriptive name anyway). Signed-off-by: Carl Worth Signed-off-by: Junio C Hamano --- git-bisect.sh | 14 +++++++++----- t/t6030-bisect-porcelain.sh | 2 +- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/git-bisect.sh b/git-bisect.sh index 6594a6291..f8857747c 100755 --- a/git-bisect.sh +++ b/git-bisect.sh @@ -67,16 +67,18 @@ bisect_start() { die "Bad HEAD - I need a HEAD" case "$head" in refs/heads/bisect) - if [ -s "$GIT_DIR/head-name" ]; then - branch=`cat "$GIT_DIR/head-name"` + if [ -s "$GIT_DIR/BISECT_START" ]; then + branch=`cat "$GIT_DIR/BISECT_START"` else branch=master fi git checkout $branch || exit ;; refs/heads/*|$_x40) + # This error message should only be triggered by cogito usage, + # and cogito users should understand it relates to cg-seek. [ -s "$GIT_DIR/head-name" ] && die "won't bisect on seeked tree" - echo "${head#refs/heads/}" >"$GIT_DIR/head-name" + echo "${head#refs/heads/}" >"$GIT_DIR/BISECT_START" ;; *) die "Bad HEAD - strange symbolic ref" @@ -353,8 +355,8 @@ bisect_reset() { return } case "$#" in - 0) if [ -s "$GIT_DIR/head-name" ]; then - branch=`cat "$GIT_DIR/head-name"` + 0) if [ -s "$GIT_DIR/BISECT_START" ]; then + branch=`cat "$GIT_DIR/BISECT_START"` else branch=master fi ;; @@ -365,7 +367,9 @@ bisect_reset() { usage ;; esac if git checkout "$branch"; then + # Cleanup head-name if it got left by an old version of git-bisect rm -f "$GIT_DIR/head-name" + rm -f "$GIT_DIR/BISECT_START" bisect_clean_state fi } diff --git a/t/t6030-bisect-porcelain.sh b/t/t6030-bisect-porcelain.sh index ec71123f4..4908e878f 100755 --- a/t/t6030-bisect-porcelain.sh +++ b/t/t6030-bisect-porcelain.sh @@ -260,7 +260,7 @@ test_expect_success 'bisect starting with a detached HEAD' ' git checkout master^ && HEAD=$(git rev-parse --verify HEAD) && git bisect start && - test $HEAD = $(cat .git/head-name) && + test $HEAD = $(cat .git/BISECT_START) && git bisect reset && test $HEAD = $(git rev-parse --verify HEAD) -- cgit v1.2.1