Commits

Anonymous committed 6ab5889 Merge

GIT 1.0.4

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

Comments (0)

Files changed (9)

Documentation/git-ls-files.txt

 		(-[c|d|o|i|s|u|k|m])\*
 		[-x <pattern>|--exclude=<pattern>]
 		[-X <file>|--exclude-from=<file>]
-		[--exclude-per-directory=<file>] [--] [<file>]\*
+		[--exclude-per-directory=<file>] 
+		[--full-name] [--] [<file>]\*
 
 DESCRIPTION
 -----------
 	K::	to be killed
 	?	other
 
+--full-name::
+	When run from a subdirectory, the command usually
+	outputs paths relative to the current directory.  This
+	option forces paths to be output relative to the project
+	top directory.
+
 --::
 	Do not interpret any more arguments as options.
 
 # 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.3
+GIT_VERSION = 1.0.4
 
 # CFLAGS and LDFLAGS are for the users to override from the command line.
 
+git-core (1.0.4-0) unstable; urgency=low
+
+  * GIT 1.0.4.
+
+ -- Junio C Hamano <junkio@cox.net>  Sat, 24 Dec 2005 00:01:20 -0800
+
 git-core (1.0.3-0) unstable; urgency=low
 
   * GIT 1.0.3 maintenance release.
 esac
 
 result_tree= best_cnt=-1 best_strategy= wt_strategy=
+merge_was_ok=
 for strategy in $use_strategies
 do
     test "$wt_strategy" = '' || {
     exit=$?
     if test "$no_commit" = t && test "$exit" = 0
     then
+        merge_was_ok=t
 	exit=1 ;# pretend it left conflicts.
     fi
 
 done >"$GIT_DIR/MERGE_HEAD"
 echo $merge_msg >"$GIT_DIR/MERGE_MSG"
 
-die "Automatic merge failed/prevented; fix up by hand"
+if test "$merge_was_ok" = t
+then
+	echo >&2 \
+	"Automatic merge went well; stopped before committing as requested"
+	exit 0
+else
+	die "Automatic merge failed; fix up by hand"
+fi
 static const char ls_files_usage[] =
 	"git-ls-files [-z] [-t] (--[cached|deleted|others|stage|unmerged|killed|modified])* "
 	"[ --ignored ] [--exclude=<pattern>] [--exclude-from=<file>] "
-	"[ --exclude-per-directory=<filename> ] [--] [<file>]*";
+	"[ --exclude-per-directory=<filename> ] [--full-name] [--] [<file>]*";
 
 int main(int argc, const char **argv)
 {
 	char *in, *out;
 	size_t insize, outsize, nrc;
 	char outbuf[4096]; /* cheat */
-	static char latin_one[] = "latin-1";
+	static char latin_one[] = "latin1";
 	char *input_charset = *charset ? charset : latin_one;
 	iconv_t conv = iconv_open(metainfo_charset, input_charset);
 
 static int check_packed_git_idx(const char *path, unsigned long *idx_size_,
 				void **idx_map_)
 {
+	SHA_CTX ctx;
+	unsigned char sha1[20];
 	void *idx_map;
 	unsigned int *index;
 	unsigned long idx_size;
 	int nr, i;
-	int fd = open(path, O_RDONLY);
+	int fd;
 	struct stat st;
+
+	fd = open(path, O_RDONLY);
 	if (fd < 0)
 		return -1;
 	if (fstat(fd, &st)) {
 	if (idx_size != 4*256 + nr * 24 + 20 + 20)
 		return error("wrong index file size");
 
+	/*
+	 * File checksum.
+	 */
+	SHA1_Init(&ctx);
+	SHA1_Update(&ctx, idx_map, idx_size-20);
+	SHA1_Final(sha1, &ctx);
+
+	if (memcmp(sha1, idx_map + idx_size - 20, 20))
+		return error("index checksum mismatch");
+
 	return 0;
 }
 
 static char *ref_name[MAX_REVS + 1];
 static int ref_name_cnt;
 
+static const char *find_digit_prefix(const char *s, int *v)
+{
+	const char *p;
+	int ver;
+	char ch;
+
+	for (p = s, ver = 0;
+	     '0' <= (ch = *p) && ch <= '9';
+	     p++)
+		ver = ver * 10 + ch - '0';
+	*v = ver;
+	return p;
+}
+
+
+static int version_cmp(const char *a, const char *b)
+{
+	while (1) {
+		int va, vb;
+
+		a = find_digit_prefix(a, &va);
+		b = find_digit_prefix(b, &vb);
+		if (va != vb)
+			return va - vb;
+
+		while (1) {
+			int ca = *a;
+			int cb = *b;
+			if ('0' <= ca && ca <= '9')
+				ca = 0;
+			if ('0' <= cb && cb <= '9')
+				cb = 0;
+			if (ca != cb)
+				return ca - cb;
+			if (!ca)
+				break;
+			a++;
+			b++;
+		}
+		if (!*a && !*b)
+			return 0;
+	}
+}
+
 static int compare_ref_name(const void *a_, const void *b_)
 {
 	const char * const*a = a_, * const*b = b_;
-	return strcmp(*a, *b);
+	return version_cmp(*a, *b);
 }
 
 static void sort_ref_range(int bottom, int top)
 static int append_ref(const char *refname, const unsigned char *sha1)
 {
 	struct commit *commit = lookup_commit_reference_gently(sha1, 1);
+	int i;
+
 	if (!commit)
 		return 0;
+	/* Avoid adding the same thing twice */
+	for (i = 0; i < ref_name_cnt; i++)
+		if (!strcmp(refname, ref_name[i]))
+			return 0;
+
 	if (MAX_REVS <= ref_name_cnt) {
 		fprintf(stderr, "warning: ignoring %s; "
 			"cannot handle more than %d refs\n",
 	if (1 < independent + merge_base + (extra != 0))
 		usage(show_branch_usage);
 
+	/* If nothing is specified, show all branches by default */
+	if (ac + all_heads + all_tags == 0)
+		all_heads = 1;
+
 	if (all_heads + all_tags)
 		snarf_refs(all_heads, all_tags);
-
-	if (ac) {
-		while (0 < ac) {
-			append_one_rev(*av);
-			ac--; av++;
-		}
-	}
-	else {
-		/* If no revs given, then add heads */
-		snarf_refs(1, 0);
+	while (0 < ac) {
+		append_one_rev(*av);
+		ac--; av++;
 	}
+
 	if (!ref_name_cnt) {
 		fprintf(stderr, "No revs to be shown.\n");
 		exit(0);

t/t5300-pack-object.sh

      else :;
      fi &&
 
+     cp test-1-${packname_1}.pack test-3.pack &&
+     dd if=/dev/zero of=test-3.idx count=1 bs=1 conv=notrunc seek=1200 &&
+     if git-verify-pack test-3.pack
+     then false
+     else :;
+     fi &&
+
      :'
 
 test_expect_success \
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.