From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS31976 209.132.180.0/23 X-Spam-Status: No, score=-11.1 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI,T_DKIMWL_WL_MED,USER_IN_DEF_DKIM_WL shortcircuit=no autolearn=ham autolearn_force=no version=3.4.0 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by dcvr.yhbt.net (Postfix) with ESMTP id 5DDD21F406 for ; Tue, 15 May 2018 23:43:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752095AbeEOXmm (ORCPT ); Tue, 15 May 2018 19:42:42 -0400 Received: from mail-pf0-f179.google.com ([209.85.192.179]:38859 "EHLO mail-pf0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751104AbeEOXmj (ORCPT ); Tue, 15 May 2018 19:42:39 -0400 Received: by mail-pf0-f179.google.com with SMTP id o76-v6so821153pfi.5 for ; Tue, 15 May 2018 16:42:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=dotVnaji/xc+4/r1R4qQPAlYMHtHqp/Ubw9rLvWbKeY=; b=sCdU5OvVslSf92+Tt2itHCJVsR/NcbqPcNHOU+q45yGG9Y+2YVqLEIEij5qJZcx5sv +MIP6NCwN/0tdbYPlXhCZ8npiU3LfhhSSI9YKMi3OGeUM8dTM31rukRZfxVsf9Dgotbm PPbn6xeIDL+mnO2xvsxcqh6oxP2D2jK2cQFwzKxpIMJHpItnroEtUH/cuRs0Q+A0T7rZ rt9mG1/UHz3VSfxzKcTV689XdUUYNeCLs3aZyaIkCfIXq/DO255TpDovI9D3OzCS69KP o+/+Sm4ip7Zaj2ZXP0qqN++QnRPE4b0qXSLUMyW5MbB5h7QoMweD29pqh3wTfm3t4DUw EJsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=dotVnaji/xc+4/r1R4qQPAlYMHtHqp/Ubw9rLvWbKeY=; b=nu16MSB3xAhhw/QxQVK7STfyRSqNN0dc9DSwnpY6JlvsTv0njmVpBbf7OjwciJmoC5 2ov63c48YpnF0JuD+5DjoErC3Llsbuwo1/p75wBoBl9JW15T4M3VjUo/WGi2TInIB6LP Glnp3tHh4p3b7RwSBGVOIiRvAkPTb7M8u7fw00giSNpkTjcW4fj5JJJIhIKLWU71NeYV 0piPRPbQZVC3/qFixBFzSxtMDjC4GjfthuKTBhl8T5ZzIxoOpujU1zvbDv3ISUja4j+O MUkd9+eGzhIzVjbXIWK7EHv4oOIysWtjkUbnnwL7n+S1i/BOHtSRk3Ke93X6EMhC2Ppy Z+Yw== X-Gm-Message-State: ALKqPwcI5npJF90cZiXrGPBeRq+oDlV/NlzoUcRZ8cL8txarZvs/GGHG bXAgjKi3DISeaI1t3kAzlbTtlTZf2GY= X-Google-Smtp-Source: AB8JxZpUui/uq0SpPf6ZGkgRu1DJ01xAbW6szeE2mbVFpd12YL4AWHH4yfupIyD+7S8SC0OAGeIg6Q== X-Received: by 2002:a65:5042:: with SMTP id k2-v6mr9936897pgo.122.1526427757378; Tue, 15 May 2018 16:42:37 -0700 (PDT) Received: from localhost ([2620:0:100e:422:ea58:fa52:fa77:9b41]) by smtp.gmail.com with ESMTPSA id r8-v6sm1409616pfk.179.2018.05.15.16.42.36 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 15 May 2018 16:42:36 -0700 (PDT) From: Stefan Beller To: git@vger.kernel.org Cc: Stefan Beller Subject: [PATCH 01/19] object-store: move object access functions to object-store.h Date: Tue, 15 May 2018 16:42:15 -0700 Message-Id: <20180515234233.143708-2-sbeller@google.com> X-Mailer: git-send-email 2.17.0.582.gccdcbd54c44.dirty In-Reply-To: <20180515234233.143708-1-sbeller@google.com> References: <20180515234233.143708-1-sbeller@google.com> Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org This should make these functions easier to find and cache.h less overwhelming to read. In particular, this moves: - read_object_file - oid_object_info - write_object_file As a result, most of the codebase needs to #include object-store.h. In this patch the #include is only added to files that would fail to compile otherwise. It would be better to #include wherever identifiers from the header are used. That can happen later when we have better tooling for it. Signed-off-by: Stefan Beller --- apply.c | 1 + archive-tar.c | 1 + archive-zip.c | 1 + archive.c | 1 + blame.c | 1 + builtin/blame.c | 1 + builtin/cat-file.c | 1 + builtin/checkout.c | 1 + builtin/clone.c | 1 + builtin/commit-tree.c | 1 + builtin/describe.c | 1 + builtin/difftool.c | 1 + builtin/fast-export.c | 1 + builtin/fetch.c | 1 + builtin/fmt-merge-msg.c | 1 + builtin/hash-object.c | 1 + builtin/log.c | 1 + builtin/ls-tree.c | 1 + builtin/merge-tree.c | 1 + builtin/mktag.c | 1 + builtin/mktree.c | 1 + builtin/notes.c | 1 + builtin/prune.c | 1 + builtin/receive-pack.c | 1 + builtin/reflog.c | 1 + builtin/remote.c | 1 + builtin/rev-list.c | 1 + builtin/show-ref.c | 1 + builtin/tag.c | 1 + builtin/unpack-file.c | 1 + builtin/unpack-objects.c | 1 + builtin/verify-commit.c | 1 + bulk-checkin.c | 1 + bundle.c | 1 + cache-tree.c | 1 + cache.h | 117 --------------------------------------- combine-diff.c | 1 + commit.c | 1 + config.c | 1 + convert.c | 1 + diff.c | 1 + diffcore-rename.c | 1 + dir.c | 1 + entry.c | 1 + fetch-pack.c | 1 + fsck.c | 1 + grep.c | 1 + list-objects-filter.c | 1 + list-objects.c | 1 + log-tree.c | 1 + mailmap.c | 1 + match-trees.c | 1 + merge-blobs.c | 1 + merge-recursive.c | 1 + notes-cache.c | 1 + notes-merge.c | 1 + notes.c | 1 + object-store.h | 117 +++++++++++++++++++++++++++++++++++++++ object.c | 1 + pack-bitmap-write.c | 1 + packfile.h | 5 ++ read-cache.c | 1 + ref-filter.c | 1 + refs.c | 1 + remote-testsvn.c | 1 + remote.c | 1 + rerere.c | 1 + revision.c | 1 + send-pack.c | 1 + sequencer.c | 1 + shallow.c | 1 + submodule-config.c | 1 + tag.c | 1 + tree-walk.c | 1 + tree.c | 1 + unpack-trees.c | 1 + upload-pack.c | 1 + walker.c | 1 + xdiff-interface.c | 1 + 79 files changed, 198 insertions(+), 117 deletions(-) diff --git a/apply.c b/apply.c index 7e5792c996f..cbc45fa1b0e 100644 --- a/apply.c +++ b/apply.c @@ -9,6 +9,7 @@ #include "cache.h" #include "config.h" +#include "object-store.h" #include "blob.h" #include "delta.h" #include "diff.h" diff --git a/archive-tar.c b/archive-tar.c index f93409324f9..e38435eb4ef 100644 --- a/archive-tar.c +++ b/archive-tar.c @@ -5,6 +5,7 @@ #include "config.h" #include "tar.h" #include "archive.h" +#include "object-store.h" #include "streaming.h" #include "run-command.h" diff --git a/archive-zip.c b/archive-zip.c index 74f3fe91034..abc556e5a75 100644 --- a/archive-zip.c +++ b/archive-zip.c @@ -6,6 +6,7 @@ #include "archive.h" #include "streaming.h" #include "utf8.h" +#include "object-store.h" #include "userdiff.h" #include "xdiff-interface.h" diff --git a/archive.c b/archive.c index 93ab175b0b4..9da1e3664a6 100644 --- a/archive.c +++ b/archive.c @@ -1,6 +1,7 @@ #include "cache.h" #include "config.h" #include "refs.h" +#include "object-store.h" #include "commit.h" #include "tree-walk.h" #include "attr.h" diff --git a/blame.c b/blame.c index 3a11f1ce52b..f689bde31cd 100644 --- a/blame.c +++ b/blame.c @@ -1,5 +1,6 @@ #include "cache.h" #include "refs.h" +#include "object-store.h" #include "cache-tree.h" #include "mergesort.h" #include "diff.h" diff --git a/builtin/blame.c b/builtin/blame.c index bfdf7cc1325..0ffd1d443ea 100644 --- a/builtin/blame.c +++ b/builtin/blame.c @@ -22,6 +22,7 @@ #include "line-log.h" #include "dir.h" #include "progress.h" +#include "object-store.h" #include "blame.h" static char blame_usage[] = N_("git blame [] [] [] [--] "); diff --git a/builtin/cat-file.c b/builtin/cat-file.c index b8ecbea98e9..91e7764243e 100644 --- a/builtin/cat-file.c +++ b/builtin/cat-file.c @@ -13,6 +13,7 @@ #include "tree-walk.h" #include "sha1-array.h" #include "packfile.h" +#include "object-store.h" struct batch_options { int enabled; diff --git a/builtin/checkout.c b/builtin/checkout.c index b49b5820718..105e07981ff 100644 --- a/builtin/checkout.c +++ b/builtin/checkout.c @@ -4,6 +4,7 @@ #include "lockfile.h" #include "parse-options.h" #include "refs.h" +#include "object-store.h" #include "commit.h" #include "tree.h" #include "tree-walk.h" diff --git a/builtin/clone.c b/builtin/clone.c index 7df5932b855..29998c02ece 100644 --- a/builtin/clone.c +++ b/builtin/clone.c @@ -14,6 +14,7 @@ #include "parse-options.h" #include "fetch-pack.h" #include "refs.h" +#include "object-store.h" #include "tree.h" #include "tree-walk.h" #include "unpack-trees.h" diff --git a/builtin/commit-tree.c b/builtin/commit-tree.c index ecf42191da1..9fbd3529fb1 100644 --- a/builtin/commit-tree.c +++ b/builtin/commit-tree.c @@ -5,6 +5,7 @@ */ #include "cache.h" #include "config.h" +#include "object-store.h" #include "commit.h" #include "tree.h" #include "builtin.h" diff --git a/builtin/describe.c b/builtin/describe.c index 66c497f7896..65b0edc473c 100644 --- a/builtin/describe.c +++ b/builtin/describe.c @@ -13,6 +13,7 @@ #include "hashmap.h" #include "argv-array.h" #include "run-command.h" +#include "object-store.h" #include "revision.h" #include "list-objects.h" diff --git a/builtin/difftool.c b/builtin/difftool.c index ee8dce019e1..df7e75f797b 100644 --- a/builtin/difftool.c +++ b/builtin/difftool.c @@ -20,6 +20,7 @@ #include "argv-array.h" #include "strbuf.h" #include "lockfile.h" +#include "object-store.h" #include "dir.h" static char *diff_gui_tool; diff --git a/builtin/fast-export.c b/builtin/fast-export.c index 373c794873e..f593e57b9d4 100644 --- a/builtin/fast-export.c +++ b/builtin/fast-export.c @@ -7,6 +7,7 @@ #include "cache.h" #include "config.h" #include "refs.h" +#include "object-store.h" #include "commit.h" #include "object.h" #include "tag.h" diff --git a/builtin/fetch.c b/builtin/fetch.c index 73be393b2ea..c1f2df97965 100644 --- a/builtin/fetch.c +++ b/builtin/fetch.c @@ -5,6 +5,7 @@ #include "config.h" #include "repository.h" #include "refs.h" +#include "object-store.h" #include "commit.h" #include "builtin.h" #include "string-list.h" diff --git a/builtin/fmt-merge-msg.c b/builtin/fmt-merge-msg.c index bd680be6874..1b526adb3a9 100644 --- a/builtin/fmt-merge-msg.c +++ b/builtin/fmt-merge-msg.c @@ -2,6 +2,7 @@ #include "cache.h" #include "config.h" #include "refs.h" +#include "object-store.h" #include "commit.h" #include "diff.h" #include "revision.h" diff --git a/builtin/hash-object.c b/builtin/hash-object.c index 526da5c1856..d5c018eabd5 100644 --- a/builtin/hash-object.c +++ b/builtin/hash-object.c @@ -6,6 +6,7 @@ */ #include "builtin.h" #include "config.h" +#include "object-store.h" #include "blob.h" #include "quote.h" #include "parse-options.h" diff --git a/builtin/log.c b/builtin/log.c index 71f68a3e4f5..9656578f58e 100644 --- a/builtin/log.c +++ b/builtin/log.c @@ -7,6 +7,7 @@ #include "cache.h" #include "config.h" #include "refs.h" +#include "object-store.h" #include "color.h" #include "commit.h" #include "diff.h" diff --git a/builtin/ls-tree.c b/builtin/ls-tree.c index 409da4e8351..fe3b952cb30 100644 --- a/builtin/ls-tree.c +++ b/builtin/ls-tree.c @@ -5,6 +5,7 @@ */ #include "cache.h" #include "config.h" +#include "object-store.h" #include "blob.h" #include "tree.h" #include "commit.h" diff --git a/builtin/merge-tree.c b/builtin/merge-tree.c index 32736e0b101..1b702d44c9f 100644 --- a/builtin/merge-tree.c +++ b/builtin/merge-tree.c @@ -1,6 +1,7 @@ #include "builtin.h" #include "tree-walk.h" #include "xdiff-interface.h" +#include "object-store.h" #include "blob.h" #include "exec_cmd.h" #include "merge-blobs.h" diff --git a/builtin/mktag.c b/builtin/mktag.c index 82a6e860775..6fb7dc8578d 100644 --- a/builtin/mktag.c +++ b/builtin/mktag.c @@ -1,6 +1,7 @@ #include "builtin.h" #include "tag.h" #include "replace-object.h" +#include "object-store.h" /* * A signature file has a very simple fixed format: four lines diff --git a/builtin/mktree.c b/builtin/mktree.c index bb76b469fd1..2dc4ad6ba8f 100644 --- a/builtin/mktree.c +++ b/builtin/mktree.c @@ -7,6 +7,7 @@ #include "quote.h" #include "tree.h" #include "parse-options.h" +#include "object-store.h" static struct treeent { unsigned mode; diff --git a/builtin/notes.c b/builtin/notes.c index 921e08d5bf5..73b680ee13a 100644 --- a/builtin/notes.c +++ b/builtin/notes.c @@ -11,6 +11,7 @@ #include "config.h" #include "builtin.h" #include "notes.h" +#include "object-store.h" #include "blob.h" #include "pretty.h" #include "refs.h" diff --git a/builtin/prune.c b/builtin/prune.c index 518ffbea139..8cc8659612f 100644 --- a/builtin/prune.c +++ b/builtin/prune.c @@ -6,6 +6,7 @@ #include "reachable.h" #include "parse-options.h" #include "progress.h" +#include "object-store.h" static const char * const prune_usage[] = { N_("git prune [-n] [-v] [--progress] [--expire