Merge branch 'maint'
authorJunio C Hamano <gitster@pobox.com>
Sun, 7 Dec 2008 23:13:02 +0000 (15:13 -0800)
committerJunio C Hamano <gitster@pobox.com>
Sun, 7 Dec 2008 23:13:02 +0000 (15:13 -0800)
* maint:
GIT 1.6.0.5
"git diff <tree>{3,}": do not reverse order of arguments
tag: delete TAG_EDITMSG only on successful tag
gitweb: Make project specific override for 'grep' feature work
http.c: use 'git_config_string' to get 'curl_http_proxy'
fetch-pack: Avoid memcpy() with src==dst

Documentation/RelNotes-1.6.0.5.txt
builtin-fetch-pack.c
builtin-tag.c
gitweb/gitweb.perl
http.c
index 1dc101c6a3b9e325fe1458ffe9aa8a412abd2eb8..a08bb96738aa11d0aa14b660145142c54a20fb32 100644 (file)
@@ -4,40 +4,53 @@ GIT v1.6.0.5 Release Notes
 Fixes since v1.6.0.4
 --------------------
 
-* 'git checkout' used to crash when your HEAD was pointing at a deleted
+* "git checkout" used to crash when your HEAD was pointing at a deleted
   branch.
 
-* 'git checkout' from an un-checked-out state did not allow switching out
+* "git checkout" from an un-checked-out state did not allow switching out
   of the current branch.
 
-* 'git diff' always allowed GIT_EXTERNAL_DIFF and --no-ext-diff was no-op for
+* "git diff" always allowed GIT_EXTERNAL_DIFF and --no-ext-diff was no-op for
   the command.
 
-* 'git fast-export' did not export all tags.
+* Giving 3 or more tree-ish to "git diff" is supposed to show the combined
+  diff from second and subsequent trees to the first one, but the order was
+  screwed up.
 
-* 'git ls-files --with-tree=<tree>' did not work with options other
+* "git fast-export" did not export all tags.
+
+* "git ls-files --with-tree=<tree>" did not work with options other
   than -c, most notably with -m.
 
-* 'git pack-objects' did not make its best effort to honor --max-pack-size
+* "git pack-objects" did not make its best effort to honor --max-pack-size
   option when a single first object already busted the given limit and
   placed many objects in a single pack.
 
-* 'git-p4' fast import frontend was too eager to trigger its keyword expansion
+* "git-p4" fast import frontend was too eager to trigger its keyword expansion
   logic, even on a keyword-looking string that does not have closing '$' on the
   same line.
 
-* 'git push $there' when the remote $there is defined in $GIT_DIR/branches/$there
+* "git push $there" when the remote $there is defined in $GIT_DIR/branches/$there
   behaves more like what cg-push from Cogito used to work.
 
-* 'git tag' did not complain when given mutually incompatible set of options.
+* when giving up resolving a conflicted merge, "git reset --hard" failed
+  to remove new paths from the working tree.
 
-* 'make check' cannot be run without sparse; people may have meant to say
-  'make test' instead, so suggest that.
+* "git tag" did not complain when given mutually incompatible set of options.
 
-* Many unsafe call to sprintf() style varargs functions are corrected.
+* The message constructed in the internal editor was discarded when "git
+  tag -s" failed to sign the message, which was often caused by the user
+  not configuring GPG correctly.
 
-* Also contains quite a few documentation updates.
+* "make check" cannot be run without sparse; people may have meant to say
+  "make test" instead, so suggest that.
+
+* Internal diff machinery had a corner case performance bug that choked on
+  a large file with many repeated contents.
 
---
-O=v1.6.0.4-39-g27f6496
+* "git repack" used to grab objects out of packs marked with .keep
+  into a new pack.
 
+* Many unsafe call to sprintf() style varargs functions are corrected.
+
+* Also contains quite a few documentation updates.
index 372bfa20a2eac978f7511f5d8d9296be789b527f..67fb80ec48d6d8f0327628afd86fb366d8f97617 100644 (file)
@@ -780,7 +780,8 @@ struct ref *fetch_pack(struct fetch_pack_args *my_args,
        struct ref *ref_cpy;
 
        fetch_pack_setup();
-       memcpy(&args, my_args, sizeof(args));
+       if (&args != my_args)
+               memcpy(&args, my_args, sizeof(args));
        if (args.depth > 0) {
                if (stat(git_path("shallow"), &st))
                        st.st_mtime = 0;
index d339971fab896bda0297f04a4f3961bae27b21be..a3984998915921476a80839a07b133779ece72f3 100644 (file)
@@ -253,6 +253,15 @@ static void write_tag_body(int fd, const unsigned char *sha1)
        free(buf);
 }
 
+static int build_tag_object(struct strbuf *buf, int sign, unsigned char *result)
+{
+       if (sign && do_sign(buf) < 0)
+               return error("unable to sign the tag");
+       if (write_sha1_file(buf->buf, buf->len, tag_type, result) < 0)
+               return error("unable to write tag file");
+       return 0;
+}
+
 static void create_tag(const unsigned char *object, const char *tag,
                       struct strbuf *buf, int message, int sign,
                       unsigned char *prev, unsigned char *result)
@@ -260,6 +269,7 @@ static void create_tag(const unsigned char *object, const char *tag,
        enum object_type type;
        char header_buf[1024];
        int header_len;
+       char *path = NULL;
 
        type = sha1_object_info(object, NULL);
        if (type <= OBJ_NONE)
@@ -279,7 +289,6 @@ static void create_tag(const unsigned char *object, const char *tag,
                die("tag header too big.");
 
        if (!message) {
-               char *path;
                int fd;
 
                /* write the template message before editing: */
@@ -300,9 +309,6 @@ static void create_tag(const unsigned char *object, const char *tag,
                        "Please supply the message using either -m or -F option.\n");
                        exit(1);
                }
-
-               unlink(path);
-               free(path);
        }
 
        stripspace(buf, 1);
@@ -312,10 +318,16 @@ static void create_tag(const unsigned char *object, const char *tag,
 
        strbuf_insert(buf, 0, header_buf, header_len);
 
-       if (sign && do_sign(buf) < 0)
-               die("unable to sign the tag");
-       if (write_sha1_file(buf->buf, buf->len, tag_type, result) < 0)
-               die("unable to write tag file");
+       if (build_tag_object(buf, sign, result) < 0) {
+               if (path)
+                       fprintf(stderr, "The tag message has been left in %s\n",
+                               path);
+               exit(128);
+       }
+       if (path) {
+               unlink(path);
+               free(path);
+       }
 }
 
 struct msg_arg {
index 95988fba4ab743e26b246aa2c22c6e36ef50efaf..951739210a3278802e5ab7eb00bd5d0679deccce 100755 (executable)
@@ -241,6 +241,7 @@ BEGIN
        # $feature{'grep'}{'override'} = 1;
        # and in project config gitweb.grep = 0|1;
        'grep' => {
+               'sub' => \&feature_grep,
                'override' => 0,
                'default' => [1]},
 
diff --git a/http.c b/http.c
index ed59b79709b11dc6f6d85e86d75a1a8883799f21..ee58799ca8cd433218ca7d40946580732a9010e7 100644 (file)
--- a/http.c
+++ b/http.c
@@ -24,7 +24,7 @@ static const char *ssl_cainfo = NULL;
 static long curl_low_speed_limit = -1;
 static long curl_low_speed_time = -1;
 static int curl_ftp_no_epsv = 0;
-static char *curl_http_proxy = NULL;
+static const char *curl_http_proxy = NULL;
 
 static struct curl_slist *pragma_header;
 
@@ -149,11 +149,8 @@ static int http_options(const char *var, const char *value, void *cb)
                return 0;
        }
        if (!strcmp("http.proxy", var)) {
-               if (curl_http_proxy == NULL) {
-                       if (!value)
-                               return config_error_nonbool(var);
-                       curl_http_proxy = xstrdup(value);
-               }
+               if (curl_http_proxy == NULL)
+                       return git_config_string(&curl_http_proxy, var, value);
                return 0;
        }
 
@@ -309,7 +306,7 @@ void http_cleanup(void)
        pragma_header = NULL;
 
        if (curl_http_proxy) {
-               free(curl_http_proxy);
+               free((void *)curl_http_proxy);
                curl_http_proxy = NULL;
        }
 }