Merge branch 'aw/maint-shortlog-blank-lines' into maint
authorJunio C Hamano <gitster@pobox.com>
Tue, 11 Mar 2008 07:37:38 +0000 (00:37 -0700)
committerJunio C Hamano <gitster@pobox.com>
Tue, 11 Mar 2008 07:37:38 +0000 (00:37 -0700)
* aw/maint-shortlog-blank-lines:
shortlog: take the first populated line of the description

22 files changed:
Documentation/RelNotes-1.5.4.4.txt
Documentation/config.txt
Documentation/git-pull.txt
GIT-VERSION-GEN
builtin-http-fetch.c
daemon.c
fast-import.c
git-cvsexportcommit.perl
git-gui/Makefile
git-svn.perl
http-push.c
http-walker.c
http.c
http.h
ident.c
quote.c
revision.c
t/t9200-git-cvsexportcommit.sh
t/t9300-fast-import.sh
t/test-lib.sh
transport.c
walker.h
index 5635977c93b68b59f95c78058fecd8bd234b2693..89fa6d03bc038d6210e94d7fe9fbbffdbc84d883 100644 (file)
@@ -37,10 +37,30 @@ Fixes since v1.5.4.3
  * "git revert" did not properly fail when attempting to run with a
    dirty index.
 
-Also included are a handful documentation updates.
+ * "git merge --no-commit --no-ff <other>" incorrectly made commits.
+
+ * "git merge --squash --no-ff <other>", which is a nonsense combination
+   of options, was not rejected.
+
+ * "git ls-remote" and "git remote show" against an empty repository
+   failed, instead of just giving an empty result (regression).
+
+ * "git fast-import" did not handle a renamed path whose name needs to be
+   quoted, due to a bug in unquote_c_style() function.
+
+ * "git cvsexportcommit" was confused when multiple files with the same
+   basename needed to be pushed out in the same commit.
+
+ * "git daemon" did not send early errors to syslog.
 
----
-exec >/var/tmp/1
-echo O=$(git describe maint)
-O=v1.5.4.3-32-g0f2d447
-git shortlog --no-merges $O..maint
+ * "git log --merge" did not work well with --left-right option.
+
+ * "git svn" promprted for client cert password every time it accessed the
+   server.
+
+ * The reset command in "git fast-import" data stream was documented to
+   end with an optional LF, but it actually required one.
+
+ * "git svn dcommit/rebase" did not honor --rewrite-root option.
+
+Also included are a handful documentation updates.
index 6d8cca46ab934826a84647cbd6e441fee286f330..531ec46e957f85af2dfad69461ba81990500289e 100644 (file)
@@ -796,15 +796,15 @@ remote.<name>.skipDefaultUpdate::
 
 remote.<name>.receivepack::
        The default program to execute on the remote side when pushing.  See
-       option \--exec of linkgit:git-push[1].
+       option \--receive-pack of linkgit:git-push[1].
 
 remote.<name>.uploadpack::
        The default program to execute on the remote side when fetching.  See
-       option \--exec of linkgit:git-fetch-pack[1].
+       option \--upload-pack of linkgit:git-fetch-pack[1].
 
 remote.<name>.tagopt::
-       Setting this value to --no-tags disables automatic tag following when fetching
-       from remote <name>
+       Setting this value to \--no-tags disables automatic tag following when
+       fetching from remote <name>
 
 remotes.<group>::
        The list of remotes which are fetched by "git remote update
index 179bdfc69ddfeff9d272ec309721e4098f3b051e..f7b90a326f8e244c2c9df286bb63afc655c67318 100644 (file)
@@ -20,6 +20,8 @@ Note that you can use `.` (current directory) as the
 <repository> to pull from the local repository -- this is useful
 when merging local branches into the current branch.
 
+Also note that options meant for `git-pull` itself and underlying
+`git-merge` must be given before the options meant for `git-fetch`.
 
 OPTIONS
 -------
index 0d4c2f79c58a2141dc5d5d6998f7ab2a2fa31881..33dc1ab222d6199b57f87594a6521f224f2d4210 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 GVF=GIT-VERSION-FILE
-DEF_VER=v1.5.4.3.GIT
+DEF_VER=v1.5.4.4.GIT
 
 LF='
 '
index 7f450c61d95945862fc44bec99859a229269b224..48128c610e4b36789efbe16fb974b2f3389093ff 100644 (file)
@@ -59,7 +59,7 @@ int cmd_http_fetch(int argc, const char **argv, const char *prefix)
                url = rewritten_url;
        }
 
-       walker = get_http_walker(url);
+       walker = get_http_walker(url, NULL);
        walker->get_tree = get_tree;
        walker->get_history = get_history;
        walker->get_all = get_all;
index 41a60af624ae661e9bd96a935ecdc855625b669e..2b4a6f145cc0f37c95da31df23dfde3ba7fa63a7 100644 (file)
--- a/daemon.c
+++ b/daemon.c
@@ -1149,6 +1149,11 @@ int main(int argc, char **argv)
                usage(daemon_usage);
        }
 
+       if (log_syslog) {
+               openlog("git-daemon", 0, LOG_DAEMON);
+               set_die_routine(daemon_die);
+       }
+
        if (inetd_mode && (group_name || user_name))
                die("--user and --group are incompatible with --inetd");
 
@@ -1176,14 +1181,17 @@ int main(int argc, char **argv)
                }
        }
 
-       if (log_syslog) {
-               openlog("git-daemon", 0, LOG_DAEMON);
-               set_die_routine(daemon_die);
-       }
-
        if (strict_paths && (!ok_paths || !*ok_paths))
                die("option --strict-paths requires a whitelist");
 
+       if (base_path) {
+               struct stat st;
+
+               if (stat(base_path, &st) || !S_ISDIR(st.st_mode))
+                       die("base-path '%s' does not exist or "
+                           "is not a directory", base_path);
+       }
+
        if (inetd_mode) {
                struct sockaddr_storage ss;
                struct sockaddr *peer = (struct sockaddr *)&ss;
index 9b71ccc479352c6a37b9b9652f1cb1793fdbb01b..32ec159915611f6a21c218969bf82a09b6720c48 100644 (file)
@@ -2261,7 +2261,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;
 }
 
index 2a8ad1e9f4cbc2c21b83fd72fae1e0d2e582fbdc..b6036bd4d305215b4a70b6fd0fe54d7607dbe068 100755 (executable)
       my @updated = xargs_safe_pipe_capture([@cvs, 'update'], @canstatusfiles);
       print @updated;
     }
-    my @cvsoutput;
-    @cvsoutput = xargs_safe_pipe_capture([@cvs, 'status'], @canstatusfiles);
-    my $matchcount = 0;
-    foreach my $l (@cvsoutput) {
-        chomp $l;
-        if ( $l =~ /^File:/ and  $l =~ /Status: (.*)$/ ) {
-            $cvsstat{$canstatusfiles[$matchcount]} = $1;
-            $matchcount++;
+    # "cvs status" reorders the parameters, notably when there are multiple
+    # arguments with the same basename.  So be precise here.
+
+    my %added = map { $_ => 1 } @afiles;
+    my %todo = map { $_ => 1 } @canstatusfiles;
+
+    while (%todo) {
+      my @canstatusfiles2 = ();
+      my %fullname = ();
+      foreach my $name (keys %todo) {
+       my $basename = basename($name);
+
+       $basename = "no file " . $basename if (exists($added{$basename}));
+       chomp($basename);
+
+       if (!exists($fullname{$basename})) {
+         $fullname{$basename} = $name;
+         push (@canstatusfiles2, $name);
+         delete($todo{$name});
         }
+      }
+      my @cvsoutput;
+      @cvsoutput = xargs_safe_pipe_capture([@cvs, 'status'], @canstatusfiles2);
+      foreach my $l (@cvsoutput) {
+        chomp $l;
+        if ($l =~ /^File:\s+(.*\S)\s+Status: (.*)$/) {
+         if (!exists($fullname{$1})) {
+           print STDERR "Huh? Status reported for unexpected file '$1'\n";
+         } else {
+           $cvsstat{$fullname{$1}} = $2;
+         }
+       }
+      }
     }
 }
 
index 01e0a46ba56faa8a17ed8710346b18dd215899c7..4e321742ab8f103d829f33ab4d6ab5430fa132ba 100644 (file)
@@ -224,6 +224,11 @@ else
        ifeq ($(shell $(MSGFMT) >/dev/null 2>&1 || echo $$?),127)
                MSGFMT := $(TCL_PATH) po/po2msg.sh
        endif
+       ifeq (msgfmt,$(MSGFMT))
+       ifeq ($(shell $(MSGFMT) --tcl -l C -d . /dev/null 2>/dev/null || echo $?),1)
+               MSGFMT := $(TCL_PATH) po/po2msg.sh
+       endif
+       endif
 endif
 
 msgsdir     = $(gg_libdir)/msgs
index 75e97cc72fb7906f098717797eb1ac0303ef2a19..29f39c0831227a2a7c7b482cdf8277e95cf63245 100755 (executable)
@@ -1535,9 +1535,14 @@ sub find_by_url { # repos_root and, path are optional
                                            $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;
@@ -3632,6 +3637,7 @@ ()
          SVN::Client::get_ssl_client_cert_file_provider(),
          SVN::Client::get_ssl_client_cert_prompt_provider(
            \&Git::SVN::Prompt::ssl_client_cert, 2),
+         SVN::Client::get_ssl_client_cert_pw_file_provider(),
          SVN::Client::get_ssl_client_cert_pw_prompt_provider(
            \&Git::SVN::Prompt::ssl_client_cert_pw, 2),
          SVN::Client::get_username_provider(),
index f9b77d6021cf8df4b4d7a7a1efea3e63b5dcb477..e3e34decd2d4bf3443a00026a5c63c9f93f38802 100644 (file)
@@ -2240,7 +2240,7 @@ int main(int argc, char **argv)
 
        memset(remote_dir_exists, -1, 256);
 
-       http_init();
+       http_init(NULL);
 
        no_pragma_header = curl_slist_append(no_pragma_header, "Pragma:");
 
index 2c3786870e1fbe94a5346cdbc53e6f806011052c..7bda34d91498c3959569327ea2132851230999e7 100644 (file)
@@ -902,13 +902,13 @@ static void cleanup(struct walker *walker)
        curl_slist_free_all(data->no_pragma_header);
 }
 
-struct walker *get_http_walker(const char *url)
+struct walker *get_http_walker(const char *url, struct remote *remote)
 {
        char *s;
        struct walker_data *data = xmalloc(sizeof(struct walker_data));
        struct walker *walker = xmalloc(sizeof(struct walker));
 
-       http_init();
+       http_init(remote);
 
        data->no_pragma_header = curl_slist_append(NULL, "Pragma:");
 
diff --git a/http.c b/http.c
index c7deccb6de6a8a57a2fb57734f05d6ffdc6ae9dc..256a5f15f40a8d9389560e1fb08e34a56e9f7140 100644 (file)
--- a/http.c
+++ b/http.c
@@ -218,13 +218,16 @@ static CURL* get_curl_handle(void)
        return result;
 }
 
-void http_init(void)
+void http_init(struct remote *remote)
 {
        char *low_speed_limit;
        char *low_speed_time;
 
        curl_global_init(CURL_GLOBAL_ALL);
 
+       if (remote && remote->http_proxy)
+               curl_http_proxy = xstrdup(remote->http_proxy);
+
        pragma_header = curl_slist_append(pragma_header, "Pragma: no-cache");
 
 #ifdef USE_CURL_MULTI
@@ -306,6 +309,11 @@ void http_cleanup(void)
 
        curl_slist_free_all(pragma_header);
        pragma_header = NULL;
+
+       if (curl_http_proxy) {
+               free(curl_http_proxy);
+               curl_http_proxy = NULL;
+       }
 }
 
 struct active_request_slot *get_active_slot(void)
diff --git a/http.h b/http.h
index 9bab2c88210650e2aaa271a72eb7192cd2f7331b..04169d5f9c8fa4cb82ad720b9e6d371f02be83d3 100644 (file)
--- a/http.h
+++ b/http.h
@@ -7,6 +7,7 @@
 #include <curl/easy.h>
 
 #include "strbuf.h"
+#include "remote.h"
 
 /*
  * We detect based on the cURL version if multi-transfer is
@@ -83,7 +84,7 @@ extern void add_fill_function(void *data, int (*fill)(void *));
 extern void step_active_slots(void);
 #endif
 
-extern void http_init(void);
+extern void http_init(struct remote *remote);
 extern void http_cleanup(void);
 
 extern int data_received;
diff --git a/ident.c b/ident.c
index b839dcf5f085a94080e1f7891f3fb40ed151a394..ed44a5345a47d4843e8328c0f879ac925dde2b07 100644 (file)
--- a/ident.c
+++ b/ident.c
@@ -171,7 +171,7 @@ static const char au_env[] = "GIT_AUTHOR_NAME";
 static const char co_env[] = "GIT_COMMITTER_NAME";
 static const char *env_hint =
 "\n"
-"*** Your name cannot be determined from your system services (gecos).\n"
+"*** Please tell me who you are.\n"
 "\n"
 "Run\n"
 "\n"
diff --git a/quote.c b/quote.c
index d061626c34f1e62c538db6e931c29751be4fdbcf..40702f6b725efade3e1fd61339421940f9fdb47d 100644 (file)
--- a/quote.c
+++ b/quote.c
@@ -288,7 +288,7 @@ int unquote_c_style(struct strbuf *sb, const char *quoted, const char **endp)
                switch (*quoted++) {
                  case '"':
                        if (endp)
-                               *endp = quoted + 1;
+                               *endp = quoted;
                        return 0;
                  case '\\':
                        break;
index 6e85aaa3fb30e98f3b02f094af7f1763577cdb8d..a399f27144bbabe3ee942408cdb90398990c3c85 100644 (file)
@@ -749,14 +749,9 @@ static void prepare_show_merge(struct rev_info *revs)
        add_pending_object(revs, &head->object, "HEAD");
        add_pending_object(revs, &other->object, "MERGE_HEAD");
        bases = get_merge_bases(head, other, 1);
-       while (bases) {
-               struct commit *it = bases->item;
-               struct commit_list *n = bases->next;
-               free(bases);
-               bases = n;
-               it->object.flags |= UNINTERESTING;
-               add_pending_object(revs, &it->object, "(merge-base)");
-       }
+       add_pending_commit_list(revs, bases, UNINTERESTING);
+       free_commit_list(bases);
+       head->object.flags |= SYMMETRIC_LEFT;
 
        if (!active_nr)
                read_cache();
@@ -775,6 +770,7 @@ static void prepare_show_merge(struct rev_info *revs)
                        i++;
        }
        revs->prune_data = prune;
+       revs->limited = 1;
 }
 
 int handle_revision_arg(const char *arg, struct rev_info *revs,
index 49d57a81ec1cc55f83fb63436631dfdc7d647e0b..58c59ed5ae0159810b4c8258f9182991bad33636 100755 (executable)
@@ -262,4 +262,39 @@ test_expect_success '-w option should work with relative GIT_DIR' '
       )
 '
 
+test_expect_success 'check files before directories' '
+
+       echo Notes > release-notes &&
+       git add release-notes &&
+       git commit -m "Add release notes" release-notes &&
+       id=$(git rev-parse HEAD) &&
+       git cvsexportcommit -w "$CVSWORK" -c $id &&
+
+       echo new > DS &&
+       echo new > E/DS &&
+       echo modified > release-notes &&
+       git add DS E/DS release-notes &&
+       git commit -m "Add two files with the same basename" &&
+       id=$(git rev-parse HEAD) &&
+       git cvsexportcommit -w "$CVSWORK" -c $id &&
+       check_entries "$CVSWORK/E" "DS/1.1/|newfile5.txt/1.1/" &&
+       check_entries "$CVSWORK" "DS/1.1/|release-notes/1.2/" &&
+       diff -u "$CVSWORK/DS" DS &&
+       diff -u "$CVSWORK/E/DS" E/DS &&
+       diff -u "$CVSWORK/release-notes" release-notes
+
+'
+
+test_expect_success 'commit a file with leading spaces in the name' '
+
+       echo space > " space" &&
+       git add " space" &&
+       git commit -m "Add a file with a leading space" &&
+       id=$(git rev-parse HEAD) &&
+       git cvsexportcommit -w "$CVSWORK" -c $id &&
+       check_entries "$CVSWORK" " space/1.1/|DS/1.1/|release-notes/1.2/" &&
+       diff -u "$CVSWORK/ space" " space"
+
+'
+
 test_done
index 0595041af5d310f905306c6a289945cde26d88fc..142d42f3b3f41adc99ada33d5ccac50739fb8a69 100755 (executable)
@@ -869,6 +869,8 @@ zcommits
 COMMIT
 reset refs/tags/O3-2nd
 from :5
+reset refs/tags/O3-3rd
+from :5
 INPUT_END
 
 cat >expect <<INPUT_END
index c0c5e21adfebba8fc82a0d5308eb04c59c33aece..44f5776a1b30895e8d7b2d0601c8edc677790eeb 100644 (file)
@@ -3,12 +3,16 @@
 # Copyright (c) 2005 Junio C Hamano
 #
 
+# Keep the original TERM for say_color
+ORIGINAL_TERM=$TERM
+
 # For repeatability, reset the environment to known value.
 LANG=C
 LC_ALL=C
 PAGER=cat
 TZ=UTC
-export LANG LC_ALL PAGER TZ
+TERM=dumb
+export LANG LC_ALL PAGER TERM TZ
 EDITOR=:
 VISUAL=:
 unset GIT_EDITOR
@@ -58,12 +62,14 @@ esac
 # This test checks if command xyzzy does the right thing...
 # '
 # . ./test-lib.sh
-
-[ "x$TERM" != "xdumb" ] &&
-       [ -t 1 ] &&
-       tput bold >/dev/null 2>&1 &&
-       tput setaf 1 >/dev/null 2>&1 &&
-       tput sgr0 >/dev/null 2>&1 &&
+[ "x$ORIGINAL_TERM" != "xdumb" ] && (
+               TERM=$ORIGINAL_TERM &&
+               export TERM &&
+               [ -t 1 ] &&
+               tput bold >/dev/null 2>&1 &&
+               tput setaf 1 >/dev/null 2>&1 &&
+               tput sgr0 >/dev/null 2>&1
+       ) &&
        color=t
 
 while test "$#" -ne 0
@@ -91,6 +97,9 @@ done
 
 if test -n "$color"; then
        say_color () {
+               (
+               TERM=$ORIGINAL_TERM
+               export TERM
                case "$1" in
                        error) tput bold; tput setaf 1;; # bold red
                        skip)  tput bold; tput setaf 2;; # bold green
@@ -101,6 +110,7 @@ if test -n "$color"; then
                shift
                echo "* $*"
                tput sgr0
+               )
        }
 else
        say_color() {
index 497f85372173f6f270a4c0ee9474f165bb884413..97c59dce60eb01382bdd10e4d20cc476fd489cf0 100644 (file)
@@ -442,7 +442,8 @@ static struct ref *get_refs_via_curl(struct transport *transport)
        struct ref *last_ref = NULL;
 
        if (!transport->data)
-               transport->data = get_http_walker(transport->url);
+               transport->data = get_http_walker(transport->url,
+                                               transport->remote);
 
        refs_url = xmalloc(strlen(transport->url) + 11);
        sprintf(refs_url, "%s/info/refs", transport->url);
@@ -453,9 +454,6 @@ static struct ref *get_refs_via_curl(struct transport *transport)
        curl_easy_setopt(slot->curl, CURLOPT_WRITEFUNCTION, fwrite_buffer);
        curl_easy_setopt(slot->curl, CURLOPT_URL, refs_url);
        curl_easy_setopt(slot->curl, CURLOPT_HTTPHEADER, NULL);
-       if (transport->remote->http_proxy)
-               curl_easy_setopt(slot->curl, CURLOPT_PROXY,
-                                transport->remote->http_proxy);
 
        if (start_active_slot(slot)) {
                run_active_slot(slot);
@@ -509,7 +507,8 @@ static int fetch_objs_via_curl(struct transport *transport,
                                 int nr_objs, struct ref **to_fetch)
 {
        if (!transport->data)
-               transport->data = get_http_walker(transport->url);
+               transport->data = get_http_walker(transport->url,
+                                               transport->remote);
        return fetch_objs_via_walker(transport, nr_objs, to_fetch);
 }
 
index ea2c363f4ee4fe548dc405afe547d6dd71d76714..e1d40deaffa5965b1edd381a610ab225e027e3b2 100644 (file)
--- a/walker.h
+++ b/walker.h
@@ -1,6 +1,8 @@
 #ifndef WALKER_H
 #define WALKER_H
 
+#include "remote.h"
+
 struct walker {
        void *data;
        int (*fetch_ref)(struct walker *, char *ref, unsigned char *sha1);
@@ -32,6 +34,6 @@ int walker_fetch(struct walker *impl, int targets, char **target,
 
 void walker_free(struct walker *walker);
 
-struct walker *get_http_walker(const char *url);
+struct walker *get_http_walker(const char *url, struct remote *remote);
 
 #endif /* WALKER_H */