Skip to content

Commit b281eea

Browse files
committed
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
2 parents da06a80 + 873358d commit b281eea

File tree

10 files changed

+71
-25
lines changed

10 files changed

+71
-25
lines changed

Documentation/RelNotes-1.6.0.2.txt

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,26 @@ Fixes since v1.6.0.1
1717
* Many commands did not use the correct working tree location when used
1818
with GIT_WORK_TREE environment settings.
1919

20+
* Some systems needs to use compatibility fnmach and regex libraries
21+
independent from each other; the compat/ area has been reorganized to
22+
allow this.
23+
2024

2125
* "git apply --unidiff-zero" incorrectly applied a -U0 patch that inserts
2226
a new line before the second line.
2327

2428
* "git blame -c" did not exactly work like "git annotate" when range
2529
boundaries are involved.
2630

31+
* "git checkout file" when file is still unmerged checked out contents from
32+
a random high order stage, which was confusing.
33+
2734
* "git clone $there $here/" with extra trailing slashes after explicit
2835
local directory name $here did not work as expected.
2936

37+
* "git diff" on tracked contents with CRLF line endings did not drive "less"
38+
intelligently when showing added or removed lines.
39+
3040
* "git diff --dirstat -M" did not add changes in subdirectories up
3141
correctly for renamed paths.
3242

@@ -42,26 +52,36 @@ Fixes since v1.6.0.1
4252

4353
* "git gui" translation updates and i18n fixes.
4454

55+
* "git index-pack" is more careful against disk corruption while completing
56+
a thin pack.
57+
4558
* "git log -i --grep=pattern" did not ignore case; neither "git log -E
4659
--grep=pattern" triggered extended regexp.
4760

4861
* "git log --pretty="%ad" --date=short" did not use short format when
4962
showing the timestamp.
5063

64+
* "git log --author=author" match incorrectly matched with the
65+
timestamp part of "author " line in commit objects.
66+
67+
* "git log -F --author=author" did not work at all.
68+
5169
* Build procedure for "git shell" that used stub versions of some
5270
functions and globals was not understood by linkers on some platforms.
5371

5472
* "git stash" was fooled by a stat-dirty but otherwise unmodified paths
5573
and refused to work until the user refreshed the index.
5674

75+
* "git svn" was broken on Perl before 5.8 with recent fixes to reduce
76+
use of temporary files.
77+
5778
* "git verify-pack -v" did not work correctly when given more than one
5879
packfile.
5980

6081
Also contains many documentation updates.
6182

6283
--
6384
exec >/var/tmp/1
64-
O=v1.6.0.1-61-g1eff26c
85+
O=v1.6.0.1-78-g3632cfc
6586
echo O=$(git describe maint)
6687
git shortlog --no-merges $O..maint
67-

Makefile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -636,6 +636,8 @@ ifeq ($(uname_S),Darwin)
636636
endif
637637
NO_STRLCPY = YesPlease
638638
NO_MEMMEM = YesPlease
639+
COMPAT_CFLAGS += -Icompat/regex
640+
COMPAT_OBJS += compat/regex/regex.o
639641
endif
640642
ifeq ($(uname_S),SunOS)
641643
NEEDS_SOCKET = YesPlease
@@ -763,10 +765,10 @@ ifneq (,$(findstring MINGW,$(uname_S)))
763765
NO_PERL_MAKEMAKER = YesPlease
764766
NO_POSIX_ONLY_PROGRAMS = YesPlease
765767
NO_ST_BLOCKS_IN_STRUCT_STAT = YesPlease
766-
COMPAT_CFLAGS += -D__USE_MINGW_ACCESS -DNOGDI -Icompat
768+
COMPAT_CFLAGS += -D__USE_MINGW_ACCESS -DNOGDI -Icompat -Icompat/regex -Icompat/fnmatch
767769
COMPAT_CFLAGS += -DSNPRINTF_SIZE_CORR=1
768770
COMPAT_CFLAGS += -DSTRIP_EXTENSION=\".exe\"
769-
COMPAT_OBJS += compat/mingw.o compat/fnmatch.o compat/regex.o compat/winansi.o
771+
COMPAT_OBJS += compat/mingw.o compat/fnmatch/fnmatch.o compat/regex/regex.o compat/winansi.o
770772
EXTLIBS += -lws2_32
771773
X = .exe
772774
gitexecdir = ../libexec/git-core
File renamed without changes.
File renamed without changes.

git-svn.perl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3304,7 +3304,7 @@ sub close_file {
33043304
my $out = syswrite($tmp_fh, $str, $res);
33053305
defined($out) && $out == $res
33063306
or croak("write ",
3307-
$tmp_fh->filename,
3307+
Git::temp_path($tmp_fh),
33083308
": $!\n");
33093309
}
33103310
defined $res or croak $!;
@@ -3315,7 +3315,7 @@ sub close_file {
33153315
}
33163316

33173317
$hash = $::_repository->hash_and_insert_object(
3318-
$fh->filename);
3318+
Git::temp_path($fh));
33193319
$hash =~ /^[a-f\d]{40}$/ or die "not a sha1: $hash\n";
33203320

33213321
Git::temp_release($fb->{base}, 1);
@@ -4425,7 +4425,7 @@ sub config_pager {
44254425

44264426
sub run_pager {
44274427
return unless -t *STDOUT && defined $pager;
4428-
pipe my $rfd, my $wfd or return;
4428+
pipe my ($rfd, $wfd) or return;
44294429
defined(my $pid = fork) or ::fatal "Can't fork: $!";
44304430
if (!$pid) {
44314431
open STDOUT, '>&', $wfd or

perl/Git.pm

Lines changed: 30 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ require Exporter;
5858
command_bidi_pipe command_close_bidi_pipe
5959
version exec_path hash_object git_cmd_try
6060
remote_refs
61-
temp_acquire temp_release temp_reset);
61+
temp_acquire temp_release temp_reset temp_path);
6262

6363

6464
=head1 DESCRIPTION
@@ -937,7 +937,7 @@ sub _close_cat_blob {
937937

938938
{ # %TEMP_* Lexical Context
939939

940-
my (%TEMP_LOCKS, %TEMP_FILES);
940+
my (%TEMP_FILEMAP, %TEMP_FILES);
941941

942942
=item temp_acquire ( NAME )
943943
@@ -965,7 +965,7 @@ sub temp_acquire {
965965

966966
my $temp_fd = _temp_cache($name);
967967

968-
$TEMP_LOCKS{$temp_fd} = 1;
968+
$TEMP_FILES{$temp_fd}{locked} = 1;
969969
$temp_fd;
970970
}
971971

@@ -991,16 +991,16 @@ the same string.
991991
sub temp_release {
992992
my ($self, $temp_fd, $trunc) = _maybe_self(@_);
993993

994-
if (ref($temp_fd) ne 'File::Temp') {
994+
if (exists $TEMP_FILEMAP{$temp_fd}) {
995995
$temp_fd = $TEMP_FILES{$temp_fd};
996996
}
997-
unless ($TEMP_LOCKS{$temp_fd}) {
997+
unless ($TEMP_FILES{$temp_fd}{locked}) {
998998
carp "Attempt to release temp file '",
999999
$temp_fd, "' that has not been locked";
10001000
}
10011001
temp_reset($temp_fd) if $trunc and $temp_fd->opened;
10021002

1003-
$TEMP_LOCKS{$temp_fd} = 0;
1003+
$TEMP_FILES{$temp_fd}{locked} = 0;
10041004
undef;
10051005
}
10061006

@@ -1009,9 +1009,9 @@ sub _temp_cache {
10091009

10101010
_verify_require();
10111011

1012-
my $temp_fd = \$TEMP_FILES{$name};
1012+
my $temp_fd = \$TEMP_FILEMAP{$name};
10131013
if (defined $$temp_fd and $$temp_fd->opened) {
1014-
if ($TEMP_LOCKS{$$temp_fd}) {
1014+
if ($TEMP_FILES{$$temp_fd}{locked}) {
10151015
throw Error::Simple("Temp file with moniker '",
10161016
$name, "' already in use");
10171017
}
@@ -1021,12 +1021,13 @@ sub _temp_cache {
10211021
carp "Temp file '", $name,
10221022
"' was closed. Opening replacement.";
10231023
}
1024-
$$temp_fd = File::Temp->new(
1025-
TEMPLATE => 'Git_XXXXXX',
1026-
DIR => File::Spec->tmpdir
1024+
my $fname;
1025+
($$temp_fd, $fname) = File::Temp->tempfile(
1026+
'Git_XXXXXX', UNLINK => 1
10271027
) or throw Error::Simple("couldn't open new temp file");
10281028
$$temp_fd->autoflush;
10291029
binmode $$temp_fd;
1030+
$TEMP_FILES{$$temp_fd}{fname} = $fname;
10301031
}
10311032
$$temp_fd;
10321033
}
@@ -1053,8 +1054,25 @@ sub temp_reset {
10531054
or throw Error::Simple("expected file position to be reset");
10541055
}
10551056

1057+
=item temp_path ( NAME )
1058+
1059+
=item temp_path ( FILEHANDLE )
1060+
1061+
Returns the filename associated with the given tempfile.
1062+
1063+
=cut
1064+
1065+
sub temp_path {
1066+
my ($self, $temp_fd) = _maybe_self(@_);
1067+
1068+
if (exists $TEMP_FILEMAP{$temp_fd}) {
1069+
$temp_fd = $TEMP_FILEMAP{$temp_fd};
1070+
}
1071+
$TEMP_FILES{$temp_fd}{fname};
1072+
}
1073+
10561074
sub END {
1057-
unlink values %TEMP_FILES if %TEMP_FILES;
1075+
unlink values %TEMP_FILEMAP if %TEMP_FILEMAP;
10581076
}
10591077

10601078
} # %TEMP_* Lexical Context

t/t4018-diff-funcname.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,10 @@ test_expect_success 'last regexp must not be negated' '
5757
test_must_fail git diff --no-index Beer.java Beer-correct.java
5858
'
5959

60+
test_expect_success 'alternation in pattern' '
61+
git config diff.java.funcname "^[ ]*\\(\\(public\\|static\\).*\\)$"
62+
git diff --no-index Beer.java Beer-correct.java |
63+
grep "^@@.*@@ public static void main("
64+
'
65+
6066
test_done

t/t7501-commit.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ EOF
141141

142142
test_expect_success \
143143
'validate git rev-list output.' \
144-
'diff current expected'
144+
'test_cmp expected current'
145145

146146
test_expect_success 'partial commit that involves removal (1)' '
147147
@@ -151,7 +151,7 @@ test_expect_success 'partial commit that involves removal (1)' '
151151
git commit -m "Partial: add elif" elif &&
152152
git diff-tree --name-status HEAD^ HEAD >current &&
153153
echo "A elif" >expected &&
154-
diff expected current
154+
test_cmp expected current
155155
156156
'
157157

@@ -160,7 +160,7 @@ test_expect_success 'partial commit that involves removal (2)' '
160160
git commit -m "Partial: remove file" file &&
161161
git diff-tree --name-status HEAD^ HEAD >current &&
162162
echo "D file" >expected &&
163-
diff expected current
163+
test_cmp expected current
164164
165165
'
166166

@@ -171,7 +171,7 @@ test_expect_success 'partial commit that involves removal (3)' '
171171
git commit -m "Partial: modify elif" elif &&
172172
git diff-tree --name-status HEAD^ HEAD >current &&
173173
echo "M elif" >expected &&
174-
diff expected current
174+
test_cmp expected current
175175
176176
'
177177

@@ -187,7 +187,7 @@ test_expect_success 'amend commit to fix author' '
187187
expected &&
188188
git commit --amend --author="$author" &&
189189
git cat-file -p HEAD > current &&
190-
diff expected current
190+
test_cmp expected current
191191
192192
'
193193

@@ -256,7 +256,7 @@ test_expect_success 'amend commit to fix author' '
256256
expected &&
257257
git commit --amend --author="$author" &&
258258
git cat-file -p HEAD > current &&
259-
diff expected current
259+
test_cmp expected current
260260
261261
'
262262

0 commit comments

Comments
 (0)