git/wt-status.c

#define USE_THE_REPOSITORY_VARIABLE

#include "git-compat-util.h"
#include "advice.h"
#include "wt-status.h"
#include "object.h"
#include "dir.h"
#include "commit.h"
#include "diff.h"
#include "environment.h"
#include "gettext.h"
#include "hash.h"
#include "hex.h"
#include "object-name.h"
#include "path.h"
#include "revision.h"
#include "diffcore.h"
#include "quote.h"
#include "repository.h"
#include "run-command.h"
#include "strvec.h"
#include "remote.h"
#include "refs.h"
#include "submodule.h"
#include "column.h"
#include "read-cache.h"
#include "setup.h"
#include "strbuf.h"
#include "trace.h"
#include "trace2.h"
#include "tree.h"
#include "utf8.h"
#include "worktree.h"
#include "lockfile.h"
#include "sequencer.h"
#include "fsmonitor-settings.h"

#define AB_DELAY_WARNING_IN_MS
#define UF_DELAY_WARNING_IN_MS

static const char cut_line[] =;

static char default_wt_status_colors[][COLOR_MAXLEN] =;

static const char *color(int slot, struct wt_status *s)
{}

static void status_vprintf(struct wt_status *s, int at_bol, const char *color,
		const char *fmt, va_list ap, const char *trail)
{}

void status_printf_ln(struct wt_status *s, const char *color,
			const char *fmt, ...)
{}

void status_printf(struct wt_status *s, const char *color,
			const char *fmt, ...)
{}

__attribute__((format (printf, 3, 4)))
static void status_printf_more(struct wt_status *s, const char *color,
			       const char *fmt, ...)
{}

void wt_status_prepare(struct repository *r, struct wt_status *s)
{}

static void wt_longstatus_print_unmerged_header(struct wt_status *s)
{}

static void wt_longstatus_print_cached_header(struct wt_status *s)
{}

static void wt_longstatus_print_dirty_header(struct wt_status *s,
					     int has_deleted,
					     int has_dirty_submodules)
{}

static void wt_longstatus_print_other_header(struct wt_status *s,
					     const char *what,
					     const char *how)
{}

static void wt_longstatus_print_trailer(struct wt_status *s)
{}

static const char *wt_status_unmerged_status_string(int stagemask)
{}

static const char *wt_status_diff_status_string(int status)
{}

static int maxwidth(const char *(*label)(int), int minval, int maxval)
{}

static void wt_longstatus_print_unmerged_data(struct wt_status *s,
					      struct string_list_item *it)
{}

static void wt_longstatus_print_change_data(struct wt_status *s,
					    int change_type,
					    struct string_list_item *it)
{}

static char short_submodule_status(struct wt_status_change_data *d)
{}

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

static int unmerged_mask(struct index_state *istate, const char *path)
{}

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

static void wt_status_collect_changes_worktree(struct wt_status *s)
{}

static void wt_status_collect_changes_index(struct wt_status *s)
{}

static int add_file_to_list(const struct object_id *oid,
			    struct strbuf *base, const char *path,
			    unsigned int mode, void *context)
{}

static void wt_status_collect_changes_initial(struct wt_status *s)
{}

static void wt_status_collect_untracked(struct wt_status *s)
{}

static int has_unmerged(struct wt_status *s)
{}

void wt_status_collect(struct wt_status *s)
{}

void wt_status_collect_free_buffers(struct wt_status *s)
{}

void wt_status_state_free_buffers(struct wt_status_state *state)
{}

static void wt_longstatus_print_unmerged(struct wt_status *s)
{}

static void wt_longstatus_print_updated(struct wt_status *s)
{}

/*
 * -1 : has delete
 *  0 : no change
 *  1 : some change but no delete
 */
static int wt_status_check_worktree_changes(struct wt_status *s,
					     int *dirty_submodules)
{}

static void wt_longstatus_print_changed(struct wt_status *s)
{}

static int stash_count_refs(struct object_id *ooid UNUSED,
			    struct object_id *noid UNUSED,
			    const char *email UNUSED,
			    timestamp_t timestamp UNUSED, int tz UNUSED,
			    const char *message UNUSED, void *cb_data)
{}

static int count_stash_entries(void)
{}

static void wt_longstatus_print_stash_summary(struct wt_status *s)
{}

static void wt_longstatus_print_submodule_summary(struct wt_status *s, int uncommitted)
{}

static void wt_longstatus_print_other(struct wt_status *s,
				      struct string_list *l,
				      const char *what,
				      const char *how)
{}

size_t wt_status_locate_end(const char *s, size_t len)
{}

void wt_status_append_cut_line(struct strbuf *buf)
{}

void wt_status_add_cut_line(struct wt_status *s)
{}

static void wt_longstatus_print_verbose(struct wt_status *s)
{}

static void wt_longstatus_print_tracking(struct wt_status *s)
{}

static int uf_was_slow(struct wt_status *s)
{}

static void show_merge_in_progress(struct wt_status *s,
				   const char *color)
{}

static void show_am_in_progress(struct wt_status *s,
				const char *color)
{}

static char *read_line_from_git_path(const char *filename)
{}

static int split_commit_in_progress(struct wt_status *s)
{}

/*
 * Turn
 * "pick d6a2f0303e897ec257dd0e0a39a5ccb709bc2047 some message"
 * into
 * "pick d6a2f03 some message"
 *
 * The function assumes that the line does not contain useless spaces
 * before or after the command.
 */
static void abbrev_oid_in_line(struct strbuf *line)
{}

static int read_rebase_todolist(const char *fname, struct string_list *lines)
{}

static void show_rebase_information(struct wt_status *s,
				    const char *color)
{}

static void print_rebase_state(struct wt_status *s,
			       const char *color)
{}

static void show_rebase_in_progress(struct wt_status *s,
				    const char *color)
{}

static void show_cherry_pick_in_progress(struct wt_status *s,
					 const char *color)
{}

static void show_revert_in_progress(struct wt_status *s,
				    const char *color)
{}

static void show_bisect_in_progress(struct wt_status *s,
				    const char *color)
{}

static void show_sparse_checkout_in_use(struct wt_status *s,
					const char *color)
{}

/*
 * Extract branch information from rebase/bisect
 */
static char *get_branch(const struct worktree *wt, const char *path)
{}

struct grab_1st_switch_cbdata {};

static int grab_1st_switch(struct object_id *ooid UNUSED,
			   struct object_id *noid,
			   const char *email UNUSED,
			   timestamp_t timestamp UNUSED, int tz UNUSED,
			   const char *message, void *cb_data)
{}

static void wt_status_get_detached_from(struct repository *r,
					struct wt_status_state *state)
{}

int wt_status_check_rebase(const struct worktree *wt,
			   struct wt_status_state *state)
{}

int wt_status_check_bisect(const struct worktree *wt,
			   struct wt_status_state *state)
{}

static void wt_status_check_sparse_checkout(struct repository *r,
					    struct wt_status_state *state)
{}

void wt_status_get_state(struct repository *r,
			 struct wt_status_state *state,
			 int get_detached_from)
{}

static void wt_longstatus_print_state(struct wt_status *s)
{}

static void wt_longstatus_print(struct wt_status *s)
{}

static void wt_shortstatus_unmerged(struct string_list_item *it,
			   struct wt_status *s)
{}

static void wt_shortstatus_status(struct string_list_item *it,
			 struct wt_status *s)
{}

static void wt_shortstatus_other(struct string_list_item *it,
				 struct wt_status *s, const char *sign)
{}

static void wt_shortstatus_print_tracking(struct wt_status *s)
{}

static void wt_shortstatus_print(struct wt_status *s)
{}

static void wt_porcelain_print(struct wt_status *s)
{}

/*
 * Print branch information for porcelain v2 output.  These lines
 * are printed when the '--branch' parameter is given.
 *
 *    # branch.oid <commit><eol>
 *    # branch.head <head><eol>
 *   [# branch.upstream <upstream><eol>
 *   [# branch.ab +<ahead> -<behind><eol>]]
 *
 *      <commit> ::= the current commit hash or the literal
 *                   "(initial)" to indicate an initialized repo
 *                   with no commits.
 *
 *        <head> ::= <branch_name> the current branch name or
 *                   "(detached)" literal when detached head or
 *                   "(unknown)" when something is wrong.
 *
 *    <upstream> ::= the upstream branch name, when set.
 *
 *       <ahead> ::= integer ahead value or '?'.
 *
 *      <behind> ::= integer behind value or '?'.
 *
 * The end-of-line is defined by the -z flag.
 *
 *                 <eol> ::= NUL when -z,
 *                           LF when NOT -z.
 *
 * When an upstream is set and present, the 'branch.ab' line will
 * be printed with the ahead/behind counts for the branch and the
 * upstream.  When AHEAD_BEHIND_QUICK is requested and the branches
 * are different, '?' will be substituted for the actual count.
 */
static void wt_porcelain_v2_print_tracking(struct wt_status *s)
{}

/*
 * Print the stash count in a porcelain-friendly format
 */
static void wt_porcelain_v2_print_stash(struct wt_status *s)
{}

/*
 * Convert various submodule status values into a
 * fixed-length string of characters in the buffer provided.
 */
static void wt_porcelain_v2_submodule_state(
	struct wt_status_change_data *d,
	char sub[5])
{}

/*
 * Fix-up changed entries before we print them.
 */
static void wt_porcelain_v2_fix_up_changed(struct string_list_item *it)
{}

/*
 * Print porcelain v2 info for tracked entries with changes.
 */
static void wt_porcelain_v2_print_changed_entry(
	struct string_list_item *it,
	struct wt_status *s)
{}

/*
 * Print porcelain v2 status info for unmerged entries.
 */
static void wt_porcelain_v2_print_unmerged_entry(
	struct string_list_item *it,
	struct wt_status *s)
{}

/*
 * Print porcelain V2 status info for untracked and ignored entries.
 */
static void wt_porcelain_v2_print_other(
	struct string_list_item *it,
	struct wt_status *s,
	char prefix)
{}

/*
 * Print porcelain V2 status.
 *
 * [<v2_branch>]
 * [<v2_changed_items>]*
 * [<v2_unmerged_items>]*
 * [<v2_untracked_items>]*
 * [<v2_ignored_items>]*
 *
 */
static void wt_porcelain_v2_print(struct wt_status *s)
{}

void wt_status_print(struct wt_status *s)
{}

/**
 * Returns 1 if there are unstaged changes, 0 otherwise.
 */
int has_unstaged_changes(struct repository *r, int ignore_submodules)
{}

/**
 * Returns 1 if there are uncommitted changes, 0 otherwise.
 */
int has_uncommitted_changes(struct repository *r,
			    int ignore_submodules)
{}

/**
 * If the work tree has unstaged or uncommitted changes, dies with the
 * appropriate message.
 */
int require_clean_work_tree(struct repository *r,
			    const char *action,
			    const char *hint,
			    int ignore_submodules,
			    int gently)
{}