#include "builtin.h"
#include "config.h"
#include "convert.h"
#include "diff.h"
#include "environment.h"
#include "gettext.h"
#include "hex.h"
#include "ident.h"
#include "parse-options.h"
#include "userdiff.h"
#include "streaming.h"
#include "oid-array.h"
#include "packfile.h"
#include "object-file.h"
#include "object-name.h"
#include "object-store-ll.h"
#include "replace-object.h"
#include "promisor-remote.h"
#include "mailmap.h"
#include "write-or-die.h"
enum batch_mode { … };
struct batch_options { … };
static const char *force_path;
static struct string_list mailmap = …;
static int use_mailmap;
static char *replace_idents_using_mailmap(char *, size_t *);
static char *replace_idents_using_mailmap(char *object_buf, size_t *size)
{ … }
static int filter_object(const char *path, unsigned mode,
const struct object_id *oid,
char **buf, unsigned long *size)
{ … }
static int stream_blob(const struct object_id *oid)
{ … }
static int cat_one_file(int opt, const char *exp_type, const char *obj_name,
int unknown_type)
{ … }
struct expand_data { … };
static int is_atom(const char *atom, const char *s, int slen)
{ … }
static int expand_atom(struct strbuf *sb, const char *atom, int len,
struct expand_data *data)
{ … }
static void expand_format(struct strbuf *sb, const char *start,
struct expand_data *data)
{ … }
static void batch_write(struct batch_options *opt, const void *data, int len)
{ … }
static void print_object_or_die(struct batch_options *opt, struct expand_data *data)
{ … }
static void print_default_format(struct strbuf *scratch, struct expand_data *data,
struct batch_options *opt)
{ … }
static void batch_object_write(const char *obj_name,
struct strbuf *scratch,
struct batch_options *opt,
struct expand_data *data,
struct packed_git *pack,
off_t offset)
{ … }
static void batch_one_object(const char *obj_name,
struct strbuf *scratch,
struct batch_options *opt,
struct expand_data *data)
{ … }
struct object_cb_data { … };
static int batch_object_cb(const struct object_id *oid, void *vdata)
{ … }
static int collect_loose_object(const struct object_id *oid,
const char *path UNUSED,
void *data)
{ … }
static int collect_packed_object(const struct object_id *oid,
struct packed_git *pack UNUSED,
uint32_t pos UNUSED,
void *data)
{ … }
static int batch_unordered_object(const struct object_id *oid,
struct packed_git *pack, off_t offset,
void *vdata)
{ … }
static int batch_unordered_loose(const struct object_id *oid,
const char *path UNUSED,
void *data)
{ … }
static int batch_unordered_packed(const struct object_id *oid,
struct packed_git *pack,
uint32_t pos,
void *data)
{ … }
parse_cmd_fn_t;
struct queued_cmd { … };
static void parse_cmd_contents(struct batch_options *opt,
const char *line,
struct strbuf *output,
struct expand_data *data)
{ … }
static void parse_cmd_info(struct batch_options *opt,
const char *line,
struct strbuf *output,
struct expand_data *data)
{ … }
static void dispatch_calls(struct batch_options *opt,
struct strbuf *output,
struct expand_data *data,
struct queued_cmd *cmd,
int nr)
{ … }
static void free_cmds(struct queued_cmd *cmd, size_t *nr)
{ … }
static const struct parse_cmd { … } commands[] = …;
static void batch_objects_command(struct batch_options *opt,
struct strbuf *output,
struct expand_data *data)
{ … }
#define DEFAULT_FORMAT …
static int batch_objects(struct batch_options *opt)
{ … }
static int git_cat_file_config(const char *var, const char *value,
const struct config_context *ctx, void *cb)
{ … }
static int batch_option_callback(const struct option *opt,
const char *arg,
int unset)
{ … }
int cmd_cat_file(int argc, const char **argv, const char *prefix)
{ … }