Skip to content

Commit f1250ed

Browse files
author
Junio C Hamano
committed
Merge branch 'jc/name' into next
* jc/name: core.warnambiguousrefs: warns when "name" is used and both "name" branch and tag exists. contrib/git-svn: allow rebuild to work on non-linear remote heads http-push: don't assume char is signed http-push: add support for deleting remote branches Be verbose when !initial commit Fix multi-paragraph list items in OPTIONS section http-fetch: nicer warning for a server with unreliable 404 status
2 parents 83c1379 + 2f8acdb commit f1250ed

File tree

10 files changed

+297
-30
lines changed

10 files changed

+297
-30
lines changed

Documentation/git-cvsimport.txt

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -99,21 +99,24 @@ If you need to pass multiple options, separate them with a comma.
9999
CVS by default uses the unix username when writing its
100100
commit logs. Using this option and an author-conv-file
101101
in this format
102-
102+
+
103+
---------
103104
exon=Andreas Ericsson <ae@op5.se>
104105
spawn=Simon Pawn <spawn@frog-pond.org>
105106

106-
git-cvsimport will make it appear as those authors had
107-
their GIT_AUTHOR_NAME and GIT_AUTHOR_EMAIL set properly
108-
all along.
109-
110-
For convenience, this data is saved to $GIT_DIR/cvs-authors
111-
each time the -A option is provided and read from that same
112-
file each time git-cvsimport is run.
113-
114-
It is not recommended to use this feature if you intend to
115-
export changes back to CVS again later with
116-
git-link[1]::git-cvsexportcommit.
107+
---------
108+
+
109+
git-cvsimport will make it appear as those authors had
110+
their GIT_AUTHOR_NAME and GIT_AUTHOR_EMAIL set properly
111+
all along.
112+
+
113+
For convenience, this data is saved to $GIT_DIR/cvs-authors
114+
each time the -A option is provided and read from that same
115+
file each time git-cvsimport is run.
116+
+
117+
It is not recommended to use this feature if you intend to
118+
export changes back to CVS again later with
119+
git-link[1]::git-cvsexportcommit.
117120

118121
OUTPUT
119122
------

Documentation/git-svnimport.txt

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -75,18 +75,21 @@ When importing incrementally, you might need to edit the .git/svn2git file.
7575

7676
-A <author_file>::
7777
Read a file with lines on the form
78+
+
79+
------
80+
username = User's Full Name <email@addr.es>
7881

79-
username = User's Full Name <email@addr.es>
80-
81-
and use "User's Full Name <email@addr.es>" as the GIT
82-
author and committer for Subversion commits made by
83-
"username". If encountering a commit made by a user not in the
84-
list, abort.
85-
86-
For convenience, this data is saved to $GIT_DIR/svn-authors
87-
each time the -A option is provided, and read from that same
88-
file each time git-svnimport is run with an existing GIT
89-
repository without -A.
82+
------
83+
+
84+
and use "User's Full Name <email@addr.es>" as the GIT
85+
author and committer for Subversion commits made by
86+
"username". If encountering a commit made by a user not in the
87+
list, abort.
88+
+
89+
For convenience, this data is saved to $GIT_DIR/svn-authors
90+
each time the -A option is provided, and read from that same
91+
file each time git-svnimport is run with an existing GIT
92+
repository without -A.
9093

9194
-m::
9295
Attempt to detect merges based on the commit message. This option

cache.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ extern void rollback_index_file(struct cache_file *);
165165
extern int trust_executable_bit;
166166
extern int assume_unchanged;
167167
extern int only_use_symrefs;
168+
extern int warn_ambiguous_refs;
168169
extern int diff_rename_limit_default;
169170
extern int shared_repository;
170171
extern const char *apply_default_whitespace;

config.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,11 @@ int git_default_config(const char *var, const char *value)
232232
return 0;
233233
}
234234

235+
if (!strcmp(var, "core.warnambiguousrefs")) {
236+
warn_ambiguous_refs = git_config_bool(var, value);
237+
return 0;
238+
}
239+
235240
if (!strcmp(var, "user.name")) {
236241
strncpy(git_default_name, value, sizeof(git_default_name));
237242
return 0;

contrib/git-svn/git-svn.perl

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -850,11 +850,23 @@ sub assert_revision_unknown {
850850
}
851851
}
852852

853+
sub trees_eq {
854+
my ($x, $y) = @_;
855+
my @x = safe_qx('git-cat-file','commit',$x);
856+
my @y = safe_qx('git-cat-file','commit',$y);
857+
if (($y[0] ne $x[0]) || $x[0] !~ /^tree $sha1\n$/
858+
|| $y[0] !~ /^tree $sha1\n$/) {
859+
print STDERR "Trees not equal: $y[0] != $x[0]\n";
860+
return 0
861+
}
862+
return 1;
863+
}
864+
853865
sub assert_revision_eq_or_unknown {
854866
my ($revno, $commit) = @_;
855867
if (-f "$REV_DIR/$revno") {
856868
my $current = file_to_s("$REV_DIR/$revno");
857-
if ($commit ne $current) {
869+
if (($commit ne $current) && !trees_eq($commit, $current)) {
858870
croak "$REV_DIR/$revno already exists!\n",
859871
"current: $current\nexpected: $commit\n";
860872
}

environment.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ char git_default_name[MAX_GITNAME];
1414
int trust_executable_bit = 1;
1515
int assume_unchanged = 0;
1616
int only_use_symrefs = 0;
17+
int warn_ambiguous_refs = 0;
1718
int repository_format_version = 0;
1819
char git_commit_encoding[MAX_ENCODING_LENGTH] = "utf-8";
1920
int shared_repository = 0;

git-commit.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ run_status () {
161161
}
162162
'
163163

164-
if test -n "$verbose"
164+
if test -n "$verbose" -a -z "$IS_INITIAL"
165165
then
166166
git-diff-index --cached -M -p --diff-filter=MDTCRA $REFERENCE
167167
fi

http-fetch.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#define RANGE_HEADER_SIZE 30
99

1010
static int got_alternates = -1;
11+
static int corrupt_object_found = 0;
1112

1213
static struct curl_slist *no_pragma_header;
1314

@@ -834,6 +835,7 @@ static int fetch_object(struct alt_base *repo, unsigned char *sha1)
834835
obj_req->errorstr, obj_req->curl_result,
835836
obj_req->http_code, hex);
836837
} else if (obj_req->zret != Z_STREAM_END) {
838+
corrupt_object_found++;
837839
ret = error("File %s (%s) corrupt", hex, obj_req->url);
838840
} else if (memcmp(obj_req->sha1, obj_req->real_sha1, 20)) {
839841
ret = error("File %s has bad hash", hex);
@@ -993,5 +995,11 @@ int main(int argc, char **argv)
993995

994996
http_cleanup();
995997

998+
if (corrupt_object_found) {
999+
fprintf(stderr,
1000+
"Some loose object were found to be corrupt, but they might be just\n"
1001+
"a false '404 Not Found' error message sent with incorrect HTTP\n"
1002+
"status code. Suggest running git fsck-objects.\n");
1003+
}
9961004
return rc;
9971005
}

0 commit comments

Comments
 (0)