Merge branch 'gr/smtp'
authorJunio C Hamano <gitster@pobox.com>
Sat, 29 Sep 2007 23:44:44 +0000 (16:44 -0700)
committerJunio C Hamano <gitster@pobox.com>
Sat, 29 Sep 2007 23:44:44 +0000 (16:44 -0700)
* gr/smtp:
send-email --smtp-server-port: allow overriding the default port

21 files changed:
Documentation/RelNotes-1.5.3.3.txt [new file with mode: 0644]
Documentation/core-tutorial.txt
Documentation/git-bundle.txt
Documentation/git-merge.txt
Documentation/git-remote.txt
Documentation/git-submodule.txt
Documentation/gitattributes.txt
Documentation/gitignore.txt
Documentation/user-manual.txt
diff.c
diffcore-rename.c
diffcore.h
git-mergetool.sh
git-quiltimport.sh
git-remote.perl
git-submodule.sh
git-svnimport.perl
revision.c
t/t5505-remote.sh [new file with mode: 0755]
t/t9101-git-svn-props.sh
t/t9104-git-svn-follow-parent.sh
diff --git a/Documentation/RelNotes-1.5.3.3.txt b/Documentation/RelNotes-1.5.3.3.txt
new file mode 100644 (file)
index 0000000..e91bd84
--- /dev/null
@@ -0,0 +1,37 @@
+GIT v1.5.3.3 Release Notes
+==========================
+
+Fixes since v1.5.3.2
+--------------------
+
+ * git-quiltimport did not like it when a patch described in the
+   series file does not exist.
+
+ * p4 importer missed executable bit in some cases.
+
+ * The default shell on some FreeBSD did not execute the
+   argument parsing code correctly and made git unusable.
+
+ * git-svn incorrectly spawned pager even when the user user
+   explicitly asked not to.
+
+ * sample post-receive hook overquoted the envelope sender
+   value.
+
+ * git-am got confused when the patch contained a change that is
+   only about type and not contents.
+
+ * git-mergetool did not show our and their version of the
+   conflicted file when started from a subdirectory of the
+   project.
+
+ * git-mergetool did not pass correct options when invoking diff3.
+
+ * git-log sometimes invoked underlying "diff" machinery
+   unnecessarily.
+
+--
+exec >/var/tmp/1
+O=v1.5.3.2-29-gb7bb760
+echo O=`git describe refs/heads/maint`
+git shortlog --no-merges $O..refs/heads/maint
index 4b4fd9a50639ad6e1517e426c027c5855c1b79f7..6b2590d0723ad94a45c9cae174935839df3331d8 100644 (file)
@@ -1459,7 +1459,8 @@ Although git is a truly distributed system, it is often
 convenient to organize your project with an informal hierarchy
 of developers. Linux kernel development is run this way. There
 is a nice illustration (page 17, "Merges to Mainline") in
-link:http://tinyurl.com/a2jdg[Randy Dunlap's presentation].
+link:http://www.xenotime.net/linux/mentor/linux-mentoring-2006.pdf
+[Randy Dunlap's presentation].
 
 It should be stressed that this hierarchy is purely *informal*.
 There is nothing fundamental in git that enforces the "chain of
index 5051e2bada6d2409f40a04bbd25a5201df7d836e..0cc6511bdf35f29ce946726485f71eeddddce56b 100644 (file)
@@ -103,14 +103,20 @@ We set a tag in R1 (lastR2bundle) after the previous such transport,
 and move it afterwards to help build the bundle.
 
 in R1 on A:
+
+------------
 $ git-bundle create mybundle master ^lastR2bundle
 $ git tag -f lastR2bundle master
+------------
 
 (move mybundle from A to B by some mechanism)
 
 in R2 on B:
+
+------------
 $ git-bundle verify mybundle
 $ git-fetch mybundle  refspec
+------------
 
 where refspec is refInBundle:localRef
 
@@ -124,9 +130,11 @@ Also, with something like this in your config:
 You can first sneakernet the bundle file to ~/tmp/file.bdl and
 then these commands:
 
+------------
 $ git ls-remote bundle
 $ git fetch bundle
 $ git pull bundle
+------------
 
 would treat it as if it is talking with a remote side over the
 network.
index 144bc16ff26bbf1d311482e6be15fc034994ce49..eae49c4876caf6b2e6a8bd9770b3981fb8133edd 100644 (file)
@@ -56,7 +56,7 @@ merge.verbosity::
        message if conflicts were detected. Level 1 outputs only
        conflicts, 2 outputs conflicts and file changes.  Level 5 and
        above outputs debugging information.  The default is level 2.
-       Can be overriden by 'GIT_MERGE_VERBOSITY' environment variable.
+       Can be overridden by 'GIT_MERGE_VERBOSITY' environment variable.
 
 
 HOW MERGE WORKS
index 94b9f177724993b800e5d0bd4e67f986bfffc188..027ba11bdb67ba540b63ec12e5a6b920cd2e5f7e 100644 (file)
@@ -11,6 +11,7 @@ SYNOPSIS
 [verse]
 'git-remote'
 'git-remote' add [-t <branch>] [-m <branch>] [-f] [--mirror] <name> <url>
+'git-remote' rm <name>
 'git-remote' show <name>
 'git-remote' prune <name>
 'git-remote' update [group]
@@ -50,6 +51,11 @@ In mirror mode, enabled with `--mirror`, the refs will not be stored
 in the 'refs/remotes/' namespace, but in 'refs/heads/'.  This option
 only makes sense in bare repositories.
 
+'rm'::
+
+Remove the remote named <name>. All remote tracking branches and
+configuration settings for the remote are removed.
+
 'show'::
 
 Gives some information about the remote <name>.
index 2c48936fcd72c5276ae2fed217bd9b9564342f03..335e973a6a1d5350c1558eb68985ffe812c09212 100644 (file)
@@ -21,6 +21,9 @@ add::
        repository is cloned at the specified path, added to the
        changeset and registered in .gitmodules.   If no path is
        specified, the path is deduced from the repository specification.
+       If the repository url begins with ./ or ../, it is stored as
+       given but resolved as a relative path from the main project's
+       url when cloning.
 
 status::
        Show the status of the submodules. This will print the SHA-1 of the
index d0e951ee6f1c391459f822b8ecbb4c1237b209db..20cf8ff81673265629028b49c34e0393063fd6b1 100644 (file)
@@ -145,17 +145,6 @@ sign `$` upon checkout.  Any byte sequence that begins with
 with `$Id$` upon check-in.
 
 
-Interaction between checkin/checkout attributes
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-In the check-in codepath, the worktree file is first converted
-with `ident` (if specified), and then with `crlf` (again, if
-specified and applicable).
-
-In the check-out codepath, the blob content is first converted
-with `crlf`, and then `ident`.
-
-
 `filter`
 ^^^^^^^^
 
@@ -175,11 +164,10 @@ but makes the filter a no-op passthru.
 The content filtering is done to massage the content into a
 shape that is more convenient for the platform, filesystem, and
 the user to use.  The keyword here is "more convenient" and not
-"turning something unusable into usable".  In other words, it is
-"hanging yourself because we gave you a long rope" if your
-project uses filtering mechanism in such a way that it makes
-your project unusable unless the checkout is done with a
-specific filter in effect.
+"turning something unusable into usable".  In other words, the
+intent is that if someone unsets the filter driver definition,
+or does not have the appropriate filter program, the project
+should still be usable.
 
 
 Interaction between checkin/checkout attributes
index 9c83095693447a46f36299f417d71262890fb098..e8b8581f5280eefc470b216a80210f5f552a780a 100644 (file)
@@ -26,7 +26,7 @@ precedence, the last matching pattern decides the outcome):
 
  * Patterns read from a `.gitignore` file in the same directory
    as the path, or in any parent directory, with patterns in the
-   higher level files (up to the root) being overriden by those in
+   higher level files (up to the root) being overridden by those in
    lower level files down to the directory containing the file.
    These patterns match relative to the location of the
    `.gitignore` file.  A project normally includes such
index a085ca1d3919205d20923d73301f3d79ea1605af..c7fdf25e27c94e9b152592a28bf7acc64dfa0e07 100644 (file)
@@ -2856,8 +2856,7 @@ between two related tree objects, since it can ignore any entries with
 identical object names.
 
 (Note: in the presence of submodules, trees may also have commits as
-entries.   See gitlink:git-submodule[1] and gitlink:gitmodules.txt[1]
-for partial documentation.)
+entries.  See <<submodules>> for documentation.)
 
 Note that the files all have mode 644 or 755: git actually only pays
 attention to the executable bit.
@@ -3163,12 +3162,45 @@ information as long as you have the name of the tree that it described.
 Submodules
 ==========
 
-This tutorial explains how to create and publish a repository with submodules
-using the gitlink:git-submodule[1] command.
-
-Submodules maintain their own identity; the submodule support just stores the
-submodule repository location and commit ID, so other developers who clone the
-superproject can easily clone all the submodules at the same revision.
+Large projects are often composed of smaller, self-contained modules.  For
+example, an embedded Linux distribution's source tree would include every
+piece of software in the distribution with some local modifications; a movie
+player might need to build against a specific, known-working version of a
+decompression library; several independent programs might all share the same
+build scripts.
+
+With centralized revision control systems this is often accomplished by
+including every module in one single repository.  Developers can check out
+all modules or only the modules they need to work with.  They can even modify
+files across several modules in a single commit while moving things around
+or updating APIs and translations.
+
+Git does not allow partial checkouts, so duplicating this approach in Git
+would force developers to keep a local copy of modules they are not
+interested in touching.  Commits in an enormous checkout would be slower
+than you'd expect as Git would have to scan every directory for changes.
+If modules have a lot of local history, clones would take forever.
+
+On the plus side, distributed revision control systems can much better
+integrate with external sources.  In a centralized model, a single arbitrary
+snapshot of the external project is exported from its own revision control
+and then imported into the local revision control on a vendor branch.  All
+the history is hidden.  With distributed revision control you can clone the
+entire external history and much more easily follow development and re-merge
+local changes.
+
+Git's submodule support allows a repository to contain, as a subdirectory, a
+checkout of an external project.  Submodules maintain their own identity;
+the submodule support just stores the submodule repository location and
+commit ID, so other developers who clone the containing project
+("superproject") can easily clone all the submodules at the same revision.
+Partial checkouts of the superproject are possible: you can tell Git to
+clone none, some or all of the submodules.
+
+The gitlink:git-submodule[1] command is available since Git 1.5.3.  Users
+with Git 1.5.2 can look up the submodule commits in the repository and
+manually check them out; earlier versions won't recognize the submodules at
+all.
 
 To see how submodule support works, create (for example) four example
 repositories that can be used later as a submodule:
@@ -3213,8 +3245,8 @@ The `git submodule add` command does a couple of things:
 
 - It clones the submodule under the current directory and by default checks out
   the master branch.
-- It adds the submodule's clone path to the `.gitmodules` file and adds this
-  file to the index, ready to be committed.
+- It adds the submodule's clone path to the gitlink:gitmodules[5] file and
+  adds this file to the index, ready to be committed.
 - It adds the submodule's current commit ID to the index, ready to be
   committed.
 
@@ -4277,5 +4309,3 @@ Write a chapter on using plumbing and writing scripts.
 Alternates, clone -reference, etc.
 
 git unpack-objects -r for recovery
-
-submodules
diff --git a/diff.c b/diff.c
index 0ee9ea1c1b47b82710a3850e7e9f679e4486f7bd..35e3c619864809a46cd5b6a36d08e8103b5ce485 100644 (file)
--- a/diff.c
+++ b/diff.c
@@ -1675,7 +1675,7 @@ int diff_populate_filespec(struct diff_filespec *s, int size_only)
        return 0;
 }
 
-void diff_free_filespec_data(struct diff_filespec *s)
+void diff_free_filespec_data_large(struct diff_filespec *s)
 {
        if (s->should_free)
                free(s->data);
@@ -1686,6 +1686,11 @@ void diff_free_filespec_data(struct diff_filespec *s)
                s->should_free = s->should_munmap = 0;
                s->data = NULL;
        }
+}
+
+void diff_free_filespec_data(struct diff_filespec *s)
+{
+       diff_free_filespec_data_large(s);
        free(s->cnt_data);
        s->cnt_data = NULL;
 }
index 41b35c3a9e6935f6cd8563de732321e74e115765..4fc200064ae655c6936828c6bf04234afde778ce 100644 (file)
@@ -184,7 +184,8 @@ static int estimate_similarity(struct diff_filespec *src,
        if (base_size * (MAX_SCORE-minimum_score) < delta_size * MAX_SCORE)
                return 0;
 
-       if (diff_populate_filespec(src, 0) || diff_populate_filespec(dst, 0))
+       if ((!src->cnt_data && diff_populate_filespec(src, 0))
+               || (!dst->cnt_data && diff_populate_filespec(dst, 0)))
                return 0; /* error but caught downstream */
 
 
@@ -377,10 +378,10 @@ void diffcore_rename(struct diff_options *options)
                        m->score = estimate_similarity(one, two,
                                                       minimum_score);
                        m->name_score = basename_same(one, two);
-                       diff_free_filespec_data(one);
+                       diff_free_filespec_data_large(one);
                }
                /* We do not need the text anymore */
-               diff_free_filespec_data(two);
+               diff_free_filespec_data_large(two);
                dst_cnt++;
        }
        /* cost matrix sorted by most to least similar pair */
index eef17c4ca2e81c572fb110e9eb11e8ed9d51f9a0..4bf175bda99f51f8df1445349d87bc59b56095e7 100644 (file)
@@ -48,6 +48,7 @@ extern void fill_filespec(struct diff_filespec *, const unsigned char *,
 
 extern int diff_populate_filespec(struct diff_filespec *, int);
 extern void diff_free_filespec_data(struct diff_filespec *);
+extern void diff_free_filespec_data_large(struct diff_filespec *);
 extern int diff_filespec_is_binary(struct diff_filespec *);
 
 struct diff_filepair {
index a0e44f71c4acd5d995bf823913ba63e119ed2e68..9f4f3134b60174495c23968cf1ca01ffdbc49bdf 100755 (executable)
@@ -12,6 +12,7 @@ USAGE='[--tool=tool] [file to merge] ...'
 SUBDIRECTORY_OK=Yes
 . git-sh-setup
 require_work_tree
+prefix=$(git rev-parse --show-prefix)
 
 # Returns true if the mode reflects a symlink
 is_symlink () {
@@ -162,9 +163,9 @@ merge_file () {
     local_mode=`git ls-files -u -- "$path" | awk '{if ($3==2) print $1;}'`
     remote_mode=`git ls-files -u -- "$path" | awk '{if ($3==3) print $1;}'`
 
-    base_present   && git cat-file blob ":1:$path" > "$BASE" 2>/dev/null
-    local_present  && git cat-file blob ":2:$path" > "$LOCAL" 2>/dev/null
-    remote_present && git cat-file blob ":3:$path" > "$REMOTE" 2>/dev/null
+    base_present   && git cat-file blob ":1:$prefix$path" >"$BASE" 2>/dev/null
+    local_present  && git cat-file blob ":2:$prefix$path" >"$LOCAL" 2>/dev/null
+    remote_present && git cat-file blob ":3:$prefix$path" >"$REMOTE" 2>/dev/null
 
     if test -z "$local_mode" -o -z "$remote_mode"; then
        echo "Deleted merge conflict for '$path':"
@@ -191,10 +192,10 @@ merge_file () {
     case "$merge_tool" in
        kdiff3)
            if base_present ; then
-               (kdiff3 --auto --L1 "$path (Base)" -L2 "$path (Local)" --L3 "$path (Remote)" \
+               (kdiff3 --auto --L1 "$path (Base)" --L2 "$path (Local)" --L3 "$path (Remote)" \
                    -o "$path" -- "$BASE" "$LOCAL" "$REMOTE" > /dev/null 2>&1)
            else
-               (kdiff3 --auto -L1 "$path (Local)" --L2 "$path (Remote)" \
+               (kdiff3 --auto --L1 "$path (Local)" --L2 "$path (Remote)" \
                    -o "$path" -- "$LOCAL" "$REMOTE" > /dev/null 2>&1)
            fi
            status=$?
@@ -251,9 +252,9 @@ merge_file () {
            ;;
        emerge)
            if base_present ; then
-               emacs -f emerge-files-with-ancestor-command "$LOCAL" "$REMOTE" "$BASE" "$path"
+               emacs -f emerge-files-with-ancestor-command "$LOCAL" "$REMOTE" "$BASE" "$(basename "$path")"
            else
-               emacs -f emerge-files-command "$LOCAL" "$REMOTE" "$path"
+               emacs -f emerge-files-command "$LOCAL" "$REMOTE" "$(basename "$path")"
            fi
            status=$?
            save_backup
index 74a54d5d08f86ebbd6a4b3af1f6950dbfd91c743..880c81d121bfb9555c729bc299f8ae8baf1db32c 100755 (executable)
@@ -71,6 +71,10 @@ commit=$(git rev-parse HEAD)
 
 mkdir $tmp_dir || exit 2
 for patch_name in $(grep -v '^#' < "$QUILT_PATCHES/series" ); do
+       if ! [ -f "$QUILT_PATCHES/$patch_name" ] ; then
+               echo "$patch_name doesn't exist. Skipping."
+               continue
+       fi
        echo $patch_name
        git mailinfo "$tmp_msg" "$tmp_patch" \
                <"$QUILT_PATCHES/$patch_name" >"$tmp_info" || exit 3
index f6f283ea4f8b45671b7d9b34687d5d7b8475e8b3..b7c1e01d7d7d5dfb68870d65c0f0419138ccc506 100755 (executable)
@@ -316,6 +316,34 @@ sub update_remote {
        }
 }
 
+sub rm_remote {
+       my ($name) = @_;
+       if (!exists $remote->{$name}) {
+               print STDERR "No such remote $name\n";
+               return;
+       }
+
+       $git->command('config', '--remove-section', "remote.$name");
+
+       eval {
+           my @trackers = $git->command('config', '--get-regexp',
+                       'branch.*.remote', $name);
+               for (@trackers) {
+                       /^branch\.(.*)?\.remote/;
+                       $git->config('--unset', "branch.$1.remote");
+                       $git->config('--unset', "branch.$1.merge");
+               }
+       };
+
+
+       my @refs = $git->command('for-each-ref',
+               '--format=%(refname) %(objectname)', "refs/remotes/$name");
+       for (@refs) {
+               ($ref, $object) = split;
+               $git->command(qw(update-ref -d), $ref, $object);
+       }
+}
+
 sub add_usage {
        print STDERR "Usage: git remote add [-f] [-t track]* [-m master] <name> <url>\n";
        exit(1);
@@ -422,9 +450,17 @@ sub add_usage {
        }
        add_remote($ARGV[1], $ARGV[2], \%opts);
 }
+elsif ($ARGV[0] eq 'rm') {
+       if (@ARGV <= 1) {
+               print STDERR "Usage: git remote rm <remote>\n";
+               exit(1);
+       }
+       rm_remote($ARGV[1]);
+}
 else {
        print STDERR "Usage: git remote\n";
        print STDERR "       git remote add <name> <url>\n";
+       print STDERR "       git remote rm <name>\n";
        print STDERR "       git remote show <name>\n";
        print STDERR "       git remote prune <name>\n";
        print STDERR "       git remote update [group]\n";
index 673aa27a452b11af62d89986bf21c8a4f10e0c41..727b1d3206da6964affe80d92699cd39c1878e34 100755 (executable)
@@ -39,6 +39,32 @@ get_repo_base() {
        ) 2>/dev/null
 }
 
+# Resolve relative url by appending to parent's url
+resolve_relative_url ()
+{
+       branch="$(git symbolic-ref HEAD 2>/dev/null)"
+       remote="$(git config branch.${branch#refs/heads/}.remote)"
+       remote="${remote:-origin}"
+       remoteurl="$(git config remote.$remote.url)" ||
+               die "remote ($remote) does not have a url in .git/config"
+       url="$1"
+       while test -n "$url"
+       do
+               case "$url" in
+               ../*)
+                       url="${url#../}"
+                       remoteurl="${remoteurl%/*}"
+                       ;;
+               ./*)
+                       url="${url#./}"
+                       ;;
+               *)
+                       break;;
+               esac
+       done
+       echo "$remoteurl/$url"
+}
+
 #
 # Map submodule path to submodule name
 #
@@ -103,11 +129,19 @@ module_add()
                usage
        fi
 
-       # Turn the source into an absolute path if
-       # it is local
-       if base=$(get_repo_base "$repo"); then
-               repo="$base"
-       fi
+       case "$repo" in
+       ./*|../*)
+               # dereference source url relative to parent's url
+               realrepo="$(resolve_relative_url $repo)" ;;
+       *)
+               # Turn the source into an absolute path if
+               # it is local
+               if base=$(get_repo_base "$repo"); then
+                       repo="$base"
+                       realrepo=$repo
+               fi
+               ;;
+       esac
 
        # Guess path from repo if not specified or strip trailing slashes
        if test -z "$path"; then
@@ -122,7 +156,7 @@ module_add()
        git ls-files --error-unmatch "$path" > /dev/null 2>&1 &&
        die "'$path' already exists in the index"
 
-       module_clone "$path" "$repo" || exit
+       module_clone "$path" "$realrepo" || exit
        (unset GIT_DIR && cd "$path" && git checkout -q ${branch:+-b "$branch" "origin/$branch"}) ||
        die "Unable to checkout submodule '$path'"
        git add "$path" ||
@@ -153,6 +187,13 @@ modules_init()
                test -z "$url" &&
                die "No url found for submodule path '$path' in .gitmodules"
 
+               # Possibly a url relative to parent
+               case "$url" in
+               ./*|../*)
+                       url="$(resolve_relative_url "$url")"
+                       ;;
+               esac
+
                git config submodule."$name".url "$url" ||
                die "Failed to register url for submodule path '$path'"
 
index aa5b3b2c9700d9a3cfe79011499405b67da6b33e..ea8c1b2f605c3d34f12357538f0f86848b15f078 100755 (executable)
@@ -54,6 +54,7 @@ END
 my $project_name = $opt_P || "";
 $project_name = "/" . $project_name if ($project_name);
 my $repack_after = $opt_R || 1000;
+my $root_pool = SVN::Pool->new_default;
 
 @ARGV == 1 or @ARGV == 2 or usage();
 
@@ -132,7 +133,7 @@ sub conn {
        my $auth = SVN::Core::auth_open ([SVN::Client::get_simple_provider,
                          SVN::Client::get_ssl_server_trust_file_provider,
                          SVN::Client::get_username_provider]);
-       my $s = SVN::Ra->new(url => $repo, auth => $auth);
+       my $s = SVN::Ra->new(url => $repo, auth => $auth, pool => $root_pool);
        die "SVN connection to $repo: $!\n" unless defined $s;
        $self->{'svn'} = $s;
        $self->{'repo'} = $repo;
@@ -147,11 +148,10 @@ sub file {
 
        print "... $rev $path ...\n" if $opt_v;
        my (undef, $properties);
-       my $pool = SVN::Pool->new();
        $path =~ s#^/*##;
+       my $subpool = SVN::Pool::new_default_sub;
        eval { (undef, $properties)
-                  = $self->{'svn'}->get_file($path,$rev,$fh,$pool); };
-       $pool->clear;
+                  = $self->{'svn'}->get_file($path,$rev,$fh); };
        if($@) {
                return undef if $@ =~ /Attempted to get checksum/;
                die $@;
@@ -185,6 +185,7 @@ sub ignore {
 
        print "... $rev $path ...\n" if $opt_v;
        $path =~ s#^/*##;
+       my $subpool = SVN::Pool::new_default_sub;
        my (undef,undef,$properties)
            = $self->{'svn'}->get_dir($path,$rev,undef);
        if (exists $properties->{'svn:ignore'}) {
@@ -202,6 +203,7 @@ sub ignore {
 sub dir_list {
        my($self,$path,$rev) = @_;
        $path =~ s#^/*##;
+       my $subpool = SVN::Pool::new_default_sub;
        my ($dirents,undef,$properties)
            = $self->{'svn'}->get_dir($path,$rev,undef);
        return $dirents;
@@ -358,10 +360,9 @@ ($$)
 
 sub node_kind($$) {
        my ($svnpath, $revision) = @_;
-       my $pool=SVN::Pool->new;
        $svnpath =~ s#^/*##;
-       my $kind = $svn->{'svn'}->check_path($svnpath,$revision,$pool);
-       $pool->clear;
+       my $subpool = SVN::Pool::new_default_sub;
+       my $kind = $svn->{'svn'}->check_path($svnpath,$revision);
        return $kind;
 }
 
@@ -889,7 +890,7 @@ sub commit_all {
        # Recursive use of the SVN connection does not work
        local $svn = $svn2;
 
-       my ($changed_paths, $revision, $author, $date, $message, $pool) = @_;
+       my ($changed_paths, $revision, $author, $date, $message) = @_;
        my %p;
        while(my($path,$action) = each %$changed_paths) {
                $p{$path} = [ $action->action,$action->copyfrom_path, $action->copyfrom_rev, $path ];
@@ -925,14 +926,14 @@ sub commit_all {
 my $from_rev;
 my $to_rev = $current_rev - 1;
 
+my $subpool = SVN::Pool::new_default_sub;
 while ($to_rev < $opt_l) {
+       $subpool->clear;
        $from_rev = $to_rev + 1;
        $to_rev = $from_rev + $repack_after;
        $to_rev = $opt_l if $opt_l < $to_rev;
        print "Fetching from $from_rev to $to_rev ...\n" if $opt_v;
-       my $pool=SVN::Pool->new;
-       $svn->{'svn'}->get_log("/",$from_rev,$to_rev,0,1,1,\&commit_all,$pool);
-       $pool->clear;
+       $svn->{'svn'}->get_log("/",$from_rev,$to_rev,0,1,1,\&commit_all);
        my $pid = fork();
        die "Fork: $!\n" unless defined $pid;
        unless($pid) {
index 33d092c3c4b4c08fb6f39228e464219df4cb4f1c..658471385cfaa2480ee78b19fe38fc51d9b51ab2 100644 (file)
@@ -1209,8 +1209,6 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, const ch
 
                        opts = diff_opt_parse(&revs->diffopt, argv+i, argc-i);
                        if (opts > 0) {
-                               if (strcmp(argv[i], "-z"))
-                                       revs->diff = 1;
                                i += opts - 1;
                                continue;
                        }
@@ -1254,6 +1252,14 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, const ch
                add_pending_object_with_mode(revs, object, def, mode);
        }
 
+       /* Did the user ask for any diff output? Run the diff! */
+       if (revs->diffopt.output_format & ~DIFF_FORMAT_NO_OUTPUT)
+               revs->diff = 1;
+
+       /* Pickaxe needs diffs */
+       if (revs->diffopt.pickaxe)
+               revs->diff = 1;
+
        if (revs->topo_order)
                revs->limited = 1;
 
diff --git a/t/t5505-remote.sh b/t/t5505-remote.sh
new file mode 100755 (executable)
index 0000000..636aec2
--- /dev/null
@@ -0,0 +1,100 @@
+#!/bin/sh
+
+test_description='git remote porcelain-ish'
+
+. ./test-lib.sh
+
+GIT_CONFIG=.git/config
+export GIT_CONFIG
+
+setup_repository () {
+       mkdir "$1" && (
+       cd "$1" &&
+       git init &&
+       >file &&
+       git add file &&
+       git commit -m "Initial" &&
+       git checkout -b side &&
+       >elif &&
+       git add elif &&
+       git commit -m "Second" &&
+       git checkout master
+       )
+}
+
+tokens_match () {
+       echo "$1" | tr ' ' '\012' | sort | sed -e '/^$/d' >expect &&
+       echo "$2" | tr ' ' '\012' | sort | sed -e '/^$/d' >actual &&
+       diff -u expect actual
+}
+
+check_remote_track () {
+       actual=$(git remote show "$1" | sed -n -e '$p') &&
+       shift &&
+       tokens_match "$*" "$actual"
+}
+
+check_tracking_branch () {
+       f="" &&
+       r=$(git for-each-ref "--format=%(refname)" |
+               sed -ne "s|^refs/remotes/$1/||p") &&
+       shift &&
+       tokens_match "$*" "$r"
+}
+
+test_expect_success setup '
+
+       setup_repository one &&
+       setup_repository two &&
+       (
+               cd two && git branch another
+       ) &&
+       git clone one test
+
+'
+
+test_expect_success 'remote information for the origin' '
+(
+       cd test &&
+       tokens_match origin "$(git remote)" &&
+       check_remote_track origin master side &&
+       check_tracking_branch origin HEAD master side
+)
+'
+
+test_expect_success 'add another remote' '
+(
+       cd test &&
+       git remote add -f second ../two &&
+       tokens_match "origin second" "$(git remote)" &&
+       check_remote_track origin master side &&
+       check_remote_track second master side another &&
+       check_tracking_branch second master side another &&
+       git for-each-ref "--format=%(refname)" refs/remotes |
+       sed -e "/^refs\/remotes\/origin\//d" \
+           -e "/^refs\/remotes\/second\//d" >actual &&
+       >expect &&
+       diff -u expect actual
+)
+'
+
+test_expect_success 'remove remote' '
+(
+       cd test &&
+       git remote rm second
+)
+'
+
+test_expect_success 'remove remote' '
+(
+       cd test &&
+       tokens_match origin "$(git remote)" &&
+       check_remote_track origin master side &&
+       git for-each-ref "--format=%(refname)" refs/remotes |
+       sed -e "/^refs\/remotes\/origin\//d" >actual &&
+       >expect &&
+       diff -u expect actual
+)
+'
+
+test_done
index 622ea1c0df1cdfcbabcd9a884abe151c4d0dff53..5aac644223cf217255a0fdbbb1238b4125fd2e6e 100755 (executable)
@@ -140,6 +140,7 @@ test_expect_success 'test show-ignore' "
        cd test_wc &&
        mkdir -p deeply/nested/directory &&
        svn add deeply &&
+       svn up &&
        svn propset -R svn:ignore 'no-such-file*' .
        svn commit -m 'propset svn:ignore'
        cd .. &&
index d8f9cab35dcff89469f1974dcc7130e3d38f471e..7ba76309ac9e57f9e5379bf93ecac4e6a4e4ad96 100755 (executable)
@@ -19,8 +19,7 @@ test_expect_success 'initialize repo' "
        poke trunk/readme &&
        svn commit -m 'another commit' &&
        svn up &&
-       svn mv -m 'rename to thunk' trunk thunk &&
-       svn up &&
+       svn mv trunk thunk &&
        echo goodbye >> thunk/readme &&
        poke thunk/readme &&
        svn commit -m 'bye now' &&
@@ -52,8 +51,10 @@ test_expect_success 'init and fetch from one svn-remote' "
         "
 
 test_expect_success 'follow deleted parent' "
-        svn cp -m 'resurrecting trunk as junk' \
-               -r2 $svnrepo/trunk $svnrepo/junk &&
+        (svn cp -m 'resurrecting trunk as junk' \
+               $svnrepo/trunk@2 $svnrepo/junk ||
+         svn cp -m 'resurrecting trunk as junk' \
+               -r2 $svnrepo/trunk $svnrepo/junk) &&
         git config --add svn-remote.svn.fetch \
           junk:refs/remotes/svn/junk &&
         git-svn fetch -i svn/thunk &&