sb/object-store updates
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest27 patches 10 repliesIn review
Patches in v1 No applies recorded yet
Reviews trailers per patch
None of the 27 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.
| Patch | Stefan Beller |
|---|---|
| Series | R-b |
| 1/27 | |
| 2/27 | |
| 3/27 | |
| 4/27 | |
| 5/27 | |
| 6/27 | |
| 7/27 | |
| 8/27 | |
| 9/27 | |
| 10/27 | |
| 11/27 | |
| 12/27 | |
| 13/27 | |
| 14/27 | |
| 15/27 | |
| 16/27 | |
| 17/27 | |
| 18/27 | |
| 19/27 | |
| 20/27 | |
| 21/27 | |
| 22/27 | |
| 23/27 | |
| 24/27 | |
| 25/27 | |
| 26/27 | |
| 27/27 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH 00/27] sb/object-store updates
I think I have addressed all comments I've received so far. What I decided not to do, I have responded individually. One comment I did not respond nor do is the approximate thing, which could be done later.
Interdiff is big due to the "objects." to "objects->" conversion (blame Brandon for his suggestion, don't blame me :D)
builtin/am.c +1 -1
@@ -1859,7 +1859,7 @@ static void am_run(struct am_state *state, int resume)*/ if (!state->rebasing) {am_destroy (state); -close_all_packs (&the_repository->objects); +close_all_packs (the_repository->objects);run_command_v_opt (argv_gc_auto,RUN_GIT_CMD ); } }
builtin/clone.c +2 -1
@@ -27,6 +27,7 @@#include "connected.h" #include "packfile.h" #include "list-objects-filter-options.h" +#include "object-store.h" /* * Overall FIXMEs:
@@ -1217,7 +1218,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)transport_disconnect (transport);if (option_dissociate) { -close_all_packs (&the_repository->objects); +close_all_packs (the_repository->objects);dissociate_from_references (); }
builtin/count-objects.c +1 -0
@@ -12,6 +12,7 @@#include "parse-options.h" #include "quote.h" #include "packfile.h" +#include "object-store.h" static unsigned long garbage;static off_t size_garbage;
builtin/fetch.c +1 -1
@@ -1478,7 +1478,7 @@ int cmd_fetch(int argc, const char **argv, const char *prefix)string_list_clear (&list,0 ); -close_all_packs (&the_repository->objects); +close_all_packs (the_repository->objects);argv_array_pushl (&argv_gc_auto,"gc" ,"--auto" ,NULL );if (verbosity <0 )
builtin/fsck.c +5 -2
@@ -17,6 +17,7 @@#include "streaming.h" #include "decorate.h" #include "packfile.h" +#include "object-store.h" #define REACHABLE 0x0001#define SEEN 0x0002
@@ -714,11 +715,13 @@ int cmd_fsck(int argc, const char **argv, const char *prefix)for_each_loose_object (mark_loose_for_connectivity,NULL ,0 );for_each_packed_object (mark_packed_for_connectivity,NULL ,0 ); }else { +struct alternate_object_database *alt_odb_list; +fsck_object_dir (get_object_directory ());prepare_alt_odb (the_repository); -for (alt = the_repository->objects.alt_odb_list; - alt; alt = alt->next) + alt_odb_list = the_repository->objects->alt_odb_list; +for (alt = alt_odb_list; alt; alt = alt->next)fsck_object_dir (alt->path);if (check_full) {
builtin/gc.c +1 -0
@@ -21,6 +21,7 @@#include "argv-array.h" #include "commit.h" #include "packfile.h" +#include "object-store.h" #define FAILED_RUN "failed to run %s"
builtin/grep.c +2 -1
@@ -22,6 +22,7 @@#include "pathspec.h" #include "submodule.h" #include "submodule-config.h" +#include "object-store.h" static char const *const grep_usage[] = {N_ ("git grep [<options>] [-e] <pattern> [<rev>...] [[--] <path>...]" ),
@@ -432,7 +433,7 @@ static int grep_submodule(struct grep_opt *opt, struct repository *superproject,* object. */ grep_read_lock (); -add_to_alternates_memory (submodule.objects.objectdir); +add_to_alternates_memory (submodule.objects->objectdir);grep_read_unlock ();if (oid) {
builtin/index-pack.c +1 -0
@@ -13,6 +13,7 @@#include "streaming.h" #include "thread-utils.h" #include "packfile.h" +#include "object-store.h" static const char index_pack_usage[] ="git index-pack [-v] [-o <index-file>] [--keep | --keep=<msg>] [--verify] [--strict] (<pack-file> | --stdin [--fix-thin] [<pack-file>])" ;
builtin/merge.c +1 -1
@@ -411,7 +411,7 @@ static void finish(struct commit *head_commit,* We ignore errors in 'gc --auto', since the * user should see them. */ -close_all_packs (&the_repository->objects); +close_all_packs (the_repository->objects);run_command_v_opt (argv_gc_auto,RUN_GIT_CMD ); } }
builtin/pack-objects.c +1 -0
@@ -29,6 +29,7 @@#include "argv-array.h" #include "list.h" #include "packfile.h" +#include "object-store.h" static const char *pack_usage[] = {N_ ("git pack-objects --stdout [<options>...] [< <ref-list> | < <object-list>]" ),
builtin/pack-redundant.c +1 -0
@@ -9,6 +9,7 @@#include "builtin.h" #include "repository.h" #include "packfile.h" +#include "object-store.h" #define BLKSIZE 512
builtin/receive-pack.c +1 -1
@@ -2026,7 +2026,7 @@ int cmd_receive_pack(int argc, const char **argv, const char *prefix) proc.git_cmd =1 ; proc.argv = argv_gc_auto; -close_all_packs (&the_repository->objects); +close_all_packs (the_repository->objects);if (!start_command (&proc)) {if (use_sideband)copy_to_sideband (proc.err,-1 ,NULL );
builtin/submodule--helper.c +1 -0
@@ -16,6 +16,7 @@#include "revision.h" #include "diffcore.h" #include "diff.h" +#include "object-store.h" #define OPT_QUIET (1 << 0)#define OPT_CACHED (1 << 1)
environment.c +2 -2
@@ -271,9 +271,9 @@ const char *get_git_work_tree(void)char *get_object_directory (void ) { -if (!the_repository->objects.objectdir) +if (!the_repository->objects->objectdir)BUG ("git environment hasn't been setup" ); -return the_repository->objects.objectdir; +return the_repository->objects->objectdir; }int odb_mkstemp (struct strbuf *template,const char *pattern)
fast-import.c +1 -0
@@ -169,6 +169,7 @@ Format of STDIN stream:#include "dir.h" #include "run-command.h" #include "packfile.h" +#include "object-store.h" #define PACK_ID_BITS 16#define MAX_PACK_ID ((1<<PACK_ID_BITS)-1)
http-backend.c +1 -0
@@ -11,6 +11,7 @@#include "url.h" #include "argv-array.h" #include "packfile.h" +#include "object-store.h" static const char content_type[] ="Content-Type" ;static const char content_length[] ="Content-Length" ;
http-push.c +1 -0
@@ -12,6 +12,7 @@#include "sigchain.h" #include "argv-array.h" #include "packfile.h" +#include "object-store.h" #ifdef EXPAT_NEEDS_XMLPARSE_H #include <xmlparse.h>
http-walker.c +1 -0
@@ -6,6 +6,7 @@#include "list.h" #include "transport.h" #include "packfile.h" +#include "object-store.h" struct alt_base {char *base;
http.c +1 -0
@@ -14,6 +14,7 @@#include "packfile.h" #include "protocol.h" #include "string-list.h" +#include "object-store.h" static struct trace_key trace_curl =TRACE_KEY_INIT (CURL );static int trace_curl_data =1 ;
object-store.h +11 -5
@@ -90,13 +90,19 @@ struct raw_object_store {/* Path to extra alternate object database if not NULL */ char *alternate_db; -struct packed_git *packed_git;/* private */ -/* A most-recently-used ordered version of the packed_git list. */ -struct list_head packed_git_mru;/* private */ -struct alternate_object_database *alt_odb_list;struct alternate_object_database **alt_odb_tail; +/* +* private data +* +* should only be accessed directly by packfile.c +*/ + +struct packed_git *packed_git; +/* A most-recently-used ordered version of the packed_git list. */ +struct list_head packed_git_mru; +/* * A fast, rough count of the number of objects in the repository. * These two fields are not meant for direct access. Use
@@ -112,7 +118,7 @@ struct raw_object_store { unsigned packed_git_initialized : 1; }; -void raw_object_store_init (struct raw_object_store *o); +struct raw_object_store *raw_object_store_new (void );void raw_object_store_clear (struct raw_object_store *o);/*
object.c +10 -2
@@ -4,6 +4,7 @@#include "tree.h" #include "commit.h" #include "tag.h" +#include "object-store.h" #include "packfile.h" static struct object **obj_hash;
@@ -447,23 +448,30 @@ void clear_commit_marks_all(unsigned int flags) } } -void raw_object_store_init (struct raw_object_store *o) +struct raw_object_store *raw_object_store_new (void ) { +struct raw_object_store *o =xmalloc (sizeof (*o)); +memset (o,0 ,sizeof (*o));INIT_LIST_HEAD (&o->packed_git_mru); +return o; }static void free_alt_odb (struct alternate_object_database *alt) {strbuf_release (&alt->scratch);oid_array_clear (&alt->loose_objects_cache); +free (alt); }static void free_alt_odbs (struct raw_object_store *o) {while (o->alt_odb_list) { +struct alternate_object_database *next; + + next = o->alt_odb_list->next;free_alt_odb (o->alt_odb_list); - o->alt_odb_list = o->alt_odb_list->next; + o->alt_odb_list = next; } }
pack-bitmap.c +1 -0
@@ -11,6 +11,7 @@#include "pack-objects.h" #include "packfile.h" #include "repository.h" +#include "object-store.h" /* * An entry on the bitmap index, representing the bitmap for a given
pack-check.c +1 -0
@@ -3,6 +3,7 @@#include "pack-revindex.h" #include "progress.h" #include "packfile.h" +#include "object-store.h" struct idx_entry {off_t offset;
pack-revindex.c +1 -0
@@ -1,5 +1,6 @@#include "cache.h" #include "pack-revindex.h" +#include "object-store.h" /* * Pack index for existing packs give us easy access to the offsets into
packfile.c +28 -27
168 lines not on this page · raw message
path.c +2 -1
@@ -10,6 +10,7 @@#include "submodule-config.h" #include "path.h" #include "packfile.h" +#include "object-store.h" static int get_st_mode_bits (const char *path,int *mode) {
@@ -382,7 +383,7 @@ static void adjust_git_path(const struct repository *repo,strbuf_splice (buf,0 , buf->len, repo->index_file,strlen (repo->index_file)); else if (dir_prefix(base, "objects")) - replace_dir(buf, git_dir_len + 7, repo->objects.objectdir); + replace_dir(buf, git_dir_len + 7, repo->objects->objectdir); else if (git_hooks_path && dir_prefix(base, "hooks")) replace_dir(buf, git_dir_len + 5, git_hooks_path); else if (repo->different_commondir)
reachable.c +1 -0
@@ -11,6 +11,7 @@#include "list-objects.h" #include "packfile.h" #include "worktree.h" +#include "object-store.h" struct connectivity_progress {struct progress *progress;
repository.c +7 -6
@@ -13,7 +13,7 @@ void initialize_the_repository(void) the_repository = &the_repo; the_repo.index = &the_index; -raw_object_store_init (&the_repo.objects); + the_repo.objects =raw_object_store_new ();repo_set_hash_algo (&the_repo,GIT_HASH_SHA1 ); }
@@ -60,10 +60,10 @@ void repo_set_gitdir(struct repository *repo,free (old_gitdir);repo_set_commondir (repo, o->commondir); -expand_base_dir (&repo->objects.objectdir, o->object_dir, +expand_base_dir (&repo->objects->objectdir, o->object_dir, repo->commondir,"objects" ); -free (repo->objects.alternate_db); - repo->objects.alternate_db =xstrdup_or_null (o->alternate_db); +free (repo->objects->alternate_db); + repo->objects->alternate_db =xstrdup_or_null (o->alternate_db);expand_base_dir (&repo->graft_file, o->graft_file, repo->commondir,"info/grafts" ); expand_base_dir(&repo->index_file, o->index_file,
@@ -142,7 +142,7 @@ static int repo_init(struct repository *repo,struct repository_format format;memset (repo,0 ,sizeof (*repo)); -raw_object_store_init (&repo->objects); + repo->objects =raw_object_store_new ();if (repo_init_gitdir (repo, gitdir)) goto error;
@@ -223,7 +223,8 @@ void repo_clear(struct repository *repo)FREE_AND_NULL (repo->worktree);FREE_AND_NULL (repo->submodule_prefix); -raw_object_store_clear (&repo->objects); +raw_object_store_clear (repo->objects); +FREE_AND_NULL (repo->objects);if (repo->config) {git_configset_clear (repo->config);
repository.h +3 -4
@@ -1,12 +1,11 @@#ifndef REPOSITORY_H #define REPOSITORY_H -#include "object-store.h" -struct config_set ; +struct git_hash_algo ;struct index_state ; +struct raw_object_store ;struct submodule_cache ; -struct git_hash_algo ; struct repository {/* Environment */
@@ -25,7 +24,7 @@ struct repository {/* * Holds any information related to accessing the raw object content. */ -struct raw_object_store objects; +struct raw_object_store *objects;/* * Path to the repository's graft file.
server-info.c +1 -0
@@ -5,6 +5,7 @@#include "commit.h" #include "tag.h" #include "packfile.h" +#include "object-store.h" /* * Create the file "path" by writing to a temporary file and renaming
sha1_file.c +15 -15
@@ -23,7 +23,6 @@#include "sha1-lookup.h" #include "bulk-checkin.h" #include "repository.h" -#include "object-store.h" #include "streaming.h" #include "dir.h" #include "list.h"
@@ -31,6 +30,7 @@#include "quote.h" #include "packfile.h" #include "fetch-object.h" +#include "object-store.h" const unsigned char null_sha1[GIT_MAX_RAWSZ ];const struct object_id null_oid;
@@ -325,7 +325,7 @@ static void fill_sha1_path(struct strbuf *buf, const unsigned char *sha1)void sha1_file_name (struct repository *r,struct strbuf *buf,const unsigned char *sha1) { -strbuf_addstr (buf, r->objects.objectdir); +strbuf_addstr (buf, r->objects->objectdir);strbuf_addch (buf,'/' );fill_sha1_path (buf, sha1); }
@@ -419,7 +419,7 @@ static int link_alt_odb_entry(struct repository *r, const char *entry,while (pathbuf.len && pathbuf.buf[pathbuf.len -1 ] =='/' )strbuf_setlen (&pathbuf, pathbuf.len -1 ); -if (!alt_odb_usable (&r->objects, &pathbuf, normalized_objdir)) { +if (!alt_odb_usable (r->objects, &pathbuf, normalized_objdir)) {strbuf_release (&pathbuf);return -1 ; }
@@ -427,8 +427,8 @@ static int link_alt_odb_entry(struct repository *r, const char *entry, ent =alloc_alt_odb (pathbuf.buf);/* add the alternate entry */ - *r->objects.alt_odb_tail = ent; - r->objects.alt_odb_tail = &(ent->next); + *r->objects->alt_odb_tail = ent; + r->objects->alt_odb_tail = &(ent->next); ent->next =NULL ;/* recursively add alternates */
@@ -482,7 +482,7 @@ static void link_alt_odb_entries(struct repository *r, const char *alt,return ; } -strbuf_add_absolute_path (&objdirbuf, r->objects.objectdir); +strbuf_add_absolute_path (&objdirbuf, r->objects->objectdir);if (strbuf_normalize_path (&objdirbuf) <0 )die ("unable to normalize object directory: %s" , objdirbuf.buf);
@@ -565,7 +565,7 @@ void add_to_alternates_file(const char *reference)fprintf_or_die (out,"%s\n" , reference);if (commit_lock_file (&lock))die_errno ("unable to move new alternates file into place" ); -if (the_repository->objects.alt_odb_tail) +if (the_repository->objects->alt_odb_tail)link_alt_odb_entries (the_repository, reference,'\n' ,NULL ,0 ); }
@@ -665,7 +665,7 @@ int foreach_alt_odb(alt_odb_fn fn, void *cb)int r =0 ;prepare_alt_odb (the_repository); -for (ent = the_repository->objects.alt_odb_list; ent; ent = ent->next) { +for (ent = the_repository->objects->alt_odb_list; ent; ent = ent->next) { r =fn (ent, cb);if (r)break ;
@@ -675,13 +675,13 @@ int foreach_alt_odb(alt_odb_fn fn, void *cb)void prepare_alt_odb (struct repository *r) { -if (r->objects.alt_odb_tail) +if (r->objects->alt_odb_tail)return ; - r->objects.alt_odb_tail = &r->objects.alt_odb_list; -link_alt_odb_entries (r, r->objects.alternate_db,PATH_SEP ,NULL ,0 ); + r->objects->alt_odb_tail = &r->objects->alt_odb_list; +link_alt_odb_entries (r, r->objects->alternate_db,PATH_SEP ,NULL ,0 ); -read_info_alternates (r, r->objects.objectdir,0 ); +read_info_alternates (r, r->objects->objectdir,0 ); }/* Returns 1 if we have successfully freshened the file, 0 otherwise. */
@@ -722,7 +722,7 @@ static int check_and_freshen_nonlocal(const unsigned char *sha1, int freshen) {struct alternate_object_database *alt;prepare_alt_odb (the_repository); -for (alt = the_repository->objects.alt_odb_list; alt; alt = alt->next) { +for (alt = the_repository->objects->alt_odb_list; alt; alt = alt->next) {const char *path =alt_sha1_path (alt, sha1);if (check_and_freshen_file (path, freshen))return 1 ;
@@ -882,7 +882,7 @@ static int stat_sha1_file(struct repository *r, const unsigned char *sha1,prepare_alt_odb (r); errno =ENOENT ; -for (alt = r->objects.alt_odb_list; alt; alt = alt->next) { +for (alt = r->objects->alt_odb_list; alt; alt = alt->next) { *path =alt_sha1_path (alt, sha1);if (!lstat (*path, st))return 0 ;
@@ -913,7 +913,7 @@ static int open_sha1_file(struct repository *r, most_interesting_errno = errno;prepare_alt_odb (r); -for (alt = r->objects.alt_odb_list; alt; alt = alt->next) { +for (alt = r->objects->alt_odb_list; alt; alt = alt->next) { *path =alt_sha1_path (alt, sha1); fd =git_open (*path);if (fd >=0 )
sha1_name.c +2 -1
@@ -10,6 +10,7 @@#include "dir.h" #include "sha1-array.h" #include "packfile.h" +#include "object-store.h" #include "repository.h" static int get_oid_oneline (const char *,struct object_id *,struct commit_list *);
@@ -105,7 +106,7 @@ static void find_short_object_filename(struct disambiguate_state *ds)*/ fakeent =alloc_alt_odb (get_object_directory ()); } - fakeent->next = the_repository->objects.alt_odb_list; + fakeent->next = the_repository->objects->alt_odb_list;for (alt = fakeent; alt && !ds->ambiguous; alt = alt->next) {int pos;
submodule.c +1 -0
@@ -21,6 +21,7 @@#include "remote.h" #include "worktree.h" #include "parse-options.h" +#include "object-store.h" static int config_update_recurse_submodules =RECURSE_SUBMODULES_OFF ;static struct string_list changed_submodule_names =STRING_LIST_INIT_DUP ;
t/helper/test-ref-store.c +1 -0
@@ -1,6 +1,7 @@#include "cache.h" #include "refs.h" #include "worktree.h" +#include "object-store.h" static const char *notnull (const char *arg,const char *name) {
tmp-objdir.c +1 -0
@@ -6,6 +6,7 @@#include "strbuf.h" #include "argv-array.h" #include "quote.h" +#include "object-store.h" struct tmp_objdir {struct strbuf path;
transport.c +1 -0
@@ -18,6 +18,7 @@#include "sha1-array.h" #include "sigchain.h" #include "transport-internal.h" +#include "object-store.h" static void set_upstreams (struct transport *transport,struct ref *refs,int pretend)
Signature · 1 line
2.17.0.rc0.348.gd5a49e0b6f