Commits

Anonymous committed 3a59bb2 Merge

Merge branch 'maint'

* 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

Comments (0)

Files changed (5)

Documentation/RelNotes-1.6.0.5.txt

 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.

builtin-fetch-pack.c

 	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;
 	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)
 	enum object_type type;
 	char header_buf[1024];
 	int header_len;
+	char *path = NULL;
 
 	type = sha1_object_info(object, NULL);
 	if (type <= OBJ_NONE)
 		die("tag header too big.");
 
 	if (!message) {
-		char *path;
 		int fd;
 
 		/* write the template message before editing: */
 			"Please supply the message using either -m or -F option.\n");
 			exit(1);
 		}
-
-		unlink(path);
-		free(path);
 	}
 
 	stripspace(buf, 1);
 
 	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 {

gitweb/gitweb.perl

 	# $feature{'grep'}{'override'} = 1;
 	# and in project config gitweb.grep = 0|1;
 	'grep' => {
+		'sub' => \&feature_grep,
 		'override' => 0,
 		'default' => [1]},
 
 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;
 
 		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;
 	}
 
 	pragma_header = NULL;
 
 	if (curl_http_proxy) {
-		free(curl_http_proxy);
+		free((void *)curl_http_proxy);
 		curl_http_proxy = NULL;
 	}
 }