git/builtin/fast-export.c

/*
 * "git fast-export" builtin command
 *
 * Copyright (C) 2007 Johannes E. Schindelin
 */
#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "config.h"
#include "gettext.h"
#include "hex.h"
#include "refs.h"
#include "refspec.h"
#include "object-file.h"
#include "object-store-ll.h"
#include "commit.h"
#include "object.h"
#include "tag.h"
#include "diff.h"
#include "diffcore.h"
#include "log-tree.h"
#include "revision.h"
#include "decorate.h"
#include "string-list.h"
#include "utf8.h"
#include "parse-options.h"
#include "quote.h"
#include "remote.h"
#include "blob.h"

static const char *fast_export_usage[] =;

static int progress;
static enum signed_tag_mode {} signed_tag_mode =;
static enum tag_of_filtered_mode {} tag_of_filtered_mode =;
static enum reencode_mode {} reencode_mode =;
static int fake_missing_tagger;
static int use_done_feature;
static int no_data;
static int full_tree;
static int reference_excluded_commits;
static int show_original_ids;
static int mark_tags;
static struct string_list extra_refs =;
static struct string_list tag_refs =;
static struct refspec refspecs =;
static int anonymize;
static struct hashmap anonymized_seeds;
static struct revision_sources revision_sources;

static int parse_opt_signed_tag_mode(const struct option *opt,
				     const char *arg, int unset)
{}

static int parse_opt_tag_of_filtered_mode(const struct option *opt,
					  const char *arg, int unset)
{}

static int parse_opt_reencode_mode(const struct option *opt,
				   const char *arg, int unset)
{}

static struct decoration idnums;
static uint32_t last_idnum;
struct anonymized_entry {};

struct anonymized_entry_key {};

static int anonymized_entry_cmp(const void *cmp_data UNUSED,
				const struct hashmap_entry *eptr,
				const struct hashmap_entry *entry_or_key,
				const void *keydata)
{}

static struct anonymized_entry *add_anonymized_entry(struct hashmap *map,
						     unsigned hash,
						     const char *orig, size_t len,
						     char *anon)
{}

/*
 * Basically keep a cache of X->Y so that we can repeatedly replace
 * the same anonymized string with another. The actual generation
 * is farmed out to the generate function.
 */
static const char *anonymize_str(struct hashmap *map,
				 char *(*generate)(void),
				 const char *orig, size_t len)
{}

/*
 * We anonymize each component of a path individually,
 * so that paths a/b and a/c will share a common root.
 * The paths are cached via anonymize_mem so that repeated
 * lookups for "a" will yield the same value.
 */
static void anonymize_path(struct strbuf *out, const char *path,
			   struct hashmap *map,
			   char *(*generate)(void))
{}

static inline void *mark_to_ptr(uint32_t mark)
{}

static inline uint32_t ptr_to_mark(void * mark)
{}

static inline void mark_object(struct object *object, uint32_t mark)
{}

static inline void mark_next_object(struct object *object)
{}

static int get_object_mark(struct object *object)
{}

static struct commit *rewrite_commit(struct commit *p)
{}

static void show_progress(void)
{}

/*
 * Ideally we would want some transformation of the blob data here
 * that is unreversible, but would still be the same size and have
 * the same data relationship to other blobs (so that we get the same
 * delta and packing behavior as the original). But the first and last
 * requirements there are probably mutually exclusive, so let's take
 * the easy way out for now, and just generate arbitrary content.
 *
 * 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 void export_blob(const struct object_id *oid)
{}

static int depth_first(const void *a_, const void *b_)
{}

static void print_path_1(const char *path)
{}

static char *anonymize_path_component(void)
{}

static void print_path(const char *path)
{}

static char *generate_fake_oid(void)
{}

static const char *anonymize_oid(const char *oid_hex)
{}

static void show_filemodify(struct diff_queue_struct *q,
			    struct diff_options *options UNUSED, void *data)
{}

static const char *find_encoding(const char *begin, const char *end)
{}

static char *anonymize_ref_component(void)
{}

static const char *anonymize_refname(const char *refname)
{}

/*
 * We do not even bother to cache commit messages, as they are unlikely
 * to be repeated verbatim, and it is not that interesting when they are.
 */
static char *anonymize_commit_message(void)
{}

static char *anonymize_ident(void)
{}

/*
 * Our strategy here is to anonymize the names and email addresses,
 * but keep timestamps intact, as they influence things like traversal
 * order (and by themselves should not be too revealing).
 */
static void anonymize_ident_line(const char **beg, const char **end)
{}

static void handle_commit(struct commit *commit, struct rev_info *rev,
			  struct string_list *paths_of_changed_objects)
{}

static char *anonymize_tag(void)
{}


static void handle_tag(const char *name, struct tag *tag)
{}

static struct commit *get_commit(struct rev_cmdline_entry *e, const char *full_name)
{}

static void get_tags_and_duplicates(struct rev_cmdline_info *info)
{}

static void handle_tags_and_duplicates(struct string_list *extras)
{}

static void export_marks(char *file)
{}

static void import_marks(char *input_file, int check_exists)
{}

static void handle_deletes(void)
{}

static int parse_opt_anonymize_map(const struct option *opt,
				   const char *arg, int unset)
{}

int cmd_fast_export(int argc,
		    const char **argv,
		    const char *prefix,
		    struct repository *repo UNUSED)
{}