Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
50add2c
pack-bitmap: stop truncating blob sizes used by --filter=blob:limit
dscho Jun 5, 2026
0a1103a
tree-walk: drop link_len cast in get_tree_entry_follow_symlinks()
dscho Jun 5, 2026
22566e0
tree-walk: widen init_tree_desc() and init_tree_desc_gently() to size_t
dscho Jun 5, 2026
01c4367
pack-objects: drop the two tree-walk casts in the preferred-base path
dscho Jun 5, 2026
4749ccc
diff-delta: widen sizeof_delta_index() return to size_t
dscho Jun 5, 2026
b10cb43
tree: widen struct tree.size and parse_tree_buffer() to size_t
dscho Jun 5, 2026
4bd5ac1
blame: widen find_line_starts() len parameter to size_t
dscho Jun 5, 2026
88ca753
fast-export: drop the export_blob() size cast and widen anonymize_blob()
dscho Jun 5, 2026
2a5c4aa
repo: drop the inflated-size cast in count_objects()
dscho Jun 5, 2026
fe5e428
commit: widen the commit-buffer API to size_t
dscho Jun 5, 2026
e0826f7
grep: widen struct grep_source.size and grep_buffer() to size_t
dscho Jun 5, 2026
46a8254
unpack-objects: widen the size-passing infrastructure to size_t
dscho Jun 5, 2026
6ffbe6f
diff-delta: widen struct delta_index size fields to size_t
dscho Jun 5, 2026
d51d865
delta: widen create_delta_index() parameter to size_t
dscho Jun 5, 2026
9cc09ef
pack-objects: widen delta-cache accounting to size_t
dscho Jun 5, 2026
6e802a6
pack-objects: widen free_unpacked() return to size_t
dscho Jun 5, 2026
00386ad
pack-objects: widen mem_usage and try_delta out-param to size_t
dscho Jun 5, 2026
6085d61
delta: widen create_delta() and diff_delta() to size_t
dscho Jun 5, 2026
406f675
packfile, git-zlib: widen use_pack() and zstream avail fields to size_t
dscho Jun 5, 2026
235d853
archive-zip: widen zlib_deflate_raw()'s maxsize local to size_t
dscho Jun 5, 2026
6f78cfd
diff: widen deflate_it()'s bound local from int to size_t
dscho Jun 5, 2026
5299e1e
diff: stop truncating the deflated-binary-diff size on Windows
dscho Jun 5, 2026
7ee5a4a
http-push: widen start_put()'s size local from ssize_t to size_t
dscho Jun 5, 2026
01deab1
convert: widen gather_convert_stats() helpers to size_t
dscho Jun 5, 2026
9f5f5f7
t/helper/test-pack-deltas: widen do_compress()'s maxsize local to size_t
dscho Jun 5, 2026
c03880c
read-cache: stop truncating index blob sizes on Windows
dscho Jun 5, 2026
c185a83
git-zlib: widen git_deflate_bound() to size_t
dscho Jun 5, 2026
eb1c32d
xdiff-interface: widen buffer_is_binary() size parameter to size_t
dscho Jun 5, 2026
31c379a
combine-diff: stop truncating combined-diff blob sizes on Windows
dscho Jun 5, 2026
4bdd674
diff: widen textconv_object() size out-param to size_t
dscho Jun 5, 2026
5b7c8a8
Merge branch 'size-t/pack-objects-delta'
dscho Jun 7, 2026
0815513
diffcore: widen struct diff_filespec.size to size_t
dscho Jun 5, 2026
4d0e268
Merge branch 'size-t/pack-bitmap'
dscho Jun 7, 2026
585eb5c
Merge branch 'size-t/diff'
dscho Jun 7, 2026
c097e7b
Merge branch 'size-t/diff-delta-sizeof'
dscho Jun 7, 2026
c536505
Merge branch 'size-t/tree'
dscho Jun 7, 2026
6edb5e6
Merge branch 'size-t/commit'
dscho Jun 7, 2026
d88b9b0
Merge branch 'size-t/blame'
dscho Jun 7, 2026
1f77de2
Merge branch 'size-t/grep'
dscho Jun 7, 2026
e1d07a7
Merge branch 'size-t/fast-export'
dscho Jun 7, 2026
6e9281f
Merge branch 'size-t/repo'
dscho Jun 7, 2026
80cb370
Merge branch 'size-t/unpack-objects'
dscho Jun 7, 2026
b3f6155
Merge branch 'topic/size-t' into size-t-followups
dscho Jun 22, 2026
783a88b
pack-objects: drop cast_size_t_to_ulong shims in get_delta()
dscho Jun 5, 2026
0ba41b5
pack-objects: drop cast_size_t_to_ulong shims in try_delta()
dscho Jun 5, 2026
069ff03
pack-objects: drop the last size shim in write_no_reuse_object()
dscho Jun 5, 2026
8849de1
blame: widen struct blame_scoreboard.final_buf_size to size_t
dscho Jun 5, 2026
e9aa08f
fast-import: drop the six size casts in the object-read paths
dscho Jun 5, 2026
3796065
t/helper/test-pack-deltas: drop the delta_size cast in write_ref_delta()
dscho Jun 5, 2026
bd09298
Drop the `cast_size_t_to_ulong()` helper
dscho Jun 22, 2026
38d2054
Merge branch 'topic/size-t' (size_t evacuation, upstream-bound)
dscho Jun 7, 2026
b391157
Merge branch 'topic/size-t-followups' (size_t followups depending on …
dscho Jun 7, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion archive-zip.c
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ static void *zlib_deflate_raw(void *data, unsigned long size,
unsigned long *compressed_size)
{
git_zstream stream;
unsigned long maxsize;
size_t maxsize;
void *buffer;
int result;

Expand Down
2 changes: 1 addition & 1 deletion attr.c
Original file line number Diff line number Diff line change
Expand Up @@ -793,7 +793,7 @@ static struct attr_stack *read_attr_from_index(struct index_state *istate,
{
struct attr_stack *stack = NULL;
char *buf;
unsigned long size;
size_t size;
int sparse_dir_pos = -1;

if (!istate)
Expand Down
21 changes: 7 additions & 14 deletions blame.c
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ static struct commit *fake_working_tree_commit(struct repository *r,
struct stat st;
const char *read_from;
char *buf_ptr;
unsigned long buf_len;
size_t buf_len;

if (contents_from) {
if (stat(contents_from, &st) < 0)
Expand Down Expand Up @@ -335,7 +335,7 @@ static const char *get_next_line(const char *start, const char *end)
}

static int find_line_starts(int **line_starts, const char *buf,
unsigned long len)
size_t len)
{
const char *end = buf + len;
const char *p;
Expand Down Expand Up @@ -1034,20 +1034,17 @@ static void fill_origin_blob(struct diff_options *opt,
{
if (!o->file.ptr) {
enum object_type type;
unsigned long file_size;
size_t file_size;

(*num_read_blob)++;
if (opt->flags.allow_textconv &&
textconv_object(opt->repo, o->path, o->mode,
&o->blob_oid, 1, &file->ptr, &file_size))
;
else {
size_t file_size_st = 0;
else
file->ptr = odb_read_object(the_repository->objects,
&o->blob_oid, &type,
&file_size_st);
file_size = cast_size_t_to_ulong(file_size_st);
}
&file_size);
file->size = file_size;

if (!file->ptr)
Expand Down Expand Up @@ -2872,14 +2869,10 @@ void setup_scoreboard(struct blame_scoreboard *sb,
textconv_object(sb->repo, sb->path, o->mode, &o->blob_oid, 1, (char **) &sb->final_buf,
&sb->final_buf_size))
;
else {
size_t final_buf_size_st = 0;
else
sb->final_buf = odb_read_object(the_repository->objects,
&o->blob_oid, &type,
&final_buf_size_st);
sb->final_buf_size =
cast_size_t_to_ulong(final_buf_size_st);
}
&sb->final_buf_size);

if (!sb->final_buf)
die(_("cannot read blob %s for path %s"),
Expand Down
2 changes: 1 addition & 1 deletion blame.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ struct blame_scoreboard {
* indexed with scoreboard.lineno[blame_entry.lno].
*/
char *final_buf;
unsigned long final_buf_size;
size_t final_buf_size;

/* linked list of blames */
struct blame_entry *ent;
Expand Down
13 changes: 4 additions & 9 deletions builtin/cat-file.c
Original file line number Diff line number Diff line change
Expand Up @@ -186,11 +186,9 @@ static int cat_one_file(int opt, const char *exp_type, const char *obj_name)

case 'c':
{
unsigned long size_ul = 0;
int textconv_ret = textconv_object(the_repository, path,
obj_context.mode, &oid, 1,
&buf, &size_ul);
size = size_ul;
&buf, &size);
if (textconv_ret)
break;
}
Expand Down Expand Up @@ -413,12 +411,9 @@ static void print_object_or_die(struct batch_options *opt, struct expand_data *d
oid_to_hex(oid), data->rest);
} else if (opt->transform_mode == 'c') {
enum object_type type;
unsigned long size_ul = 0;
if (textconv_object(the_repository,
data->rest, 0100644, oid,
1, &contents, &size_ul))
size = size_ul;
else
if (!textconv_object(the_repository,
data->rest, 0100644, oid,
1, &contents, &size))
contents = odb_read_object(the_repository->objects,
oid, &type, &size);
if (!contents)
Expand Down
8 changes: 3 additions & 5 deletions builtin/fast-export.c
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ static void show_progress(void)
* There's no need to cache this result with anonymize_mem, since
* we already handle blob content caching with marks.
*/
static char *anonymize_blob(unsigned long *size)
static char *anonymize_blob(size_t *size)
{
static int counter;
struct strbuf out = STRBUF_INIT;
Expand All @@ -296,7 +296,7 @@ static char *anonymize_blob(unsigned long *size)

static void export_blob(const struct object_id *oid)
{
unsigned long size;
size_t size;
enum object_type type;
char *buf;
struct object *object;
Expand All @@ -317,10 +317,8 @@ static void export_blob(const struct object_id *oid)
object = (struct object *)lookup_blob(the_repository, oid);
eaten = 0;
} else {
size_t size_st = 0;
buf = odb_read_object(the_repository->objects, oid, &type,
&size_st);
size = cast_size_t_to_ulong(size_st);
&size);
if (!buf)
die(_("could not read blob %s"), oid_to_hex(oid));
if (check_object_signature(the_repository, oid, buf, size,
Expand Down
38 changes: 13 additions & 25 deletions builtin/fast-import.c
Original file line number Diff line number Diff line change
Expand Up @@ -962,7 +962,7 @@ static int store_object(
struct object_entry *e;
unsigned char hdr[96];
struct object_id oid;
unsigned long hdrlen, deltalen;
size_t hdrlen, deltalen;
struct git_hash_ctx c;
git_zstream s;
struct repo_config_values *cfg = repo_config_values(the_repository);
Expand Down Expand Up @@ -998,7 +998,6 @@ static int store_object(

if (last && last->data.len && last->data.buf && last->depth < max_depth
&& dat->len > the_hash_algo->rawsz) {

delta_count_attempts_by_type[type]++;
delta = diff_delta(last->data.buf, last->data.len,
dat->buf, dat->len,
Expand Down Expand Up @@ -1238,10 +1237,9 @@ static void stream_blob(uintmax_t len, struct object_id *oidout, uintmax_t mark)
*/
static void *gfi_unpack_entry(
struct object_entry *oe,
unsigned long *sizep)
size_t *sizep)
{
enum object_type type;
size_t size_st = 0;
void *data;
struct packed_git *p = all_packs[oe->pack_id];
if (p == pack_data && p->pack_size < (pack_size + the_hash_algo->rawsz)) {
Expand All @@ -1264,9 +1262,7 @@ static void *gfi_unpack_entry(
*/
p->pack_size = pack_size + the_hash_algo->rawsz;
}
data = unpack_entry(the_repository, p, oe->idx.offset, &type, &size_st);
if (sizep)
*sizep = cast_size_t_to_ulong(size_st);
data = unpack_entry(the_repository, p, oe->idx.offset, &type, sizep);
return data;
}

Expand All @@ -1275,7 +1271,7 @@ static void load_tree(struct tree_entry *root)
struct object_id *oid = &root->versions[1].oid;
struct object_entry *myoe;
struct tree_content *t;
unsigned long size;
size_t size;
char *buf;
const char *c;

Expand All @@ -1293,10 +1289,8 @@ static void load_tree(struct tree_entry *root)
die(_("can't load tree %s"), oid_to_hex(oid));
} else {
enum object_type type;
size_t size_st = 0;
buf = odb_read_object(the_repository->objects, oid, &type,
&size_st);
size = cast_size_t_to_ulong(size_st);
&size);
if (!buf || type != OBJ_TREE)
die(_("can't load tree %s"), oid_to_hex(oid));
}
Expand Down Expand Up @@ -2614,7 +2608,7 @@ static void file_change_deleteall(struct branch *b)
b->num_notes = 0;
}

static void parse_from_commit(struct branch *b, char *buf, unsigned long size)
static void parse_from_commit(struct branch *b, char *buf, size_t size)
{
if (!buf || size < the_hash_algo->hexsz + 6)
die(_("not a valid commit: %s"), oid_to_hex(&b->oid));
Expand All @@ -2631,13 +2625,11 @@ static void parse_from_existing(struct branch *b)
oidclr(&b->branch_tree.versions[0].oid, the_repository->hash_algo);
oidclr(&b->branch_tree.versions[1].oid, the_repository->hash_algo);
} else {
unsigned long size;
size_t size_st = 0;
size_t size;
char *buf;

buf = odb_read_object_peeled(the_repository->objects, &b->oid,
OBJ_COMMIT, &size_st, &b->oid);
size = cast_size_t_to_ulong(size_st);
OBJ_COMMIT, &size, &b->oid);
parse_from_commit(b, buf, size);
free(buf);
}
Expand Down Expand Up @@ -2666,7 +2658,7 @@ static int parse_objectish(struct branch *b, const char *objectish)
if (!oideq(&b->oid, &oe->idx.oid)) {
oidcpy(&b->oid, &oe->idx.oid);
if (oe->pack_id != MAX_PACK_ID) {
unsigned long size;
size_t size;
char *buf = gfi_unpack_entry(oe, &size);
parse_from_commit(b, buf, size);
free(buf);
Expand Down Expand Up @@ -3332,15 +3324,13 @@ static void cat_blob_write(const char *buf, unsigned long size)
static void cat_blob(struct object_entry *oe, struct object_id *oid)
{
struct strbuf line = STRBUF_INIT;
unsigned long size;
size_t size;
enum object_type type = 0;
char *buf;

if (!oe || oe->pack_id == MAX_PACK_ID) {
size_t size_st = 0;
buf = odb_read_object(the_repository->objects, oid, &type,
&size_st);
size = cast_size_t_to_ulong(size_st);
&size);
} else {
type = oe->type;
buf = gfi_unpack_entry(oe, &size);
Expand Down Expand Up @@ -3419,7 +3409,7 @@ static void parse_cat_blob(const char *p)
static struct object_entry *dereference(struct object_entry *oe,
struct object_id *oid)
{
unsigned long size;
size_t size;
char *buf = NULL;
const unsigned hexsz = the_hash_algo->hexsz;

Expand Down Expand Up @@ -3448,10 +3438,8 @@ static struct object_entry *dereference(struct object_entry *oe,
buf = gfi_unpack_entry(oe, &size);
} else {
enum object_type unused;
size_t size_st = 0;
buf = odb_read_object(the_repository->objects, oid,
&unused, &size_st);
size = cast_size_t_to_ulong(size_st);
&unused, &size);
}
if (!buf)
die(_("can't load object %s"), oid_to_hex(oid));
Expand Down
2 changes: 1 addition & 1 deletion builtin/log.c
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,7 @@ static int show_blob_object(const struct object_id *oid, struct rev_info *rev, c
struct object_id oidc;
struct object_context obj_context = {0};
char *buf;
unsigned long size;
size_t size;

fflush(rev->diffopt.file);
if (!rev->diffopt.flags.textconv_set_via_cmdline ||
Expand Down
Loading
Loading