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
This commit is contained in:
Junio C Hamano 2008-12-07 15:13:02 -08:00
commit 3a59bb22db
5 changed files with 55 additions and 31 deletions

View File

@ -4,40 +4,53 @@ GIT v1.6.0.5 Release Notes
Fixes since v1.6.0.4 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. 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. 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. 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. 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 option when a single first object already busted the given limit and
placed many objects in a single pack. 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 logic, even on a keyword-looking string that does not have closing '$' on the
same line. 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. 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 * "git tag" did not complain when given mutually incompatible set of options.
'make test' instead, so suggest that.
* 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.
* "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.
* "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. * Many unsafe call to sprintf() style varargs functions are corrected.
* Also contains quite a few documentation updates. * Also contains quite a few documentation updates.
--
O=v1.6.0.4-39-g27f6496

View File

@ -780,7 +780,8 @@ struct ref *fetch_pack(struct fetch_pack_args *my_args,
struct ref *ref_cpy; struct ref *ref_cpy;
fetch_pack_setup(); fetch_pack_setup();
memcpy(&args, my_args, sizeof(args)); if (&args != my_args)
memcpy(&args, my_args, sizeof(args));
if (args.depth > 0) { if (args.depth > 0) {
if (stat(git_path("shallow"), &st)) if (stat(git_path("shallow"), &st))
st.st_mtime = 0; st.st_mtime = 0;

View File

@ -253,6 +253,15 @@ static void write_tag_body(int fd, const unsigned char *sha1)
free(buf); 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, static void create_tag(const unsigned char *object, const char *tag,
struct strbuf *buf, int message, int sign, struct strbuf *buf, int message, int sign,
unsigned char *prev, unsigned char *result) 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; enum object_type type;
char header_buf[1024]; char header_buf[1024];
int header_len; int header_len;
char *path = NULL;
type = sha1_object_info(object, NULL); type = sha1_object_info(object, NULL);
if (type <= OBJ_NONE) if (type <= OBJ_NONE)
@ -279,7 +289,6 @@ static void create_tag(const unsigned char *object, const char *tag,
die("tag header too big."); die("tag header too big.");
if (!message) { if (!message) {
char *path;
int fd; int fd;
/* write the template message before editing: */ /* 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"); "Please supply the message using either -m or -F option.\n");
exit(1); exit(1);
} }
unlink(path);
free(path);
} }
stripspace(buf, 1); 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); strbuf_insert(buf, 0, header_buf, header_len);
if (sign && do_sign(buf) < 0) if (build_tag_object(buf, sign, result) < 0) {
die("unable to sign the tag"); if (path)
if (write_sha1_file(buf->buf, buf->len, tag_type, result) < 0) fprintf(stderr, "The tag message has been left in %s\n",
die("unable to write tag file"); path);
exit(128);
}
if (path) {
unlink(path);
free(path);
}
} }
struct msg_arg { struct msg_arg {

View File

@ -241,6 +241,7 @@ our %feature = (
# $feature{'grep'}{'override'} = 1; # $feature{'grep'}{'override'} = 1;
# and in project config gitweb.grep = 0|1; # and in project config gitweb.grep = 0|1;
'grep' => { 'grep' => {
'sub' => \&feature_grep,
'override' => 0, 'override' => 0,
'default' => [1]}, 'default' => [1]},

11
http.c
View File

@ -24,7 +24,7 @@ static const char *ssl_cainfo = NULL;
static long curl_low_speed_limit = -1; static long curl_low_speed_limit = -1;
static long curl_low_speed_time = -1; static long curl_low_speed_time = -1;
static int curl_ftp_no_epsv = 0; 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; static struct curl_slist *pragma_header;
@ -149,11 +149,8 @@ static int http_options(const char *var, const char *value, void *cb)
return 0; return 0;
} }
if (!strcmp("http.proxy", var)) { if (!strcmp("http.proxy", var)) {
if (curl_http_proxy == NULL) { if (curl_http_proxy == NULL)
if (!value) return git_config_string(&curl_http_proxy, var, value);
return config_error_nonbool(var);
curl_http_proxy = xstrdup(value);
}
return 0; return 0;
} }
@ -309,7 +306,7 @@ void http_cleanup(void)
pragma_header = NULL; pragma_header = NULL;
if (curl_http_proxy) { if (curl_http_proxy) {
free(curl_http_proxy); free((void *)curl_http_proxy);
curl_http_proxy = NULL; curl_http_proxy = NULL;
} }
} }