git/shallow.c

#define USE_THE_REPOSITORY_VARIABLE

#include "git-compat-util.h"
#include "hex.h"
#include "repository.h"
#include "tempfile.h"
#include "lockfile.h"
#include "object-store-ll.h"
#include "commit.h"
#include "tag.h"
#include "pkt-line.h"
#include "refs.h"
#include "oid-array.h"
#include "path.h"
#include "diff.h"
#include "revision.h"
#include "commit-slab.h"
#include "list-objects.h"
#include "commit-reach.h"
#include "shallow.h"
#include "statinfo.h"
#include "trace.h"

void set_alternate_shallow_file(struct repository *r, const char *path, int override)
{}

int register_shallow(struct repository *r, const struct object_id *oid)
{}

int unregister_shallow(const struct object_id *oid)
{}

int is_repository_shallow(struct repository *r)
{}

static void reset_repository_shallow(struct repository *r)
{}

int commit_shallow_file(struct repository *r, struct shallow_lock *lk)
{}

void rollback_shallow_file(struct repository *r, struct shallow_lock *lk)
{}

/*
 * TODO: use "int" elemtype instead of "int *" when/if commit-slab
 * supports a "valid" flag.
 */
define_commit_slab(commit_depth, int *);
static void free_depth_in_slab(int **ptr)
{}
struct commit_list *get_shallow_commits(struct object_array *heads, int depth,
		int shallow_flag, int not_shallow_flag)
{}

static void show_commit(struct commit *commit, void *data)
{}

/*
 * Given rev-list arguments, run rev-list. All reachable commits
 * except border ones are marked with not_shallow_flag. Border commits
 * are marked with shallow_flag. The list of border/shallow commits
 * are also returned.
 */
struct commit_list *get_shallow_commits_by_rev_list(int ac, const char **av,
						    int shallow_flag,
						    int not_shallow_flag)
{}

static void check_shallow_file_for_update(struct repository *r)
{}

#define SEEN_ONLY
#define VERBOSE
#define QUICK

struct write_shallow_data {};

static int write_one_shallow(const struct commit_graft *graft, void *cb_data)
{}

static int write_shallow_commits_1(struct strbuf *out, int use_pack_protocol,
				   const struct oid_array *extra,
				   unsigned flags)
{}

int write_shallow_commits(struct strbuf *out, int use_pack_protocol,
			  const struct oid_array *extra)
{}

const char *setup_temporary_shallow(const struct oid_array *extra)
{}

void setup_alternate_shallow(struct shallow_lock *shallow_lock,
			     const char **alternate_shallow_file,
			     const struct oid_array *extra)
{}

static int advertise_shallow_grafts_cb(const struct commit_graft *graft, void *cb)
{}

void advertise_shallow_grafts(int fd)
{}

/*
 * mark_reachable_objects() should have been run prior to this and all
 * reachable commits marked as "SEEN", except when quick_prune is non-zero,
 * in which case lines are excised from the shallow file if they refer to
 * commits that do not exist (any longer).
 */
void prune_shallow(unsigned options)
{}

struct trace_key trace_shallow =;

/*
 * Step 1, split sender shallow commits into "ours" and "theirs"
 * Step 2, clean "ours" based on .git/shallow
 */
void prepare_shallow_info(struct shallow_info *info, struct oid_array *sa)
{}

void clear_shallow_info(struct shallow_info *info)
{}

/* Step 4, remove non-existent ones in "theirs" after getting the pack */

void remove_nonexistent_theirs_shallow(struct shallow_info *info)
{}

define_commit_slab(ref_bitmap, uint32_t *);

#define POOL_SIZE

struct paint_info {};

static uint32_t *paint_alloc(struct paint_info *info)
{}

/*
 * Given a commit SHA-1, walk down to parents until either SEEN,
 * UNINTERESTING or BOTTOM is hit. Set the id-th bit in ref_bitmap for
 * all walked commits.
 */
static void paint_down(struct paint_info *info, const struct object_id *oid,
		       unsigned int id)
{}

static int mark_uninteresting(const char *refname UNUSED,
			      const char *referent UNUSED,
			      const struct object_id *oid,
			      int flags UNUSED,
			      void *cb_data UNUSED)
{}

static void post_assign_shallow(struct shallow_info *info,
				struct ref_bitmap *ref_bitmap,
				int *ref_status);
/*
 * Step 6(+7), associate shallow commits with new refs
 *
 * info->ref must be initialized before calling this function.
 *
 * If used is not NULL, it's an array of info->shallow->nr
 * bitmaps. The n-th bit set in the m-th bitmap if ref[n] needs the
 * m-th shallow commit from info->shallow.
 *
 * If used is NULL, "ours" and "theirs" are updated. And if ref_status
 * is not NULL it's an array of ref->nr ints. ref_status[i] is true if
 * the ref needs some shallow commits from either info->ours or
 * info->theirs.
 */
void assign_shallow_commits_to_refs(struct shallow_info *info,
				    uint32_t **used, int *ref_status)
{}

struct commit_array {};

static int add_ref(const char *refname UNUSED,
		  const char *referent UNUSED,
		   const struct object_id *oid,
		   int flags UNUSED,
		   void *cb_data)
{}

static void update_refstatus(int *ref_status, int nr, uint32_t *bitmap)
{}

/*
 * Step 7, reachability test on "ours" at commit level
 */
static void post_assign_shallow(struct shallow_info *info,
				struct ref_bitmap *ref_bitmap,
				int *ref_status)
{}

/* (Delayed) step 7, reachability test at commit level */
int delayed_reachability_test(struct shallow_info *si, int c)
{}