Skip to content

Commit

Permalink
Merge branch 'pb/gitweb-tagcloud' into pb/gitweb
Browse files Browse the repository at this point in the history
* pb/gitweb-tagcloud:
  gitweb: Support for simple project search form
  gitweb: Make the by_tag filter delve in forks as well
  gitweb: Support for tag clouds
  ... (+ many updates from master) ...

Conflicts:
	gitweb/gitweb.perl
  • Loading branch information
Shawn O. Pearce committed Oct 3, 2008
2 parents d627f68 + 0d1d154 commit 3e3d4ee
Show file tree
Hide file tree
Showing 38 changed files with 447 additions and 169 deletions.
2 changes: 1 addition & 1 deletion Documentation/technical/api-run-command.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Functions
start_command() followed by finish_command(). Takes a pointer
to a `struct child_process` that specifies the details.

`run_command_v_opt`, `run_command_v_opt_cd`, `run_command_v_opt_cd_env`::
`run_command_v_opt`, `run_command_v_opt_cd_env`::

Convenience functions that encapsulate a sequence of
start_command() followed by finish_command(). The argument argv
Expand Down
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -648,6 +648,7 @@ ifeq ($(uname_S),SunOS)
NO_MEMMEM = YesPlease
NO_HSTRERROR = YesPlease
NO_MKDTEMP = YesPlease
OLD_ICONV = UnfortunatelyYes
ifeq ($(uname_R),5.8)
NEEDS_LIBICONV = YesPlease
NO_UNSETENV = YesPlease
Expand Down
2 changes: 1 addition & 1 deletion archive.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ static char const * const archive_usage[] = {

#define USES_ZLIB_COMPRESSION 1

const struct archiver {
static const struct archiver {
const char *name;
write_archive_fn_t write_archive;
unsigned int flags;
Expand Down
16 changes: 8 additions & 8 deletions arm/sha1.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
#include <string.h>
#include "sha1.h"

extern void sha_transform(uint32_t *hash, const unsigned char *data, uint32_t *W);
extern void arm_sha_transform(uint32_t *hash, const unsigned char *data, uint32_t *W);

void SHA1_Init(SHA_CTX *c)
void arm_SHA1_Init(arm_SHA_CTX *c)
{
c->len = 0;
c->hash[0] = 0x67452301;
Expand All @@ -20,7 +20,7 @@ void SHA1_Init(SHA_CTX *c)
c->hash[4] = 0xc3d2e1f0;
}

void SHA1_Update(SHA_CTX *c, const void *p, unsigned long n)
void arm_SHA1_Update(arm_SHA_CTX *c, const void *p, unsigned long n)
{
uint32_t workspace[80];
unsigned int partial;
Expand All @@ -32,12 +32,12 @@ void SHA1_Update(SHA_CTX *c, const void *p, unsigned long n)
if (partial) {
done = 64 - partial;
memcpy(c->buffer + partial, p, done);
sha_transform(c->hash, c->buffer, workspace);
arm_sha_transform(c->hash, c->buffer, workspace);
partial = 0;
} else
done = 0;
while (n >= done + 64) {
sha_transform(c->hash, p + done, workspace);
arm_sha_transform(c->hash, p + done, workspace);
done += 64;
}
} else
Expand All @@ -46,7 +46,7 @@ void SHA1_Update(SHA_CTX *c, const void *p, unsigned long n)
memcpy(c->buffer + partial, p + done, n - done);
}

void SHA1_Final(unsigned char *hash, SHA_CTX *c)
void arm_SHA1_Final(unsigned char *hash, arm_SHA_CTX *c)
{
uint64_t bitlen;
uint32_t bitlen_hi, bitlen_lo;
Expand All @@ -57,7 +57,7 @@ void SHA1_Final(unsigned char *hash, SHA_CTX *c)
bitlen = c->len << 3;
offset = c->len & 0x3f;
padlen = ((offset < 56) ? 56 : (64 + 56)) - offset;
SHA1_Update(c, padding, padlen);
arm_SHA1_Update(c, padding, padlen);

bitlen_hi = bitlen >> 32;
bitlen_lo = bitlen & 0xffffffff;
Expand All @@ -69,7 +69,7 @@ void SHA1_Final(unsigned char *hash, SHA_CTX *c)
bits[5] = bitlen_lo >> 16;
bits[6] = bitlen_lo >> 8;
bits[7] = bitlen_lo;
SHA1_Update(c, bits, 8);
arm_SHA1_Update(c, bits, 8);

for (i = 0; i < 5; i++) {
uint32_t v = c->hash[i];
Expand Down
15 changes: 10 additions & 5 deletions arm/sha1.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,17 @@

#include <stdint.h>

typedef struct sha_context {
typedef struct {
uint64_t len;
uint32_t hash[5];
unsigned char buffer[64];
} SHA_CTX;
} arm_SHA_CTX;

void SHA1_Init(SHA_CTX *c);
void SHA1_Update(SHA_CTX *c, const void *p, unsigned long n);
void SHA1_Final(unsigned char *hash, SHA_CTX *c);
void arm_SHA1_Init(arm_SHA_CTX *c);
void arm_SHA1_Update(arm_SHA_CTX *c, const void *p, unsigned long n);
void arm_SHA1_Final(unsigned char *hash, arm_SHA_CTX *c);

#define git_SHA_CTX arm_SHA_CTX
#define git_SHA1_Init arm_SHA1_Init
#define git_SHA1_Update arm_SHA1_Update
#define git_SHA1_Final arm_SHA1_Final
4 changes: 2 additions & 2 deletions arm/sha1_arm.S
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@
*/

.text
.globl sha_transform
.globl arm_sha_transform

/*
* void sha_transform(uint32_t *hash, const unsigned char *data, uint32_t *W);
*
* note: the "data" pointer may be unaligned.
*/

sha_transform:
arm_sha_transform:

stmfd sp!, {r4 - r8, lr}

Expand Down
10 changes: 5 additions & 5 deletions builtin-unpack-objects.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ static const char unpack_usage[] = "git unpack-objects [-n] [-q] [-r] [--strict]
static unsigned char buffer[4096];
static unsigned int offset, len;
static off_t consumed_bytes;
static SHA_CTX ctx;
static git_SHA_CTX ctx;

/*
* When running under --strict mode, objects whose reachability are
Expand Down Expand Up @@ -59,7 +59,7 @@ static void *fill(int min)
if (min > sizeof(buffer))
die("cannot fill %d bytes", min);
if (offset) {
SHA1_Update(&ctx, buffer, offset);
git_SHA1_Update(&ctx, buffer, offset);
memmove(buffer, buffer + offset, len);
offset = 0;
}
Expand Down Expand Up @@ -539,10 +539,10 @@ int cmd_unpack_objects(int argc, const char **argv, const char *prefix)
/* We don't take any non-flag arguments now.. Maybe some day */
usage(unpack_usage);
}
SHA1_Init(&ctx);
git_SHA1_Init(&ctx);
unpack_all();
SHA1_Update(&ctx, buffer, offset);
SHA1_Final(sha1, &ctx);
git_SHA1_Update(&ctx, buffer, offset);
git_SHA1_Final(sha1, &ctx);
if (strict)
write_rest();
if (hashcmp(fill(20), sha1))
Expand Down
9 changes: 7 additions & 2 deletions cache.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,14 @@
#include "hash.h"

#include SHA1_HEADER
#include <zlib.h>
#ifndef git_SHA_CTX
#define git_SHA_CTX SHA_CTX
#define git_SHA1_Init SHA1_Init
#define git_SHA1_Update SHA1_Update
#define git_SHA1_Final SHA1_Final
#endif

#include <zlib.h>
#if defined(NO_DEFLATE_BOUND) || ZLIB_VERNUM < 0x1200
#define deflateBound(c,s) ((s) + (((s) + 7) >> 3) + (((s) + 63) >> 6) + 11)
#endif
Expand Down Expand Up @@ -749,7 +755,6 @@ typedef int (*config_fn_t)(const char *, const char *, void *);
extern int git_default_config(const char *, const char *, void *);
extern int git_config_from_file(config_fn_t fn, const char *, void *);
extern int git_config(config_fn_t fn, void *);
extern int git_parse_long(const char *, long *);
extern int git_parse_ulong(const char *, unsigned long *);
extern int git_config_int(const char *, const char *);
extern unsigned long git_config_ulong(const char *, const char *);
Expand Down
2 changes: 1 addition & 1 deletion commit.c
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ struct commit_graft *read_graft_line(char *buf, int len)
return graft;
}

int read_graft_file(const char *graft_file)
static int read_graft_file(const char *graft_file)
{
FILE *fp = fopen(graft_file, "r");
char buf[1024];
Expand Down
1 change: 0 additions & 1 deletion commit.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ struct commit_graft {

struct commit_graft *read_graft_line(char *buf, int len);
int register_commit_graft(struct commit_graft *, int);
int read_graft_file(const char *graft_file);
struct commit_graft *lookup_commit_graft(const unsigned char *sha1);

extern struct commit_list *get_merge_bases(struct commit *rev1, struct commit *rev2, int cleanup);
Expand Down
23 changes: 21 additions & 2 deletions config.c
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,27 @@ static int git_parse_file(config_fn_t fn, void *data)
int baselen = 0;
static char var[MAXNAME];

/* U+FEFF Byte Order Mark in UTF8 */
static const unsigned char *utf8_bom = (unsigned char *) "\xef\xbb\xbf";
const unsigned char *bomptr = utf8_bom;

for (;;) {
int c = get_next_char();
if (bomptr && *bomptr) {
/* We are at the file beginning; skip UTF8-encoded BOM
* if present. Sane editors won't put this in on their
* own, but e.g. Windows Notepad will do it happily. */
if ((unsigned char) c == *bomptr) {
bomptr++;
continue;
} else {
/* Do not tolerate partial BOM. */
if (bomptr != utf8_bom)
break;
/* No BOM at file beginning. Cool. */
bomptr = NULL;
}
}
if (c == '\n') {
if (config_file_eof)
return 0;
Expand Down Expand Up @@ -255,7 +274,7 @@ static int parse_unit_factor(const char *end, unsigned long *val)
return 0;
}

int git_parse_long(const char *value, long *ret)
static int git_parse_long(const char *value, long *ret)
{
if (value && *value) {
char *end;
Expand Down Expand Up @@ -291,7 +310,7 @@ static void die_bad_config(const char *name)

int git_config_int(const char *name, const char *value)
{
long ret;
long ret = 0;
if (!git_parse_long(value, &ret))
die_bad_config(name);
return ret;
Expand Down
8 changes: 4 additions & 4 deletions csum-file.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ int sha1close(struct sha1file *f, unsigned char *result, unsigned int flags)
unsigned offset = f->offset;

if (offset) {
SHA1_Update(&f->ctx, f->buffer, offset);
git_SHA1_Update(&f->ctx, f->buffer, offset);
sha1flush(f, f->buffer, offset);
f->offset = 0;
}
SHA1_Final(f->buffer, &f->ctx);
git_SHA1_Final(f->buffer, &f->ctx);
if (result)
hashcpy(result, f->buffer);
if (flags & (CSUM_CLOSE | CSUM_FSYNC)) {
Expand Down Expand Up @@ -82,7 +82,7 @@ int sha1write(struct sha1file *f, void *buf, unsigned int count)
buf = (char *) buf + nr;
left -= nr;
if (!left) {
SHA1_Update(&f->ctx, data, offset);
git_SHA1_Update(&f->ctx, data, offset);
sha1flush(f, data, offset);
offset = 0;
}
Expand All @@ -105,7 +105,7 @@ struct sha1file *sha1fd_throughput(int fd, const char *name, struct progress *tp
f->tp = tp;
f->name = name;
f->do_crc = 0;
SHA1_Init(&f->ctx);
git_SHA1_Init(&f->ctx);
return f;
}

Expand Down
2 changes: 1 addition & 1 deletion csum-file.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ struct progress;
struct sha1file {
int fd;
unsigned int offset;
SHA_CTX ctx;
git_SHA_CTX ctx;
off_t total;
struct progress *tp;
const char *name;
Expand Down
12 changes: 6 additions & 6 deletions diff.c
Original file line number Diff line number Diff line change
Expand Up @@ -3087,7 +3087,7 @@ static void diff_summary(FILE *file, struct diff_filepair *p)
}

struct patch_id_t {
SHA_CTX *ctx;
git_SHA_CTX *ctx;
int patchlen;
};

Expand Down Expand Up @@ -3115,7 +3115,7 @@ static void patch_id_consume(void *priv, char *line, unsigned long len)

new_len = remove_space(line, len);

SHA1_Update(data->ctx, line, new_len);
git_SHA1_Update(data->ctx, line, new_len);
data->patchlen += new_len;
}

Expand All @@ -3124,11 +3124,11 @@ static int diff_get_patch_id(struct diff_options *options, unsigned char *sha1)
{
struct diff_queue_struct *q = &diff_queued_diff;
int i;
SHA_CTX ctx;
git_SHA_CTX ctx;
struct patch_id_t data;
char buffer[PATH_MAX * 4 + 20];

SHA1_Init(&ctx);
git_SHA1_Init(&ctx);
memset(&data, 0, sizeof(struct patch_id_t));
data.ctx = &ctx;

Expand Down Expand Up @@ -3190,7 +3190,7 @@ static int diff_get_patch_id(struct diff_options *options, unsigned char *sha1)
len2, p->two->path,
len1, p->one->path,
len2, p->two->path);
SHA1_Update(&ctx, buffer, len1);
git_SHA1_Update(&ctx, buffer, len1);

xpp.flags = XDF_NEED_MINIMAL;
xecfg.ctxlen = 3;
Expand All @@ -3199,7 +3199,7 @@ static int diff_get_patch_id(struct diff_options *options, unsigned char *sha1)
&xpp, &xecfg, &ecb);
}

SHA1_Final(sha1, &ctx);
git_SHA1_Final(sha1, &ctx);
return 0;
}

Expand Down
4 changes: 2 additions & 2 deletions dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ static struct dir_entry *dir_entry_new(const char *pathname, int len)
return ent;
}

struct dir_entry *dir_add_name(struct dir_struct *dir, const char *pathname, int len)
static struct dir_entry *dir_add_name(struct dir_struct *dir, const char *pathname, int len)
{
if (cache_name_exists(pathname, len, ignore_case))
return NULL;
Expand All @@ -391,7 +391,7 @@ struct dir_entry *dir_add_name(struct dir_struct *dir, const char *pathname, int
return dir->entries[dir->nr++] = dir_entry_new(pathname, len);
}

struct dir_entry *dir_add_ignored(struct dir_struct *dir, const char *pathname, int len)
static struct dir_entry *dir_add_ignored(struct dir_struct *dir, const char *pathname, int len)
{
if (cache_name_pos(pathname, len) >= 0)
return NULL;
Expand Down
1 change: 0 additions & 1 deletion dir.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ extern void add_excludes_from_file(struct dir_struct *, const char *fname);
extern void add_exclude(const char *string, const char *base,
int baselen, struct exclude_list *which);
extern int file_exists(const char *);
extern struct dir_entry *dir_add_name(struct dir_struct *dir, const char *pathname, int len);

extern char *get_relative_cwd(char *buffer, int size, const char *dir);
extern int is_inside_dir(const char *dir);
Expand Down
Loading

0 comments on commit 3e3d4ee

Please sign in to comment.