Merge branch 'maint' to sync with 1.5.4.4
authorJunio C Hamano <gitster@pobox.com>
Sun, 9 Mar 2008 04:07:49 +0000 (20:07 -0800)
committerJunio C Hamano <gitster@pobox.com>
Sun, 9 Mar 2008 04:07:57 +0000 (20:07 -0800)
* maint:
GIT 1.5.4.4
ident.c: reword error message when the user name cannot be determined
Fix dcommit, rebase when rewriteRoot is in use
Really make the LF after reset in fast-import optional

1  2 
Documentation/RelNotes-1.5.5.txt
Documentation/git.txt
fast-import.c
git-svn.perl
t/t9300-fast-import.sh
index b57fa1eb1a5bfc1d03e59c90222e0b6ed96fe261,0000000000000000000000000000000000000000..874dad9a4f04b2ce11c9a7449c60b322aa041a37
mode 100644,000000..100644
--- /dev/null
@@@ -1,177 -1,0 +1,173 @@@
-  * "git-daemon" did not send early errors to syslog.
 +GIT v1.5.5 Release Notes
 +========================
 +
 +Updates since v1.5.4
 +--------------------
 +
 +(subsystems)
 +
 + * Comes with git-gui 0.9.3
 +
 +(performance)
 +
 + * On platforms with suboptimal qsort(3) implementation, there
 +   is an option to use more reasonable substitute we ship with
 +   our software.
 +
 + * New configuration variable "pack.packsizelimit" can be used
 +   in place of command line option --max-pack-size.
 +
 + * "git fetch" over the native git protocol used to make a
 +   connection to find out the set of current remote refs and
 +   another to actually download the pack data.  We now use only
 +   one connection for these tasks.
 +
 + * "git commit" does not run lstat(2) more than necessary
 +   anymore.
 +
 +(usability, bells and whistles)
 +
 + * You can be warned when core.autocrlf conversion is applied in
 +   such a way that results in an irreversible conversion.
 +
 + * A catch-all "color.ui" configuration variable can be used to
 +   enable coloring of all color-capable commands, instead of
 +   individual ones such as "color.status" and "color.branch".
 +
 + * The commands refused to take absolute pathnames where they
 +   require pathnames relative to the work tree or the current
 +   subdirectory.  They now can take absolute pathnames in such a
 +   case as long as the pathnames do not refer outside of the
 +   work tree.  E.g. "git add $(pwd)/foo" now works.
 +
 + * Error messages used to be sent to stderr, only to get hidden,
 +   when $PAGER was in use.  They now are sent to stdout along
 +   with the command output to be shown in the $PAGER.
 +
 + * A pattern "foo/" in .gitignore file now matches a directory
 +   "foo".  Pattern "foo" also matches as before.
 +
 + * bash completion's prompt helper function can talk about
 +   operation in-progress (e.g. merge, rebase, etc.).
 +
 + * Configuration variables "url.<usethis>.insteadof = <otherurl>" can be
 +   used to tell "git-fetch" and "git-push" to use different URL than what
 +   is given from the command line.
 +
 + * "git push <somewhere> HEAD" and "git push <somewhere> +HEAD" works as
 +   expected; they push the current branch (and only the current branch).
 +   In addition, HEAD can be written as the value of "remote.<there>.push"
 +   configuration variable.
 +
 + * "git add -i" behaves better even before you make an initial commit.
 +
 + * "git am" refused to run from a subdirectory without a good reason.
 +
 + * After "git apply --whitespace=fix" fixes whitespace errors in a patch,
 +   a line before the fix can appear as a context or preimage line in a
 +   later patch, causing the patch not to apply.  The command now knows to
 +   see through whitespace fixes done to context lines to successfully
 +   apply such a patch series.
 +
 + * "git branch" (and "git checkout -b") to branch from a local branch can
 +   optionally set "branch.<name>.merge" to mark the new branch to build on
 +   the other local branch, when "branch.autosetupmerge" is set to
 +   "always".  By default, this does not happen when branching from a local
 +   branch.
 +
 + * "git checkout" to switch to a branch that has "branch.<name>.merge" set
 +   (i.e. marked to build on another branch) reports how much the branch
 +   and the other branch diverged.
 +
 + * When "git checkout" has to update a lot of paths, it used to be silent
 +   for 4 seconds before it showed any progress report.  It is now a bit
 +   more impatient and starts showing progress report early.
 +
 + * "git commit" learned a new hook "prepare-commit-msg" that can
 +   inspect what is going to be committed and prepare the commit
 +   log message template to be edited.
 +
 + * "git cvsimport" can now take more than one -M options.
 +
 + * "git describe" learned to limit the tags to be used for
 +   naming with --match option.
 +
 + * "git describe --contains" now barfs when the named commit
 +   cannot be described.
 +
 + * "git describe --exact-match" describes only commits that are tagged.
 +
 + * "git describe --long" describes a tagged commit as $tag-0-$sha1,
 +   instead of just showing the exact tagname.
 +
 + * "git describe" warns when using a tag whose name and path contradict
 +   with each other.
 +
 + * "git diff" learned "--relative" option to limit and output paths
 +   relative to the current directory when working in a subdirectory.
 +
 + * "git diff" learned "--dirstat" option to show birds-eye-summary of
 +   changes more concisely than "--diffstat".
 +
 + * "git format-patch" learned --cover-letter option to generate a cover
 +   letter template.
 +
 + * "git gc" learned --quiet option.
 +
 + * "git grep" now knows "--name-only" is a synonym for the "-l" option.
 +
 + * "git help <alias>" now reports "'git <alias>' is alias to <what>",
 +   instead of saying "No manual entry for git-<alias>".
 +
 + * "git log --grep=<what>" learned "--fixed-strings" option to look for
 +   <what> without treating it as a regular expression.
 +
 + * "git gui" learned an auto-spell checking.
 +
 + * "git send-email" learned to prompt for passwords
 +   interactively.
 +
 + * "git send-email" learned an easier way to suppress CC
 +   recipients.
 +
 + * When the configuration variable "pack.threads" is set to 0, "git
 +   repack" auto detects the number of CPUs and uses that many threads.
 +
 + * Various "git cvsimport", "git cvsexportcommit", "git svn" and
 +   "git p4" improvements.
 +
 +(internal)
 +
 + * Duplicated code between git-help and git-instaweb that
 +   launches user's preferred browser has been refactored.
 +
 + * It is now easier to write test scripts that records known
 +   breakages.
 +
 + * "git checkout" is rewritten in C.
 +
 + * Two conflict hunks that are separated by a very short span of common
 +   lines are now coalesced into one larger hunk, to make the result easier
 +   to read.
 +
 + * Run-command API's use of file descriptors is documented clearer and
 +   is more consistent now.
 +
 +
 +Fixes since v1.5.4
 +------------------
 +
 +All of the fixes in v1.5.4 maintenance series are included in
 +this release, unless otherwise noted.
 +
-  * "git-log --merge" did not well work with --left-right option.
 + * "git-http-push" did not allow deletion of remote ref with the usual
 +   "push <remote> :<branch>" syntax.
 +
 + * "git-rebase --abort" did not go back to the right location if
 +   "git-reset" was run during the "git-rebase" session.
 +
 +---
 +exec >/var/tmp/1
 +O=v1.5.4.3-428-g6b48990
 +echo O=`git describe refs/heads/master`
 +git shortlog --no-merges $O..refs/heads/master ^refs/heads/maint
diff --combined Documentation/git.txt
index 741ae0e4c8ec9a3aaaef19430b0f76e4baedb546,17aee93ec5c89e1f1d0d499acaf08bf3cc300662..3ed24d449a1f277c40dbb49654a196e38d1fa3e4
@@@ -43,12 -43,9 +43,13 @@@ unreleased) version of git, that is ava
  branch of the `git.git` repository.
  Documentation for older releases are available here:
  
- * link:v1.5.4.3/git.html[documentation for release 1.5.4.3]
 -* link:v1.5.4/git.html[documentation for release 1.5.4]
++* link:v1.5.4.4/git.html[documentation for release 1.5.4.4]
  
  * release notes for
++  link:RelNotes-1.5.4.4.txt[1.5.4.4],
 +  link:RelNotes-1.5.4.3.txt[1.5.4.3],
 +  link:RelNotes-1.5.4.2.txt[1.5.4.2],
 +  link:RelNotes-1.5.4.1.txt[1.5.4.1],
    link:RelNotes-1.5.4.txt[1.5.4].
  
  * link:v1.5.3.8/git.html[documentation for release 1.5.3.8]
diff --combined fast-import.c
index 7f197d5e36ae977e21251dbb45fa72973ea7830f,32ec159915611f6a21c218969bf82a09b6720c48..655913ddb27f758ce494fc18551e852c9a6aa9f1
@@@ -372,8 -372,6 +372,8 @@@ static void write_branch_report(FILE *r
        fputc('\n', rpt);
  }
  
 +static void dump_marks_helper(FILE *, uintmax_t, struct mark_set *);
 +
  static void write_crash_report(const char *err)
  {
        char *loc = git_path("fast_import_crash_%d", getpid());
                        write_branch_report(rpt, b);
        }
  
 +      if (first_tag) {
 +              struct tag *tg;
 +              fputc('\n', rpt);
 +              fputs("Annotated Tags\n", rpt);
 +              fputs("--------------\n", rpt);
 +              for (tg = first_tag; tg; tg = tg->next_tag) {
 +                      fputs(sha1_to_hex(tg->sha1), rpt);
 +                      fputc(' ', rpt);
 +                      fputs(tg->name, rpt);
 +                      fputc('\n', rpt);
 +              }
 +      }
 +
 +      fputc('\n', rpt);
 +      fputs("Marks\n", rpt);
 +      fputs("-----\n", rpt);
 +      if (mark_file)
 +              fprintf(rpt, "  exported to %s\n", mark_file);
 +      else
 +              dump_marks_helper(rpt, 0, marks);
 +
        fputc('\n', rpt);
        fputs("-------------------\n", rpt);
        fputs("END OF CRASH REPORT\n", rpt);
        fclose(rpt);
  }
  
 +static void end_packfile(void);
 +static void unkeep_all_packs(void);
 +static void dump_marks(void);
 +
  static NORETURN void die_nicely(const char *err, va_list params)
  {
        static int zombie;
        if (!zombie) {
                zombie = 1;
                write_crash_report(message);
 +              end_packfile();
 +              unkeep_all_packs();
 +              dump_marks();
        }
        exit(128);
  }
@@@ -2291,7 -2261,8 +2291,8 @@@ static void cmd_reset_branch(void
        else
                b = new_branch(sp);
        read_next_command();
-       if (!cmd_from(b) && command_buf.len > 0)
+       cmd_from(b);
+       if (command_buf.len > 0)
                unread_command_buf = 1;
  }
  
@@@ -2377,7 -2348,6 +2378,7 @@@ int main(int argc, const char **argv
  {
        unsigned int i, show_stats = 1;
  
 +      setup_git_directory();
        git_config(git_pack_config);
        if (!pack_compression_seen && core_compression_seen)
                pack_compression_level = core_compression_level;
diff --combined git-svn.perl
index 9e2faf90aa1676974234882a2f557c17f7bc59f4,29f39c0831227a2a7c7b482cdf8277e95cf63245..1195569529401fd1c62414c8683a6b577721c1c7
@@@ -186,9 -186,6 +186,9 @@@ my %cmd = 
                    "Show info about the latest SVN revision
                     on the current branch",
                    { 'url' => \$_url, } ],
 +      'blame' => [ \&Git::SVN::Log::cmd_blame,
 +                  "Show what revision and author last modified each line of a file",
 +                  {} ],
  );
  
  my $cmd;
@@@ -1250,8 -1247,7 +1250,8 @@@ use File::Path qw/mkpath/
  use File::Copy qw/copy/;
  use IPC::Open3;
  
 -my $_repack_nr;
 +my ($_gc_nr, $_gc_period);
 +
  # properties that we do not log:
  my %SKIP_PROP;
  BEGIN {
@@@ -1412,10 -1408,9 +1412,10 @@@ sub read_all_remotes 
  }
  
  sub init_vars {
 -      $_repack = 1000 unless (defined $_repack && $_repack > 0);
 -      $_repack_nr = $_repack;
 -      $_repack_flags ||= '-d';
 +      $_gc_nr = $_gc_period = 1000;
 +      if (defined $_repack || defined $_repack_flags) {
 +             warn "Repack options are obsolete; they have no effect.\n";
 +      }
  }
  
  sub verify_remotes_sanity {
@@@ -1540,9 -1535,14 +1540,14 @@@ sub find_by_url { # repos_root and, pat
                                            $remotes->{$repo_id}->{$_});
                }
                my $p = $path;
+               my $rwr = rewrite_root({repo_id => $repo_id});
                unless (defined $p) {
                        $p = $full_url;
-                       $p =~ s#^\Q$u\E(?:/|$)## or next;
+                       my $z = $u;
+                       if ($rwr) {
+                               $z = $rwr;
+                       }
+                       $p =~ s#^\Q$z\E(?:/|$)## or next;
                }
                foreach my $f (keys %$fetch) {
                        next if $f ne $p;
@@@ -2101,10 -2101,6 +2106,10 @@@ sub restore_commit_header_env 
        }
  }
  
 +sub gc {
 +      command_noisy('gc', '--auto');
 +};
 +
  sub do_git_commit {
        my ($self, $log_entry) = @_;
        my $lr = $self->last_rev;
                                   0, $self->svm_uuid);
        }
        print " = $commit ($self->{ref_id})\n";
 -      if ($_repack && (--$_repack_nr == 0)) {
 -              $_repack_nr = $_repack;
 -              # repack doesn't use any arguments with spaces in them, does it?
 -              print "Running git repack $_repack_flags ...\n";
 -              command_noisy('repack', split(/\s+/, $_repack_flags));
 -              print "Done repacking\n";
 +      if (--$_gc_nr == 0) {
 +              $_gc_nr = $_gc_period;
 +              gc();
        }
        return $commit;
  }
@@@ -2232,12 -2231,7 +2237,12 @@@ sub find_parent_branch 
                # just grow a tail if we're not unique enough :x
                $ref_id .= '-' while find_ref($ref_id);
                print STDERR "Initializing parent: $ref_id\n";
 -              $gs = Git::SVN->init($new_url, '', $ref_id, $ref_id, 1);
 +              my ($u, $p) = ($new_url, '');
 +              if ($u =~ s#^\Q$url\E(/|$)##) {
 +                      $p = $u;
 +                      $u = $url;
 +              }
 +              $gs = Git::SVN->init($u, $p, $self->{repo_id}, $ref_id, 1);
        }
        my ($r0, $parent) = $gs->find_rev_before($r, 1);
        if (!defined $r0 || !defined $parent) {
@@@ -3995,7 -3989,6 +4000,7 @@@ sub gs_fetch_loop_common 
                $max += $inc;
                $max = $head if ($max > $head);
        }
 +      Git::SVN::gc();
  }
  
  sub match_globs {
        print commit_log_separator unless $incremental || $oneline;
  }
  
 +sub cmd_blame {
 +      my $path = shift;
 +
 +      config_pager();
 +      run_pager();
 +
 +      my ($fh, $ctx) = command_output_pipe('blame', @_, $path);
 +      while (my $line = <$fh>) {
 +              if ($line =~ /^\^?([[:xdigit:]]+)\s/) {
 +                      my (undef, $rev, undef) = ::cmt_metadata($1);
 +                      $rev = sprintf('%-10s', $rev);
 +                      $line =~ s/^\^?[[:xdigit:]]+(\s)/$rev$1/;
 +              }
 +              print $line;
 +      }
 +      command_close_pipe($fh, $ctx);
 +}
 +
  package Git::SVN::Migration;
  # these version numbers do NOT correspond to actual version numbers
  # of git nor git-svn.  They are just relative.
diff --combined t/t9300-fast-import.sh
index cceedbb2b7efc20b79155889ed20c5a7866fed9c,142d42f3b3f41adc99ada33d5ccac50739fb8a69..c4f4465dc687d30138a9111ae2efbc0e3aaf42b6
@@@ -165,9 -165,9 +165,9 @@@ from refs/heads/maste
  M 755 0000000000000000000000000000000000000001 zero1
  
  INPUT_END
 -test_expect_failure \
 -    'B: fail on invalid blob sha1' \
 -    'git-fast-import <input'
 +test_expect_success 'B: fail on invalid blob sha1' '
 +    ! git-fast-import <input
 +'
  rm -f .git/objects/pack_* .git/objects/index_*
  
  cat >input <<INPUT_END
@@@ -180,9 -180,9 +180,9 @@@ COMMI
  from refs/heads/master
  
  INPUT_END
 -test_expect_failure \
 -    'B: fail on invalid branch name ".badbranchname"' \
 -    'git-fast-import <input'
 +test_expect_success 'B: fail on invalid branch name ".badbranchname"' '
 +    ! git-fast-import <input
 +'
  rm -f .git/objects/pack_* .git/objects/index_*
  
  cat >input <<INPUT_END
@@@ -195,9 -195,9 +195,9 @@@ COMMI
  from refs/heads/master
  
  INPUT_END
 -test_expect_failure \
 -    'B: fail on invalid branch name "bad[branch]name"' \
 -    'git-fast-import <input'
 +test_expect_success 'B: fail on invalid branch name "bad[branch]name"' '
 +    ! git-fast-import <input
 +'
  rm -f .git/objects/pack_* .git/objects/index_*
  
  cat >input <<INPUT_END
@@@ -339,9 -339,9 +339,9 @@@ COMMI
  from refs/heads/branch^0
  
  INPUT_END
 -test_expect_failure \
 -    'E: rfc2822 date, --date-format=raw' \
 -    'git-fast-import --date-format=raw <input'
 +test_expect_success 'E: rfc2822 date, --date-format=raw' '
 +    ! git-fast-import --date-format=raw <input
 +'
  test_expect_success \
      'E: rfc2822 date, --date-format=rfc2822' \
      'git-fast-import --date-format=rfc2822 <input'
@@@ -869,6 -869,8 +869,8 @@@ zcommit
  COMMIT
  reset refs/tags/O3-2nd
  from :5
+ reset refs/tags/O3-3rd
+ from :5
  INPUT_END
  
  cat >expect <<INPUT_END