From bb924cb331c143eaf92ba8d86b65caff15252543 Mon Sep 17 00:00:00 2001 From: Michele Ballabio Date: Fri, 27 Apr 2007 21:56:47 +0200 Subject: git shortlog documentation: add long options and fix a typo Signed-off-by: Michele Ballabio Signed-off-by: Junio C Hamano diff --git a/Documentation/git-shortlog.txt b/Documentation/git-shortlog.txt index 1c8c55e..15cc6f7 100644 --- a/Documentation/git-shortlog.txt +++ b/Documentation/git-shortlog.txt @@ -9,7 +9,7 @@ SYNOPSIS -------- [verse] git-log --pretty=short | 'git-shortlog' [-h] [-n] [-s] -git-shortlog [-n|--number] [-s|--summary] [...] +git-shortlog [-n|--numbered] [-s|--summary] [...] DESCRIPTION ----------- @@ -22,14 +22,14 @@ Additionally, "[PATCH]" will be stripped from the commit description. OPTIONS ------- --h:: +-h, \--help:: Print a short usage message and exit. --n:: +-n, \--numbered:: Sort output according to the number of commits per author instead of author alphabetic order. --s:: +-s, \--summary:: Suppress commit description and provide a commit count summary only. FILES -- cgit v0.10.2-6-g49f6 From 26e60160a074747fbe8866ddac4e0c7660c17ff6 Mon Sep 17 00:00:00 2001 From: Adam Roben Date: Fri, 27 Apr 2007 11:57:53 -0700 Subject: git-svn: Added 'find-rev' command This patch adds a new 'find-rev' command to git-svn that lets you easily translate between SVN revision numbers and git tree-ish. Signed-off-by: Adam Roben Acked-by: Eric Wong Signed-off-by: Junio C Hamano diff --git a/Documentation/git-svn.txt b/Documentation/git-svn.txt index a0d34e0..a35b9de 100644 --- a/Documentation/git-svn.txt +++ b/Documentation/git-svn.txt @@ -159,6 +159,11 @@ New features: Any other arguments are passed directly to `git log' -- +'find-rev':: + When given an SVN revision number of the form 'rN', returns the + corresponding git commit hash. When given a tree-ish, returns the + corresponding SVN revision number. + 'set-tree':: You should consider using 'dcommit' instead of this command. Commit specified commit or tree objects to SVN. This relies on diff --git a/git-svn.perl b/git-svn.perl index 7b5f8ab..4be8576 100755 --- a/git-svn.perl +++ b/git-svn.perl @@ -141,6 +141,8 @@ my %cmd = ( 'color' => \$Git::SVN::Log::color, 'pager=s' => \$Git::SVN::Log::pager, } ], + 'find-rev' => [ \&cmd_find_rev, "Translate between SVN revision numbers and tree-ish", + { } ], 'rebase' => [ \&cmd_rebase, "Fetch and rebase your working directory", { 'merge|m|M' => \$_merge, 'verbose|v' => \$_verbose, @@ -428,6 +430,28 @@ sub cmd_dcommit { command_noisy(@finish, $gs->refname); } +sub cmd_find_rev { + my $revision_or_hash = shift; + my $result; + if ($revision_or_hash =~ /^r\d+$/) { + my $desired_revision = substr($revision_or_hash, 1); + my ($fh, $ctx) = command_output_pipe('rev-list', 'HEAD'); + while (my $hash = <$fh>) { + chomp($hash); + my (undef, $rev, undef) = cmt_metadata($hash); + if ($rev && $rev eq $desired_revision) { + $result = $hash; + last; + } + } + command_close_pipe($fh, $ctx); + } else { + my (undef, $rev, undef) = cmt_metadata($revision_or_hash); + $result = $rev; + } + print "$result\n" if $result; +} + sub cmd_rebase { command_noisy(qw/update-index --refresh/); my ($url, $rev, $uuid, $gs) = working_head_info('HEAD'); -- cgit v0.10.2-6-g49f6 From 87859f34434dda61cabb03447efd1dd2fe7ebac7 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Sun, 29 Apr 2007 01:59:47 +0200 Subject: import-tars: be nice to wrong directory modes Some tars seem to have modes 0755 for directories, not 01000755. Do not generate an empty object for them, but ignore them. Noticed by riddochc on IRC. Signed-off-by: Johannes Schindelin Signed-off-by: Shawn O. Pearce diff --git a/contrib/fast-import/import-tars.perl b/contrib/fast-import/import-tars.perl index 5585a8b..e846477 100755 --- a/contrib/fast-import/import-tars.perl +++ b/contrib/fast-import/import-tars.perl @@ -52,6 +52,7 @@ foreach my $tar_file (@ARGV) Z8 Z1 Z100 Z6 Z2 Z32 Z32 Z8 Z8 Z*', $_; last unless $name; + next if $name =~ '/$'; $mode = oct $mode; $size = oct $size; $mtime = oct $mtime; -- cgit v0.10.2-6-g49f6 From 475d1b333a03b0c13cbbc4ebf395fe11c989f931 Mon Sep 17 00:00:00 2001 From: "Shawn O. Pearce" Date: Sat, 28 Apr 2007 20:01:27 -0400 Subject: Don't allow empty pathnames in fast-import riddochc on #git noticed corruption caused by import-tars. This was fixed in the prior commit by Dscho, but fast-import was wrong to have allowed a tree to be created with an empty string as the filename. No operating system allows this, and Git itself doesn't accept this into the index. Signed-off-by: Shawn O. Pearce diff --git a/fast-import.c b/fast-import.c index cdd629d..6c43a0d 100644 --- a/fast-import.c +++ b/fast-import.c @@ -1193,6 +1193,8 @@ static int tree_content_set( n = slash1 - p; else n = strlen(p); + if (!n) + die("Empty path component found in input"); for (i = 0; i < t->entry_count; i++) { e = t->entries[i]; -- cgit v0.10.2-6-g49f6 From cb2cada6da9d71604fd09efbff47cddbea453e1e Mon Sep 17 00:00:00 2001 From: "Shawn O. Pearce" Date: Sat, 28 Apr 2007 20:29:23 -0400 Subject: Catch empty pathnames in trees during fsck Released versions of fast-import have been able to create a tree that contains files or subtrees that contain no name. Unfortunately these trees aren't valid, but people may have actually tried to create them due to bugs in import-tars.perl or their own fast-import frontend. We now look for this unusual condition and warn the user if at least one of their tree objects contains the problem. Signed-off-by: Shawn O. Pearce Signed-off-by: Junio C Hamano diff --git a/builtin-fsck.c b/builtin-fsck.c index 7c3b0a5..75e10e2 100644 --- a/builtin-fsck.c +++ b/builtin-fsck.c @@ -218,6 +218,7 @@ static int fsck_tree(struct tree *item) { int retval; int has_full_path = 0; + int has_empty_name = 0; int has_zero_pad = 0; int has_bad_modes = 0; int has_dup_entries = 0; @@ -241,6 +242,8 @@ static int fsck_tree(struct tree *item) if (strchr(name, '/')) has_full_path = 1; + if (!*name) + has_empty_name = 1; has_zero_pad |= *(char *)desc.buffer == '0'; update_tree_entry(&desc); @@ -289,6 +292,9 @@ static int fsck_tree(struct tree *item) if (has_full_path) { objwarning(&item->object, "contains full pathnames"); } + if (has_empty_name) { + objwarning(&item->object, "contains empty pathname"); + } if (has_zero_pad) { objwarning(&item->object, "contains zero-padded file modes"); } -- cgit v0.10.2-6-g49f6 From 4e6380e5c3af2d8cea8ffac2a7759b4f4e62089b Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Sat, 28 Apr 2007 00:15:48 -0700 Subject: Do not barf on too long action description Reflog message is primarily about easier identification, and leaving truncated entry is much better than dying. Signed-off-by: Junio C Hamano diff --git a/builtin-fetch--tool.c b/builtin-fetch--tool.c index e9d6764..2ad45dc 100644 --- a/builtin-fetch--tool.c +++ b/builtin-fetch--tool.c @@ -35,16 +35,13 @@ static int update_ref(const char *action, unsigned char *sha1, unsigned char *oldval) { - int len; char msg[1024]; char *rla = getenv("GIT_REFLOG_ACTION"); static struct ref_lock *lock; if (!rla) rla = "(reflog update)"; - len = snprintf(msg, sizeof(msg), "%s: %s", rla, action); - if (sizeof(msg) <= len) - die("insanely long action"); + snprintf(msg, sizeof(msg), "%s: %s", rla, action); lock = lock_any_ref_for_update(refname, oldval); if (!lock) return 1; -- cgit v0.10.2-6-g49f6 From 2342c4ee1437277a36c07246ab577a520dab588b Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Sun, 29 Apr 2007 00:22:00 -0700 Subject: Update .mailmap with "Michael" Signed-off-by: Junio C Hamano diff --git a/.mailmap b/.mailmap index 3a624ea..17e89af 100644 --- a/.mailmap +++ b/.mailmap @@ -23,6 +23,7 @@ Lars Doelle Lars Doelle Lukas Sandström Martin Langhoff +Michele Ballabio Nguyễn Thái Ngọc Duy Ramsay Allan Jones René Scharfe -- cgit v0.10.2-6-g49f6 From d0c32b63394992f8dd083a4f2f380ab190dbb2ca Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Sun, 29 Apr 2007 00:31:14 -0700 Subject: Fix import-tars fix. This heeds advice from our resident Perl expert to make sure the script is not confused with a string that ends with /\n Signed-off-by: Junio C Hamano diff --git a/contrib/fast-import/import-tars.perl b/contrib/fast-import/import-tars.perl index e846477..82a9042 100755 --- a/contrib/fast-import/import-tars.perl +++ b/contrib/fast-import/import-tars.perl @@ -52,7 +52,7 @@ foreach my $tar_file (@ARGV) Z8 Z1 Z100 Z6 Z2 Z32 Z32 Z8 Z8 Z*', $_; last unless $name; - next if $name =~ '/$'; + next if $name =~ m{/\z}; $mode = oct $mode; $size = oct $size; $mtime = oct $mtime; -- cgit v0.10.2-6-g49f6 From 4e58bf970bfddb8106541d98c3321fdf2a6ba23b Mon Sep 17 00:00:00 2001 From: Josh Triplett Date: Sat, 28 Apr 2007 18:40:12 -0700 Subject: Add missing reference to GIT_COMMITTER_DATE in git-commit-tree documentation Signed-off-by: Josh Triplett Signed-off-by: Junio C Hamano diff --git a/Documentation/git-commit-tree.txt b/Documentation/git-commit-tree.txt index cf25507..1571dbb 100644 --- a/Documentation/git-commit-tree.txt +++ b/Documentation/git-commit-tree.txt @@ -60,6 +60,7 @@ either `.git/config` file, or using the following environment variables. GIT_AUTHOR_DATE GIT_COMMITTER_NAME GIT_COMMITTER_EMAIL + GIT_COMMITTER_DATE (nb "<", ">" and "\n"s are stripped) diff --git a/Documentation/git.txt b/Documentation/git.txt index 9defc33..c81162e 100644 --- a/Documentation/git.txt +++ b/Documentation/git.txt @@ -340,6 +340,7 @@ git Commits 'GIT_AUTHOR_DATE':: 'GIT_COMMITTER_NAME':: 'GIT_COMMITTER_EMAIL':: +'GIT_COMMITTER_DATE':: see gitlink:git-commit-tree[1] git Diffs -- cgit v0.10.2-6-g49f6 From e9d54bd18bcf5dc9eb68eb1cba9a6a7ba3f71fd6 Mon Sep 17 00:00:00 2001 From: Julian Phillips Date: Sun, 29 Apr 2007 03:46:42 +0100 Subject: http.c: Fix problem with repeated calls of http_init Calling http_init after calling http_cleanup causes a segfault. This is due to the pragma_header curl_slist being freed but not being set to NULL. The subsequent call to http_init tries to setup the slist again, but it now points to an invalid memory location. Signed-off-by: Julian Phillips Signed-off-by: Junio C Hamano diff --git a/http.c b/http.c index 576740f..ae27e0c 100644 --- a/http.c +++ b/http.c @@ -300,6 +300,7 @@ void http_cleanup(void) curl_global_cleanup(); curl_slist_free_all(pragma_header); + pragma_header = NULL; } struct active_request_slot *get_active_slot(void) -- cgit v0.10.2-6-g49f6