* 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
Родитель da06a80322 873358dd2a
Коммит b281eea75f
10 изменённых файлов: 71 добавлений и 25 удалений

Просмотреть файл

@ -17,6 +17,10 @@ Fixes since v1.6.0.1
* Many commands did not use the correct working tree location when used
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
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
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
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
correctly for renamed paths.
@ -42,18 +52,29 @@ Fixes since v1.6.0.1
* "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
--grep=pattern" triggered extended regexp.
* "git log --pretty="%ad" --date=short" did not use short format when
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
functions and globals was not understood by linkers on some platforms.
* "git stash" was fooled by a stat-dirty but otherwise unmodified paths
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
packfile.
@ -61,7 +82,6 @@ Also contains many documentation updates.
--
exec >/var/tmp/1
O=v1.6.0.1-61-g1eff26c
O=v1.6.0.1-78-g3632cfc
echo O=$(git describe maint)
git shortlog --no-merges $O..maint

Просмотреть файл

@ -636,6 +636,8 @@ ifeq ($(uname_S),Darwin)
endif
NO_STRLCPY = YesPlease
NO_MEMMEM = YesPlease
COMPAT_CFLAGS += -Icompat/regex
COMPAT_OBJS += compat/regex/regex.o
endif
ifeq ($(uname_S),SunOS)
NEEDS_SOCKET = YesPlease
@ -763,10 +765,10 @@ ifneq (,$(findstring MINGW,$(uname_S)))
NO_PERL_MAKEMAKER = YesPlease
NO_POSIX_ONLY_PROGRAMS = 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 += -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
X = .exe
gitexecdir = ../libexec/git-core

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

@ -3304,7 +3304,7 @@ sub close_file {
my $out = syswrite($tmp_fh, $str, $res);
defined($out) && $out == $res
or croak("write ",
$tmp_fh->filename,
Git::temp_path($tmp_fh),
": $!\n");
}
defined $res or croak $!;
@ -3315,7 +3315,7 @@ sub close_file {
}
$hash = $::_repository->hash_and_insert_object(
$fh->filename);
Git::temp_path($fh));
$hash =~ /^[a-f\d]{40}$/ or die "not a sha1: $hash\n";
Git::temp_release($fb->{base}, 1);
@ -4425,7 +4425,7 @@ sub config_pager {
sub run_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: $!";
if (!$pid) {
open STDOUT, '>&', $wfd or

Просмотреть файл

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

Просмотреть файл

@ -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_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

Просмотреть файл

@ -141,7 +141,7 @@ EOF
test_expect_success \
'validate git rev-list output.' \
'diff current expected'
'test_cmp expected current'
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 diff-tree --name-status HEAD^ HEAD >current &&
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 diff-tree --name-status HEAD^ HEAD >current &&
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 diff-tree --name-status HEAD^ HEAD >current &&
echo "M elif" >expected &&
diff expected current
test_cmp expected current
'
@ -187,7 +187,7 @@ test_expect_success 'amend commit to fix author' '
expected &&
git commit --amend --author="$author" &&
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 &&
git commit --amend --author="$author" &&
git cat-file -p HEAD > current &&
diff expected current
test_cmp expected current
'