Commits

Anonymous committed c63da8d Merge

GIT 1.0.3

Signed-off-by: Junio C Hamano <junkio@cox.net>

  • Participants
  • Parent commits 8d712aa, 1e80e04
  • Tags v1.0.3

Comments (0)

Files changed (9)

 # Define USE_STDEV below if you want git to care about the underlying device
 # change being considered an inode change from the update-cache perspective.
 
-GIT_VERSION = 1.0.0b
+GIT_VERSION = 1.0.3
 
 # CFLAGS and LDFLAGS are for the users to override from the command line.
 
 git-cherry-pick: git-revert
 	cp $< $@
 
+# format-patch records GIT_VERSION
+git-format-patch: Makefile
+
 %.o: %.c
 	$(CC) -o $*.o -c $(ALL_CFLAGS) $<
 %.o: %.S
 			store.value_regex = (regex_t*)malloc(sizeof(regex_t));
 			if (regcomp(store.value_regex, value_regex,
 					REG_EXTENDED)) {
-				fprintf(stderr, "Invalid pattern: %s",
+				fprintf(stderr, "Invalid pattern: %s\n",
 					value_regex);
 				free(store.value_regex);
 				return 6;
+git-core (1.0.3-0) unstable; urgency=low
+
+  * GIT 1.0.3 maintenance release.
+
+ -- Junio C Hamano <junkio@cox.net>  Thu, 22 Dec 2005 18:13:33 -0800
+
 git-core (1.0.0b-0) unstable; urgency=low
 
   * GIT 1.0.0b to include two more fixes.
 	if (*exec_path != '/') {
 		if (!getcwd(git_command, sizeof(git_command))) {
 			fprintf(stderr,
-				"git: cannot determine current directory");
+				"git: cannot determine current directory\n");
 			exit(1);
 		}
 		len = strlen(git_command);
 	obj_req->state = COMPLETE;
 
 	/* Use alternates if necessary */
-	if (obj_req->http_code == 404) {
+	if (obj_req->http_code == 404 ||
+	    obj_req->curl_result == CURLE_FILE_COULDNT_READ_FILE) {
 		fetch_alternates(alt->base);
 		if (obj_req->repo->next != NULL) {
 			obj_req->repo =
 			}
 		}
 	} else if (slot->curl_result != CURLE_OK) {
-		if (slot->http_code != 404) {
+		if (slot->http_code != 404 &&
+		    slot->curl_result != CURLE_FILE_COULDNT_READ_FILE) {
 			got_alternates = -1;
 			return;
 		}
 	if (start_active_slot(slot)) {
 		run_active_slot(slot);
 		if (slot->curl_result != CURLE_OK) {
-			if (slot->http_code == 404) {
+			if (slot->http_code == 404 ||
+			    slot->curl_result == CURLE_FILE_COULDNT_READ_FILE) {
 				repo->got_indices = 1;
 				free(buffer.buffer);
 				return 0;
 		ret = error("Request for %s aborted", hex);
 	} else if (obj_req->curl_result != CURLE_OK &&
 		   obj_req->http_code != 416) {
-		if (obj_req->http_code == 404)
+		if (obj_req->http_code == 404 ||
+		    obj_req->curl_result == CURLE_FILE_COULDNT_READ_FILE)
 			ret = -1; /* Be silent, it is probably in a pack. */
 		else
 			ret = error("%s (curl_result = %d, http_code = %ld, sha1 = %s)",
 	case -ERR_RUN_COMMAND_WAITPID_WRONG_PID:
 		die("waitpid is confused");
 	case -ERR_RUN_COMMAND_WAITPID_SIGNAL:
-		fprintf(stderr, "%s died of signal", update_hook);
+		fprintf(stderr, "%s died of signal\n", update_hook);
 		return -1;
 	case -ERR_RUN_COMMAND_WAITPID_NOEXIT:
 		die("%s died strangely", update_hook);
 		if (!force_update &&
 		    !is_zero_sha1(ref->old_sha1) &&
 		    !ref->force) {
-			if (!has_sha1_file(ref->old_sha1)) {
-				error("remote '%s' object %s does not "
-				      "exist on local",
-				      ref->name, sha1_to_hex(ref->old_sha1));
-				ret = -2;
-				continue;
-			}
-
-			/* We assume that local is fsck-clean.  Otherwise
-			 * you _could_ have an old tag which points at
-			 * something you do not have, which may or may not
-			 * be a commit.
-			 */
-			if (!ref_newer(ref->peer_ref->new_sha1,
+			if (!has_sha1_file(ref->old_sha1) ||
+			    !ref_newer(ref->peer_ref->new_sha1,
 				       ref->old_sha1)) {
-				error("remote ref '%s' is not a strict "
-				      "subset of local ref '%s'.", ref->name,
+				/* We do not have the remote ref, or
+				 * we know that the remote ref is not
+				 * an ancestor of what we are trying to
+				 * push.  Either way this can be losing
+				 * commits at the remote end and likely
+				 * we were not up to date to begin with.
+				 */
+				error("remote '%s' is not a strict "
+				      "subset of local ref '%s'. "
+				      "maybe you are not up-to-date and "
+				      "need to pull first?",
+				      ref->name,
 				      ref->peer_ref->name);
 				ret = -2;
 				continue;
 		*buf++ = hex[val >> 4];
 		*buf++ = hex[val & 0xf];
 	}
+	*buf = '\0';
+
 	return buffer;
 }
 
 	p->pack_last_used = 0;
 	p->pack_use_cnt = 0;
 	p->pack_local = local;
-	if (!get_sha1_hex(path + path_len - 40 - 4, sha1))
+	if ((path_len > 44) && !get_sha1_hex(path + path_len - 44, sha1))
 		memcpy(p->sha1, sha1, 20);
 	return p;
 }
 	unlink(tmpfile);
 	if (ret) {
 		if (ret != EEXIST) {
-			fprintf(stderr, "unable to write sha1 filename %s: %s", filename, strerror(ret));
+			fprintf(stderr, "unable to write sha1 filename %s: %s\n", filename, strerror(ret));
 			return -1;
 		}
 		/* FIXME!!! Collision check here ? */
 	}
 
 	if (errno != ENOENT) {
-		fprintf(stderr, "sha1 file %s: %s", filename, strerror(errno));
+		fprintf(stderr, "sha1 file %s: %s\n", filename, strerror(errno));
 		return -1;
 	}
 
 
 	fd = mkstemp(tmpfile);
 	if (fd < 0) {
-		fprintf(stderr, "unable to create temporary sha1 filename %s: %s", tmpfile, strerror(errno));
+		fprintf(stderr, "unable to create temporary sha1 filename %s: %s\n", tmpfile, strerror(errno));
 		return -1;
 	}
 
 		size = write(fd, buf + posn, objsize - posn);
 		if (size <= 0) {
 			if (!size) {
-				fprintf(stderr, "write closed");
+				fprintf(stderr, "write closed\n");
 			} else {
 				perror("write ");
 			}
 		return 0;
 	if (MAX_REVS <= ref_name_cnt) {
 		fprintf(stderr, "warning: ignoring %s; "
-			"cannot handle more than %d refs",
+			"cannot handle more than %d refs\n",
 			refname, MAX_REVS);
 		return 0;
 	}
 		if (MAX_REVS <= num_rev)
 			die("cannot handle more than %d revs.", MAX_REVS);
 		if (get_sha1(ref_name[num_rev], revkey))
-			die("'%s' is not a valid ref.\n", ref_name[num_rev]);
+			die("'%s' is not a valid ref.", ref_name[num_rev]);
 		commit = lookup_commit_reference(revkey);
 		if (!commit)
 			die("cannot find commit %s (%s)",