From a1a5a6347b4ac1005c5d9c2b636e906bf6c8ec12 Mon Sep 17 00:00:00 2001 From: Johannes Sixt Date: Wed, 6 Jun 2007 10:11:55 +0200 Subject: Accept dates before 2000/01/01 when specified as seconds since the epoch Tests with git-filter-branch on a repository that was converted from CVS and that has commits reaching back to 1999 revealed that it is necessary to parse dates before 2000/01/01 when they are specified as seconds since 1970/01/01. There is now still a limit, 100000000, which is 1973/03/03 09:46:40 UTC, in order to allow that dates are represented as 8 digits. Signed-off-by: Johannes Sixt Signed-off-by: Junio C Hamano diff --git a/date.c b/date.c index a9b59a2..4690371 100644 --- a/date.c +++ b/date.c @@ -414,9 +414,11 @@ static int match_digit(const char *date, struct tm *tm, int *offset, int *tm_gmt num = strtoul(date, &end, 10); /* - * Seconds since 1970? We trigger on that for anything after Jan 1, 2000 + * Seconds since 1970? We trigger on that for any numbers with + * more than 8 digits. This is because we don't want to rule out + * numbers like 20070606 as a YYYYMMDD date. */ - if (num > 946684800) { + if (num >= 100000000) { time_t time = num; if (gmtime_r(&time, tm)) { *tm_gmt = 1; -- cgit v0.10.2-6-g49f6 From e59ade9f90de0eacdac06f52d39b74074fc664af Mon Sep 17 00:00:00 2001 From: Sam Vilain Date: Thu, 7 Jun 2007 09:23:16 +1200 Subject: fix documentation of unpack-objects -n unpack-objects -n didn't print the object list as promised on the manual page, so alter the documentation to reflect the behaviour Signed-off-by: Junio C Hamano diff --git a/Documentation/git-unpack-objects.txt b/Documentation/git-unpack-objects.txt index ff6184b..b1b3ec9 100644 --- a/Documentation/git-unpack-objects.txt +++ b/Documentation/git-unpack-objects.txt @@ -27,8 +27,8 @@ new packs and replace existing ones. OPTIONS ------- -n:: - Only list the objects that would be unpacked, don't actually unpack - them. + Dry run. Check the pack file without actually unpacking + the objects. -q:: The command usually shows percentage progress. This -- cgit v0.10.2-6-g49f6 From 23fcdc79713c47a6a0d50762b9311c9933a60d3f Mon Sep 17 00:00:00 2001 From: Michael Milligan Date: Tue, 5 Jun 2007 00:06:30 -0600 Subject: git-cvsimport: Make sure to use $git_dir always instead of .git sometimes CVS import was failing on a couple repos I was trying to import. I was setting GIT_DIR=newproj.git and using the -i flag, but this bug was thwarting the effort... evil CVS. Signed-off-by: Junio C Hamano diff --git a/git-cvsimport.perl b/git-cvsimport.perl index f68afe7..4e6c9c6 100755 --- a/git-cvsimport.perl +++ b/git-cvsimport.perl @@ -692,8 +692,8 @@ sub commit { if ($branch eq $opt_o && !$index{branch} && !get_headref($branch, $git_dir)) { # looks like an initial commit # use the index primed by git-init - $ENV{GIT_INDEX_FILE} = '.git/index'; - $index{$branch} = '.git/index'; + $ENV{GIT_INDEX_FILE} = "$git_dir/index"; + $index{$branch} = "$git_dir/index"; } else { # use an index per branch to speed up # imports of projects with many branches @@ -984,7 +984,7 @@ if ($line =~ /^(\d+) objects, (\d+) kilobytes$/) { } foreach my $git_index (values %index) { - if ($git_index ne '.git/index') { + if ($git_index ne "$git_dir/index") { unlink($git_index); } } -- cgit v0.10.2-6-g49f6 From e2ac7cb5fbcf1407003aa07cdcd14141527ea2e3 Mon Sep 17 00:00:00 2001 From: Sam Vilain Date: Wed, 6 Jun 2007 22:25:17 +1200 Subject: Don't assume tree entries that are not dirs are blobs When scanning the trees in track_tree_refs() there is a "lazy" test that assumes that entries are either directories or files. Don't do that. Signed-off-by: Junio C Hamano diff --git a/object.c b/object.c index cfc4969..16793d9 100644 --- a/object.c +++ b/object.c @@ -160,8 +160,11 @@ struct object *parse_object_buffer(const unsigned char *sha1, enum object_type t parse_tag_buffer(tag, buffer, size); obj = &tag->object; } else { + warning("object %s has unknown type id %d\n", sha1_to_hex(sha1), type); obj = NULL; } + if (obj && obj->type == OBJ_NONE) + obj->type = type; *eaten_p = eaten; return obj; } diff --git a/tree.c b/tree.c index e4a39aa..e946dac 100644 --- a/tree.c +++ b/tree.c @@ -173,8 +173,13 @@ static void track_tree_refs(struct tree *item) continue; if (S_ISDIR(entry.mode)) obj = &lookup_tree(entry.sha1)->object; - else + else if (S_ISREG(entry.mode) || S_ISLNK(entry.mode)) obj = &lookup_blob(entry.sha1)->object; + else { + warning("in tree %s: entry %s has bad mode %.6o\n", + sha1_to_hex(item->object.sha1), entry.path, entry.mode); + obj = lookup_unknown_object(entry.sha1); + } refs->ref[i++] = obj; } set_object_refs(&item->object, refs); -- cgit v0.10.2-6-g49f6