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.2 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 8843B1F51C for ; Thu, 17 May 2018 22:53:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751977AbeEQWwP (ORCPT ); Thu, 17 May 2018 18:52:15 -0400 Received: from mail-pf0-f180.google.com ([209.85.192.180]:45463 "EHLO mail-pf0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751610AbeEQWwM (ORCPT ); Thu, 17 May 2018 18:52:12 -0400 Received: by mail-pf0-f180.google.com with SMTP id c10-v6so2768570pfi.12 for ; Thu, 17 May 2018 15:52:12 -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=LZ+Kv8tkLy22uMCdbGHJw60ytrCBt9QbbmWdd5nRHrY=; b=PgI0rH7T+/RhTJzlgzmgLelSg1rjiAKXbDeLkyQ1fSFn/M3SfA5+1UKWvDqfAWzMPE ux3bfZf10+YeSyBBrcIjeSNR5BuOrMffq7F7Ep1BOplgDqyzMyIoZQM+jA+qZtH2VxY7 IsBTEc3rkmiQl5Mo5wD3GuT/Rtj3tvL/7Rm0wbEuL38rX8+Qrfo2Pca2mumTeXFuWxut Rp/DB3C4/2mLrfNqCX9k1d3VNnshnaomS2By3sWEEtEwuAYITJb22a0tc+pdg6mY5/xj bd+sowLzCDCemsvgBhROk7ZHo+hlXYWWCdQVBDOV25NLO8qN4xwHL2aQ/qgrM9EM3WWm zi3A== 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=LZ+Kv8tkLy22uMCdbGHJw60ytrCBt9QbbmWdd5nRHrY=; b=MWRBLyl9I015MVjsahrQYlrhTkn48/Tv2SWOoAEksZMyOAVLeaZRv1jCCt1w4FN5Vv pOqCS+MSUxZXEUEGkVZki/hB3Ybfsn33MucHANX+hTfI23dh9BGoVb182KFeAjlxxXjl Pe/Wq6qOnhyzrcBWOrBDVe6DKwW+Fh8O6PZktlez99PioAcwpv0Domifgf27kb6/oyF4 CnZjabR3G04VseWzxmCtpPrIsvMrxm1XPTdhGSzsqnC3klLZSXrYiJ5sGlWbOt/Om3TM 5lM+eYCf78pEwq6cXWNecqYlk3E84Nq7GOA4grtPOS5OvkPfIRo76r1fjqS3+iG7pGh5 44Lw== X-Gm-Message-State: ALKqPwcCNFj9eT1GLtwThoqyiCsAB0wTFB7/gXGWe5IHRFHrQzY0akOv 1b1Ey1es65Gok76sV7JrpST732W3X/w= X-Google-Smtp-Source: AB8JxZpFTZQENDTavdbBA1G5pXP1MV928vsFy8Gb7ufB1f6f99BUDJDyYADwPafxlTmy8roa5Y50+Q== X-Received: by 2002:a62:4a88:: with SMTP id c8-v6mr6885795pfj.23.1526597531152; Thu, 17 May 2018 15:52:11 -0700 (PDT) Received: from localhost ([2620:0:100e:422:ea58:fa52:fa77:9b41]) by smtp.gmail.com with ESMTPSA id k63-v6sm14654643pfk.90.2018.05.17.15.52.08 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 17 May 2018 15:52:08 -0700 (PDT) From: Stefan Beller To: sbeller@google.com Cc: git@vger.kernel.org, Junio C Hamano Subject: [PATCH 01/19] object-store: move object access functions to object-store.h Date: Thu, 17 May 2018 15:51:36 -0700 Message-Id: <20180517225154.9200-2-sbeller@google.com> X-Mailer: git-send-email 2.17.0.582.gccdcbd54c44.dirty In-Reply-To: <20180517225154.9200-1-sbeller@google.com> References: <20180515234233.143708-1-sbeller@google.com> <20180517225154.9200-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 Signed-off-by: Junio C Hamano --- 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