Staging
v0.5.1
https://github.com/git/git
Revision 78d9d414123ad6f4f522ffecbcd9e4a7562948fd authored by Linus Torvalds on 15 July 2005, 23:08:01 UTC, committed by Linus Torvalds on 15 July 2005, 23:08:01 UTC
Now, not all projects can be as refined as Linux.  Before the final 1.0
release, we went through fifteen 0.99 patchfiles, and pl14 alone went
through subreleases 'a' through 'z'. Now _that_ is a release process.

Not to mention the odd-ball releases, like 0.96c+

Sadly, in this day and age of RPM's etc, we have silly limitations, and
I cannot call this release '0.99pl5a or some such awe-inspiring name
just because "rpmbuild" is such a party pooper.  So it's just 0.99.1.

Oh well.  Aspiring to such greatness as the Linux release numbering is
hubris anyway.  You can attain such perfection only once in your life.
1 parent 71931c1
Raw File
Tip revision: 78d9d414123ad6f4f522ffecbcd9e4a7562948fd authored by Linus Torvalds on 15 July 2005, 23:08:01 UTC
Ahh, the heady days of 0.99 patchfiles
Tip revision: 78d9d41
hash-object.c
/*
 * GIT - The information manager from hell
 *
 * Copyright (C) Linus Torvalds, 2005
 * Copyright (C) Junio C Hamano, 2005 
 */
#include "cache.h"

static void hash_object(const char *path, const char *type, int write_object)
{
	int fd;
	struct stat st;
	unsigned char sha1[20];
	fd = open(path, O_RDONLY);
	if (fd < 0 ||
	    fstat(fd, &st) < 0 ||
	    index_fd(sha1, fd, &st, write_object, type))
		die(write_object
		    ? "Unable to add %s to database"
		    : "Unable to hash %s", path);
	printf("%s\n", sha1_to_hex(sha1));
}

static const char *hash_object_usage =
"git-hash-object [-t <type>] [-w] <file>...";

int main(int argc, char **argv)
{
	int i;
	const char *type = "blob";
	int write_object = 0;

	for (i = 1 ; i < argc; i++) {
		if (!strcmp(argv[i], "-t")) {
			if (argc <= ++i)
				die(hash_object_usage);
			type = argv[i];
		}
		else if (!strcmp(argv[i], "-w"))
			write_object = 1;
		else
			hash_object(argv[i], type, write_object);
	}
	return 0;
}
back to top