Merge branch 'maint'

* maint:
  Update draft release notes for 1.6.0.2
  Use compatibility regex library for OSX/Darwin
  git-svn: Fixes my() parameter list syntax error in pre-5.8 Perl
  Git.pm: Use File::Temp->tempfile instead of ->new
  t7501: always use test_cmp instead of diff

Conflicts:
	Makefile
This commit is contained in:
Junio C Hamano
2008-09-10 13:56:20 -07:00
10 changed files with 71 additions and 25 deletions

View File

@ -17,6 +17,10 @@ Fixes since v1.6.0.1
* Many commands did not use the correct working tree location when used * Many commands did not use the correct working tree location when used
with GIT_WORK_TREE environment settings. with GIT_WORK_TREE environment settings.
* Some systems needs to use compatibility fnmach and regex libraries
independent from each other; the compat/ area has been reorganized to
allow this.
* "git apply --unidiff-zero" incorrectly applied a -U0 patch that inserts * "git apply --unidiff-zero" incorrectly applied a -U0 patch that inserts
a new line before the second line. a new line before the second line.
@ -24,9 +28,15 @@ Fixes since v1.6.0.1
* "git blame -c" did not exactly work like "git annotate" when range * "git blame -c" did not exactly work like "git annotate" when range
boundaries are involved. boundaries are involved.
* "git checkout file" when file is still unmerged checked out contents from
a random high order stage, which was confusing.
* "git clone $there $here/" with extra trailing slashes after explicit * "git clone $there $here/" with extra trailing slashes after explicit
local directory name $here did not work as expected. local directory name $here did not work as expected.
* "git diff" on tracked contents with CRLF line endings did not drive "less"
intelligently when showing added or removed lines.
* "git diff --dirstat -M" did not add changes in subdirectories up * "git diff --dirstat -M" did not add changes in subdirectories up
correctly for renamed paths. correctly for renamed paths.
@ -42,18 +52,29 @@ Fixes since v1.6.0.1
* "git gui" translation updates and i18n fixes. * "git gui" translation updates and i18n fixes.
* "git index-pack" is more careful against disk corruption while completing
a thin pack.
* "git log -i --grep=pattern" did not ignore case; neither "git log -E * "git log -i --grep=pattern" did not ignore case; neither "git log -E
--grep=pattern" triggered extended regexp. --grep=pattern" triggered extended regexp.
* "git log --pretty="%ad" --date=short" did not use short format when * "git log --pretty="%ad" --date=short" did not use short format when
showing the timestamp. showing the timestamp.
* "git log --author=author" match incorrectly matched with the
timestamp part of "author " line in commit objects.
* "git log -F --author=author" did not work at all.
* Build procedure for "git shell" that used stub versions of some * Build procedure for "git shell" that used stub versions of some
functions and globals was not understood by linkers on some platforms. functions and globals was not understood by linkers on some platforms.
* "git stash" was fooled by a stat-dirty but otherwise unmodified paths * "git stash" was fooled by a stat-dirty but otherwise unmodified paths
and refused to work until the user refreshed the index. and refused to work until the user refreshed the index.
* "git svn" was broken on Perl before 5.8 with recent fixes to reduce
use of temporary files.
* "git verify-pack -v" did not work correctly when given more than one * "git verify-pack -v" did not work correctly when given more than one
packfile. packfile.
@ -61,7 +82,6 @@ Also contains many documentation updates.
-- --
exec >/var/tmp/1 exec >/var/tmp/1
O=v1.6.0.1-61-g1eff26c O=v1.6.0.1-78-g3632cfc
echo O=$(git describe maint) echo O=$(git describe maint)
git shortlog --no-merges $O..maint git shortlog --no-merges $O..maint

View File

@ -636,6 +636,8 @@ ifeq ($(uname_S),Darwin)
endif endif
NO_STRLCPY = YesPlease NO_STRLCPY = YesPlease
NO_MEMMEM = YesPlease NO_MEMMEM = YesPlease
COMPAT_CFLAGS += -Icompat/regex
COMPAT_OBJS += compat/regex/regex.o
endif endif
ifeq ($(uname_S),SunOS) ifeq ($(uname_S),SunOS)
NEEDS_SOCKET = YesPlease NEEDS_SOCKET = YesPlease
@ -763,10 +765,10 @@ ifneq (,$(findstring MINGW,$(uname_S)))
NO_PERL_MAKEMAKER = YesPlease NO_PERL_MAKEMAKER = YesPlease
NO_POSIX_ONLY_PROGRAMS = YesPlease NO_POSIX_ONLY_PROGRAMS = YesPlease
NO_ST_BLOCKS_IN_STRUCT_STAT = YesPlease NO_ST_BLOCKS_IN_STRUCT_STAT = YesPlease
COMPAT_CFLAGS += -D__USE_MINGW_ACCESS -DNOGDI -Icompat COMPAT_CFLAGS += -D__USE_MINGW_ACCESS -DNOGDI -Icompat -Icompat/regex -Icompat/fnmatch
COMPAT_CFLAGS += -DSNPRINTF_SIZE_CORR=1 COMPAT_CFLAGS += -DSNPRINTF_SIZE_CORR=1
COMPAT_CFLAGS += -DSTRIP_EXTENSION=\".exe\" COMPAT_CFLAGS += -DSTRIP_EXTENSION=\".exe\"
COMPAT_OBJS += compat/mingw.o compat/fnmatch.o compat/regex.o compat/winansi.o COMPAT_OBJS += compat/mingw.o compat/fnmatch/fnmatch.o compat/regex/regex.o compat/winansi.o
EXTLIBS += -lws2_32 EXTLIBS += -lws2_32
X = .exe X = .exe
gitexecdir = ../libexec/git-core gitexecdir = ../libexec/git-core

View File

@ -3304,7 +3304,7 @@ sub close_file {
my $out = syswrite($tmp_fh, $str, $res); my $out = syswrite($tmp_fh, $str, $res);
defined($out) && $out == $res defined($out) && $out == $res
or croak("write ", or croak("write ",
$tmp_fh->filename, Git::temp_path($tmp_fh),
": $!\n"); ": $!\n");
} }
defined $res or croak $!; defined $res or croak $!;
@ -3315,7 +3315,7 @@ sub close_file {
} }
$hash = $::_repository->hash_and_insert_object( $hash = $::_repository->hash_and_insert_object(
$fh->filename); Git::temp_path($fh));
$hash =~ /^[a-f\d]{40}$/ or die "not a sha1: $hash\n"; $hash =~ /^[a-f\d]{40}$/ or die "not a sha1: $hash\n";
Git::temp_release($fb->{base}, 1); Git::temp_release($fb->{base}, 1);
@ -4425,7 +4425,7 @@ sub config_pager {
sub run_pager { sub run_pager {
return unless -t *STDOUT && defined $pager; return unless -t *STDOUT && defined $pager;
pipe my $rfd, my $wfd or return; pipe my ($rfd, $wfd) or return;
defined(my $pid = fork) or ::fatal "Can't fork: $!"; defined(my $pid = fork) or ::fatal "Can't fork: $!";
if (!$pid) { if (!$pid) {
open STDOUT, '>&', $wfd or open STDOUT, '>&', $wfd or

View File

@ -58,7 +58,7 @@ require Exporter;
command_bidi_pipe command_close_bidi_pipe command_bidi_pipe command_close_bidi_pipe
version exec_path hash_object git_cmd_try version exec_path hash_object git_cmd_try
remote_refs remote_refs
temp_acquire temp_release temp_reset); temp_acquire temp_release temp_reset temp_path);
=head1 DESCRIPTION =head1 DESCRIPTION
@ -937,7 +937,7 @@ sub _close_cat_blob {
{ # %TEMP_* Lexical Context { # %TEMP_* Lexical Context
my (%TEMP_LOCKS, %TEMP_FILES); my (%TEMP_FILEMAP, %TEMP_FILES);
=item temp_acquire ( NAME ) =item temp_acquire ( NAME )
@ -965,7 +965,7 @@ sub temp_acquire {
my $temp_fd = _temp_cache($name); my $temp_fd = _temp_cache($name);
$TEMP_LOCKS{$temp_fd} = 1; $TEMP_FILES{$temp_fd}{locked} = 1;
$temp_fd; $temp_fd;
} }
@ -991,16 +991,16 @@ the same string.
sub temp_release { sub temp_release {
my ($self, $temp_fd, $trunc) = _maybe_self(@_); my ($self, $temp_fd, $trunc) = _maybe_self(@_);
if (ref($temp_fd) ne 'File::Temp') { if (exists $TEMP_FILEMAP{$temp_fd}) {
$temp_fd = $TEMP_FILES{$temp_fd}; $temp_fd = $TEMP_FILES{$temp_fd};
} }
unless ($TEMP_LOCKS{$temp_fd}) { unless ($TEMP_FILES{$temp_fd}{locked}) {
carp "Attempt to release temp file '", carp "Attempt to release temp file '",
$temp_fd, "' that has not been locked"; $temp_fd, "' that has not been locked";
} }
temp_reset($temp_fd) if $trunc and $temp_fd->opened; temp_reset($temp_fd) if $trunc and $temp_fd->opened;
$TEMP_LOCKS{$temp_fd} = 0; $TEMP_FILES{$temp_fd}{locked} = 0;
undef; undef;
} }
@ -1009,9 +1009,9 @@ sub _temp_cache {
_verify_require(); _verify_require();
my $temp_fd = \$TEMP_FILES{$name}; my $temp_fd = \$TEMP_FILEMAP{$name};
if (defined $$temp_fd and $$temp_fd->opened) { if (defined $$temp_fd and $$temp_fd->opened) {
if ($TEMP_LOCKS{$$temp_fd}) { if ($TEMP_FILES{$$temp_fd}{locked}) {
throw Error::Simple("Temp file with moniker '", throw Error::Simple("Temp file with moniker '",
$name, "' already in use"); $name, "' already in use");
} }
@ -1021,12 +1021,13 @@ sub _temp_cache {
carp "Temp file '", $name, carp "Temp file '", $name,
"' was closed. Opening replacement."; "' was closed. Opening replacement.";
} }
$$temp_fd = File::Temp->new( my $fname;
TEMPLATE => 'Git_XXXXXX', ($$temp_fd, $fname) = File::Temp->tempfile(
DIR => File::Spec->tmpdir 'Git_XXXXXX', UNLINK => 1
) or throw Error::Simple("couldn't open new temp file"); ) or throw Error::Simple("couldn't open new temp file");
$$temp_fd->autoflush; $$temp_fd->autoflush;
binmode $$temp_fd; binmode $$temp_fd;
$TEMP_FILES{$$temp_fd}{fname} = $fname;
} }
$$temp_fd; $$temp_fd;
} }
@ -1053,8 +1054,25 @@ sub temp_reset {
or throw Error::Simple("expected file position to be reset"); or throw Error::Simple("expected file position to be reset");
} }
=item temp_path ( NAME )
=item temp_path ( FILEHANDLE )
Returns the filename associated with the given tempfile.
=cut
sub temp_path {
my ($self, $temp_fd) = _maybe_self(@_);
if (exists $TEMP_FILEMAP{$temp_fd}) {
$temp_fd = $TEMP_FILEMAP{$temp_fd};
}
$TEMP_FILES{$temp_fd}{fname};
}
sub END { sub END {
unlink values %TEMP_FILES if %TEMP_FILES; unlink values %TEMP_FILEMAP if %TEMP_FILEMAP;
} }
} # %TEMP_* Lexical Context } # %TEMP_* Lexical Context

View File

@ -57,4 +57,10 @@ test_expect_success 'last regexp must not be negated' '
test_must_fail git diff --no-index Beer.java Beer-correct.java test_must_fail git diff --no-index Beer.java Beer-correct.java
' '
test_expect_success 'alternation in pattern' '
git config diff.java.funcname "^[ ]*\\(\\(public\\|static\\).*\\)$"
git diff --no-index Beer.java Beer-correct.java |
grep "^@@.*@@ public static void main("
'
test_done test_done

View File

@ -141,7 +141,7 @@ EOF
test_expect_success \ test_expect_success \
'validate git rev-list output.' \ 'validate git rev-list output.' \
'diff current expected' 'test_cmp expected current'
test_expect_success 'partial commit that involves removal (1)' ' test_expect_success 'partial commit that involves removal (1)' '
@ -151,7 +151,7 @@ test_expect_success 'partial commit that involves removal (1)' '
git commit -m "Partial: add elif" elif && git commit -m "Partial: add elif" elif &&
git diff-tree --name-status HEAD^ HEAD >current && git diff-tree --name-status HEAD^ HEAD >current &&
echo "A elif" >expected && echo "A elif" >expected &&
diff expected current test_cmp expected current
' '
@ -160,7 +160,7 @@ test_expect_success 'partial commit that involves removal (2)' '
git commit -m "Partial: remove file" file && git commit -m "Partial: remove file" file &&
git diff-tree --name-status HEAD^ HEAD >current && git diff-tree --name-status HEAD^ HEAD >current &&
echo "D file" >expected && echo "D file" >expected &&
diff expected current test_cmp expected current
' '
@ -171,7 +171,7 @@ test_expect_success 'partial commit that involves removal (3)' '
git commit -m "Partial: modify elif" elif && git commit -m "Partial: modify elif" elif &&
git diff-tree --name-status HEAD^ HEAD >current && git diff-tree --name-status HEAD^ HEAD >current &&
echo "M elif" >expected && echo "M elif" >expected &&
diff expected current test_cmp expected current
' '
@ -187,7 +187,7 @@ test_expect_success 'amend commit to fix author' '
expected && expected &&
git commit --amend --author="$author" && git commit --amend --author="$author" &&
git cat-file -p HEAD > current && git cat-file -p HEAD > current &&
diff expected current test_cmp expected current
' '
@ -256,7 +256,7 @@ test_expect_success 'amend commit to fix author' '
expected && expected &&
git commit --amend --author="$author" && git commit --amend --author="$author" &&
git cat-file -p HEAD > current && git cat-file -p HEAD > current &&
diff expected current test_cmp expected current
' '