Merge branch 'maint'
* maint: git-svn: understand grafts when doing dcommit git-diff: don't squelch the new SHA1 in submodule diffs git-svn: fix "Malformed network data" with svn:// servers (cvs|svn)import: Ask git-tag to overwrite old tags. Documentation / grammer nit
This commit is contained in:
commit
57543a254c
@ -68,7 +68,7 @@ OPTIONS
|
|||||||
automatically setup .git/objects/info/alternates to
|
automatically setup .git/objects/info/alternates to
|
||||||
obtain objects from the reference repository. Using
|
obtain objects from the reference repository. Using
|
||||||
an already existing repository as an alternate will
|
an already existing repository as an alternate will
|
||||||
require less objects to be copied from the repository
|
require fewer objects to be copied from the repository
|
||||||
being cloned, reducing network and local storage costs.
|
being cloned, reducing network and local storage costs.
|
||||||
|
|
||||||
--quiet::
|
--quiet::
|
||||||
|
21
diff.c
21
diff.c
@ -3144,6 +3144,22 @@ static void diffcore_apply_filter(const char *filter)
|
|||||||
*q = outq;
|
*q = outq;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Check whether two filespecs with the same mode and size are identical */
|
||||||
|
static int diff_filespec_is_identical(struct diff_filespec *one,
|
||||||
|
struct diff_filespec *two)
|
||||||
|
{
|
||||||
|
if (S_ISGITLINK(one->mode)) {
|
||||||
|
diff_fill_sha1_info(one);
|
||||||
|
diff_fill_sha1_info(two);
|
||||||
|
return !hashcmp(one->sha1, two->sha1);
|
||||||
|
}
|
||||||
|
if (diff_populate_filespec(one, 0))
|
||||||
|
return 0;
|
||||||
|
if (diff_populate_filespec(two, 0))
|
||||||
|
return 0;
|
||||||
|
return !memcmp(one->data, two->data, one->size);
|
||||||
|
}
|
||||||
|
|
||||||
static void diffcore_skip_stat_unmatch(struct diff_options *diffopt)
|
static void diffcore_skip_stat_unmatch(struct diff_options *diffopt)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
@ -3175,10 +3191,7 @@ static void diffcore_skip_stat_unmatch(struct diff_options *diffopt)
|
|||||||
diff_populate_filespec(p->one, 1) ||
|
diff_populate_filespec(p->one, 1) ||
|
||||||
diff_populate_filespec(p->two, 1) ||
|
diff_populate_filespec(p->two, 1) ||
|
||||||
(p->one->size != p->two->size) ||
|
(p->one->size != p->two->size) ||
|
||||||
|
!diff_filespec_is_identical(p->one, p->two)) /* (2) */
|
||||||
diff_populate_filespec(p->one, 0) || /* (2) */
|
|
||||||
diff_populate_filespec(p->two, 0) ||
|
|
||||||
memcmp(p->one->data, p->two->data, p->one->size))
|
|
||||||
diff_q(&outq, p);
|
diff_q(&outq, p);
|
||||||
else {
|
else {
|
||||||
/*
|
/*
|
||||||
|
@ -779,7 +779,7 @@ sub commit {
|
|||||||
$xtag =~ tr/_/\./ if ( $opt_u );
|
$xtag =~ tr/_/\./ if ( $opt_u );
|
||||||
$xtag =~ s/[\/]/$opt_s/g;
|
$xtag =~ s/[\/]/$opt_s/g;
|
||||||
|
|
||||||
system('git-tag', $xtag, $cid) == 0
|
system('git-tag', '-f', $xtag, $cid) == 0
|
||||||
or die "Cannot create tag $xtag: $!\n";
|
or die "Cannot create tag $xtag: $!\n";
|
||||||
|
|
||||||
print "Created tag '$xtag' on '$branch'\n" if $opt_v;
|
print "Created tag '$xtag' on '$branch'\n" if $opt_v;
|
||||||
|
25
git-svn.perl
25
git-svn.perl
@ -841,14 +841,9 @@ sub working_head_info {
|
|||||||
|
|
||||||
sub read_commit_parents {
|
sub read_commit_parents {
|
||||||
my ($parents, $c) = @_;
|
my ($parents, $c) = @_;
|
||||||
my ($fh, $ctx) = command_output_pipe(qw/cat-file commit/, $c);
|
chomp(my $p = command_oneline(qw/rev-list --parents -1/, $c));
|
||||||
while (<$fh>) {
|
$p =~ s/^($c)\s*// or die "rev-list --parents -1 $c failed!\n";
|
||||||
chomp;
|
@{$parents->{$c}} = split(/ /, $p);
|
||||||
last if '';
|
|
||||||
/^parent ($sha1)/ or next;
|
|
||||||
push @{$parents->{$c}}, $1;
|
|
||||||
}
|
|
||||||
close $fh; # break the pipe
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sub linearize_history {
|
sub linearize_history {
|
||||||
@ -3013,7 +3008,7 @@ package Git::SVN::Ra;
|
|||||||
use vars qw/@ISA $config_dir $_log_window_size/;
|
use vars qw/@ISA $config_dir $_log_window_size/;
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
my ($can_do_switch, %ignored_err, $RA);
|
my ($ra_invalid, $can_do_switch, %ignored_err, $RA);
|
||||||
|
|
||||||
BEGIN {
|
BEGIN {
|
||||||
# enforce temporary pool usage for some simple functions
|
# enforce temporary pool usage for some simple functions
|
||||||
@ -3174,7 +3169,11 @@ sub gs_do_switch {
|
|||||||
$self->{url} = $full_url;
|
$self->{url} = $full_url;
|
||||||
$reparented = 1;
|
$reparented = 1;
|
||||||
} else {
|
} else {
|
||||||
|
$_[0] = undef;
|
||||||
|
$self = undef;
|
||||||
|
$RA = undef;
|
||||||
$ra = Git::SVN::Ra->new($full_url);
|
$ra = Git::SVN::Ra->new($full_url);
|
||||||
|
$ra_invalid = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$ra ||= $self;
|
$ra ||= $self;
|
||||||
@ -3234,6 +3233,7 @@ sub gs_fetch_loop_common {
|
|||||||
my $inc = $_log_window_size;
|
my $inc = $_log_window_size;
|
||||||
my ($min, $max) = ($base, $head < $base + $inc ? $head : $base + $inc);
|
my ($min, $max) = ($base, $head < $base + $inc ? $head : $base + $inc);
|
||||||
my $longest_path = longest_common_path($gsv, $globs);
|
my $longest_path = longest_common_path($gsv, $globs);
|
||||||
|
my $ra_url = $self->{url};
|
||||||
while (1) {
|
while (1) {
|
||||||
my %revs;
|
my %revs;
|
||||||
my $err;
|
my $err;
|
||||||
@ -3295,6 +3295,13 @@ sub gs_fetch_loop_common {
|
|||||||
"$g->{t}-maxRev";
|
"$g->{t}-maxRev";
|
||||||
Git::SVN::tmp_config($k, $r);
|
Git::SVN::tmp_config($k, $r);
|
||||||
}
|
}
|
||||||
|
if ($ra_invalid) {
|
||||||
|
$_[0] = undef;
|
||||||
|
$self = undef;
|
||||||
|
$RA = undef;
|
||||||
|
$self = Git::SVN::Ra->new($ra_url);
|
||||||
|
$ra_invalid = undef;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
# pre-fill the .rev_db since it'll eventually get filled in
|
# pre-fill the .rev_db since it'll eventually get filled in
|
||||||
# with '0' x40 if something new gets committed
|
# with '0' x40 if something new gets committed
|
||||||
|
@ -873,7 +873,7 @@ sub commit {
|
|||||||
|
|
||||||
$dest =~ tr/_/\./ if $opt_u;
|
$dest =~ tr/_/\./ if $opt_u;
|
||||||
|
|
||||||
system('git-tag', $dest, $cid) == 0
|
system('git-tag', '-f', $dest, $cid) == 0
|
||||||
or die "Cannot create tag $dest: $!\n";
|
or die "Cannot create tag $dest: $!\n";
|
||||||
|
|
||||||
print "Created tag '$dest' on '$branch'\n" if $opt_v;
|
print "Created tag '$dest' on '$branch'\n" if $opt_v;
|
||||||
|
@ -152,6 +152,10 @@ test_expect_success 'the --cached sha1 should be rev1' '
|
|||||||
git-submodule --cached status | grep "^+$rev1"
|
git-submodule --cached status | grep "^+$rev1"
|
||||||
'
|
'
|
||||||
|
|
||||||
|
test_expect_success 'git diff should report the SHA1 of the new submodule commit' '
|
||||||
|
git-diff | grep "^+Subproject commit $rev2"
|
||||||
|
'
|
||||||
|
|
||||||
test_expect_success 'update should checkout rev1' '
|
test_expect_success 'update should checkout rev1' '
|
||||||
git-submodule update &&
|
git-submodule update &&
|
||||||
head=$(cd lib && git rev-parse HEAD) &&
|
head=$(cd lib && git rev-parse HEAD) &&
|
||||||
|
Loading…
Reference in New Issue
Block a user