Merge branch 'master' into next

* master: (25 commits)
  Make sha1flush void and remove conditional return.
  Make upload_pack void and remove conditional return.
  Make track_tree_refs void.
  Make pack_objects void.
  Make fsck_dir void.
  Make checkout_all void.
  Make show_entry void
  Make pprint_tag void and cleans up call in cmd_cat_file.
  Remove combine-diff.c::uninteresting()
  read-cache.c cleanup
  http-push.c cleanup
  diff.c cleanup
  builtin-push.c cleanup
  builtin-grep.c cleanup
  blame.c return cleanup
  gitweb: configurable home link string
  gitweb: Separate printing difftree in git_commit into git_difftree_body
  gitweb: True fix: Support for the standard mime.types map in gitweb
  gitweb: Skip comments in mime.types like file
  gitweb: Change appereance of marker of refs pointing to given object
  ...
This commit is contained in:
Junio C Hamano
2006-08-14 19:03:23 -07:00
18 changed files with 518 additions and 392 deletions

View File

@@ -128,6 +128,7 @@ GIT_PYTHON_DIR = $(prefix)/share/git-core/python
# default configuration for gitweb
GITWEB_CONFIG = gitweb_config.perl
GITWEB_HOME_LINK_STR = projects
GITWEB_SITENAME =
GITWEB_PROJECTROOT = /pub/git
GITWEB_LIST =
@@ -653,6 +654,7 @@ gitweb/gitweb.cgi: gitweb/gitweb.perl
-e 's|++GIT_VERSION++|$(GIT_VERSION)|g' \
-e 's|++GIT_BINDIR++|$(bindir)|g' \
-e 's|++GITWEB_CONFIG++|$(GITWEB_CONFIG)|g' \
-e 's|++GITWEB_HOME_LINK_STR++|$(GITWEB_HOME_LINK_STR)|g' \
-e 's|++GITWEB_SITENAME++|$(GITWEB_SITENAME)|g' \
-e 's|++GITWEB_PROJECTROOT++|$(GITWEB_PROJECTROOT)|g' \
-e 's|++GITWEB_LIST++|$(GITWEB_LIST)|g' \

View File

@@ -351,10 +351,7 @@ static int fill_util_info(struct commit *commit)
assert(util);
assert(util->pathname);
if (get_blob_sha1(commit->tree, util->pathname, util->sha1))
return 1;
else
return 0;
return !!get_blob_sha1(commit->tree, util->pathname, util->sha1);
}
static void alloc_line_map(struct commit *commit)

View File

@@ -26,7 +26,7 @@ static void flush_buffer(const char *buf, unsigned long size)
}
}
static int pprint_tag(const unsigned char *sha1, const char *buf, unsigned long size)
static void pprint_tag(const unsigned char *sha1, const char *buf, unsigned long size)
{
/* the parser in tag.c is useless here. */
const char *endp = buf + size;
@@ -91,7 +91,6 @@ static int pprint_tag(const unsigned char *sha1, const char *buf, unsigned long
*/
if (cp < endp)
flush_buffer(cp, endp - cp);
return 0;
}
int cmd_cat_file(int argc, const char **argv, const char *prefix)
@@ -145,8 +144,10 @@ int cmd_cat_file(int argc, const char **argv, const char *prefix)
buf = read_sha1_file(sha1, type, &size);
if (!buf)
die("Cannot read object %s", argv[2]);
if (!strcmp(type, tag_type))
return pprint_tag(sha1, buf, size);
if (!strcmp(type, tag_type)) {
pprint_tag(sha1, buf, size);
return 0;
}
/* otherwise just spit out the data */
break;

View File

@@ -122,7 +122,7 @@ static int checkout_file(const char *name, int prefix_length)
return -1;
}
static int checkout_all(const char *prefix, int prefix_length)
static void checkout_all(const char *prefix, int prefix_length)
{
int i, errs = 0;
struct cache_entry* last_ce = NULL;
@@ -153,7 +153,6 @@ static int checkout_all(const char *prefix, int prefix_length)
* exit with the same code as die().
*/
exit(128);
return 0;
}
static const char checkout_cache_usage[] =

View File

@@ -390,9 +390,7 @@ static int buffer_is_binary(const char *ptr, unsigned long size)
{
if (FIRST_FEW_BYTES < size)
size = FIRST_FEW_BYTES;
if (memchr(ptr, 0, size))
return 1;
return 0;
return !!memchr(ptr, 0, size);
}
static int fixmatch(const char *pattern, char *line, regmatch_t *match)

View File

@@ -32,10 +32,8 @@ static int expand_one_ref(const char *ref, const unsigned char *sha1)
/* Ignore the "refs/" at the beginning of the refname */
ref += 5;
if (strncmp(ref, "tags/", 5))
return 0;
add_refspec(strdup(ref));
if (!strncmp(ref, "tags/", 5))
add_refspec(strdup(ref));
return 0;
}

View File

@@ -7,13 +7,6 @@
#include "xdiff-interface.h"
#include "log-tree.h"
static int uninteresting(struct diff_filepair *p)
{
if (diff_unmodified_pair(p))
return 1;
return 0;
}
static struct combine_diff_path *intersect_paths(struct combine_diff_path *curr, int n, int num_parent)
{
struct diff_queue_struct *q = &diff_queued_diff;
@@ -25,7 +18,7 @@ static struct combine_diff_path *intersect_paths(struct combine_diff_path *curr,
for (i = 0; i < q->nr; i++) {
int len;
const char *path;
if (uninteresting(q->queue[i]))
if (diff_unmodified_pair(q->queue[i]))
continue;
path = q->queue[i]->two->path;
len = strlen(path);
@@ -57,7 +50,7 @@ static struct combine_diff_path *intersect_paths(struct combine_diff_path *curr,
const char *path;
int len;
if (uninteresting(q->queue[i]))
if (diff_unmodified_pair(q->queue[i]))
continue;
path = q->queue[i]->two->path;
len = strlen(path);

View File

@@ -10,7 +10,7 @@
#include "cache.h"
#include "csum-file.h"
static int sha1flush(struct sha1file *f, unsigned int count)
static void sha1flush(struct sha1file *f, unsigned int count)
{
void *buf = f->buffer;
@@ -21,7 +21,7 @@ static int sha1flush(struct sha1file *f, unsigned int count)
count -= ret;
if (count)
continue;
return 0;
return;
}
if (!ret)
die("sha1 file '%s' write error. Out of diskspace", f->name);

4
diff.c
View File

@@ -904,9 +904,7 @@ static int mmfile_is_binary(mmfile_t *mf)
long sz = mf->size;
if (FIRST_FEW_BYTES < sz)
sz = FIRST_FEW_BYTES;
if (memchr(mf->ptr, 0, sz))
return 1;
return 0;
return !!memchr(mf->ptr, 0, sz);
}
static void builtin_diff(const char *name_a,

View File

@@ -366,13 +366,13 @@ static void add_sha1_list(unsigned char *sha1, unsigned long ino)
sha1_list.nr = ++nr;
}
static int fsck_dir(int i, char *path)
static void fsck_dir(int i, char *path)
{
DIR *dir = opendir(path);
struct dirent *de;
if (!dir)
return 0;
return;
while ((de = readdir(dir)) != NULL) {
char name[100];
@@ -398,7 +398,6 @@ static int fsck_dir(int i, char *path)
fprintf(stderr, "bad sha1 file: %s/%s\n", path, de->d_name);
}
closedir(dir);
return 0;
}
static int default_refs = 0;

View File

@@ -117,9 +117,14 @@ div.list_head {
a.list {
text-decoration: none;
font-weight: bold;
color: #000000;
}
table.tags a.list {
font-weight: normal;
}
a.list:hover {
text-decoration: underline;
color: #880000;
@@ -221,6 +226,10 @@ table.diff_tree span.file_status.mode_chnge {
color: #777777;
}
table.diff_tree span.file_status.copied {
color: #70a070;
}
/* age2: 60*60*24*2 <= age */
table.project_list td.age2, table.blame td.age2 {
font-style: italic;
@@ -321,15 +330,30 @@ a.rss_logo:hover {
background-color: #ee5500;
}
span.tag {
span.refs span {
padding: 0px 4px;
font-size: 10px;
font-weight: normal;
background-color: #ffffaa;
border: 1px solid;
background-color: #ffaaff;
border-color: #ffccff #ff00ee #ff00ee #ffccff;
}
span.refs span.ref {
background-color: #aaaaff;
border-color: #ccccff #0033cc #0033cc #ccccff;
}
span.refs span.tag {
background-color: #ffffaa;
border-color: #ffffcc #ffee00 #ffee00 #ffffcc;
}
span.refs span.head {
background-color: #aaffaa;
border-color: #ccffcc #00cc33 #00cc33 #ccffcc;
}
span.atnight {
color: #cc0000;
}

File diff suppressed because it is too large Load Diff

View File

@@ -2186,10 +2186,7 @@ static int verify_merge_base(unsigned char *head_sha1, unsigned char *branch_sha
struct commit *branch = lookup_commit(branch_sha1);
struct commit_list *merge_bases = get_merge_bases(head, branch, 1);
if (merge_bases && !merge_bases->next && merge_bases->item == branch)
return 1;
return 0;
return (merge_bases && !merge_bases->next && merge_bases->item == branch);
}
static int delete_remote_branch(char *pattern, int force)

View File

@@ -897,10 +897,8 @@ static int write_index_ext_header(SHA_CTX *context, int fd,
{
ext = htonl(ext);
sz = htonl(sz);
if ((ce_write(context, fd, &ext, 4) < 0) ||
(ce_write(context, fd, &sz, 4) < 0))
return -1;
return 0;
return ((ce_write(context, fd, &ext, 4) < 0) ||
(ce_write(context, fd, &sz, 4) < 0)) ? -1 : 0;
}
static int ce_flush(SHA_CTX *context, int fd)
@@ -922,9 +920,7 @@ static int ce_flush(SHA_CTX *context, int fd)
/* Append the SHA1 signature at the end */
SHA1_Final(write_buffer + left, context);
left += 20;
if (write(fd, write_buffer, left) != left)
return -1;
return 0;
return (write(fd, write_buffer, left) != left) ? -1 : 0;
}
static void ce_smudge_racily_clean_entry(struct cache_entry *ce)

View File

@@ -111,7 +111,7 @@ static void rev_list(int fd, struct ref *refs)
exec_rev_list(refs);
}
static int pack_objects(int fd, struct ref *refs)
static void pack_objects(int fd, struct ref *refs)
{
pid_t rev_list_pid;
@@ -126,7 +126,6 @@ static int pack_objects(int fd, struct ref *refs)
* We don't wait for the rev-list pipeline in the parent:
* we end up waiting for the other end instead
*/
return 0;
}
static void unmark_and_free(struct commit_list *list, unsigned int mark)

View File

@@ -15,7 +15,8 @@ static char *malloc_base(const char *base, const char *path, int pathlen)
return newbase;
}
static int show_entry(struct diff_options *opt, const char *prefix, struct tree_desc *desc, const char *base);
static void show_entry(struct diff_options *opt, const char *prefix, struct tree_desc *desc,
const char *base);
static int compare_tree_entry(struct tree_desc *t1, struct tree_desc *t2, const char *base, struct diff_options *opt)
{
@@ -131,7 +132,8 @@ static void show_tree(struct diff_options *opt, const char *prefix, struct tree_
}
/* A file entry went away or appeared */
static int show_entry(struct diff_options *opt, const char *prefix, struct tree_desc *desc, const char *base)
static void show_entry(struct diff_options *opt, const char *prefix, struct tree_desc *desc,
const char *base)
{
unsigned mode;
const char *path;
@@ -152,11 +154,9 @@ static int show_entry(struct diff_options *opt, const char *prefix, struct tree_
free(tree);
free(newbase);
return 0;
} else {
opt->add_remove(opt, prefix[0], mode, sha1, base, path);
}
opt->add_remove(opt, prefix[0], mode, sha1, base, path);
return 0;
}
int diff_tree(struct tree_desc *t1, struct tree_desc *t2, const char *base, struct diff_options *opt)

3
tree.c
View File

@@ -144,7 +144,7 @@ struct tree *lookup_tree(const unsigned char *sha1)
return (struct tree *) obj;
}
static int track_tree_refs(struct tree *item)
static void track_tree_refs(struct tree *item)
{
int n_refs = 0, i;
struct object_refs *refs;
@@ -174,7 +174,6 @@ static int track_tree_refs(struct tree *item)
refs->ref[i++] = obj;
}
set_object_refs(&item->object, refs);
return 0;
}
int parse_tree_buffer(struct tree *item, void *buffer, unsigned long size)

View File

@@ -544,18 +544,17 @@ static int send_ref(const char *refname, const unsigned char *sha1)
return 0;
}
static int upload_pack(void)
static void upload_pack(void)
{
reset_timeout();
head_ref(send_ref);
for_each_ref(send_ref);
packet_flush(1);
receive_needs();
if (!want_obj.nr)
return 0;
get_common_commits();
create_pack_file();
return 0;
if (want_obj.nr) {
get_common_commits();
create_pack_file();
}
}
int main(int argc, char **argv)