git/builtin/clean.c

/*
 * "git clean" builtin command
 *
 * Copyright (C) 2007 Shawn Bohrer
 *
 * Based on git-clean.sh by Pavel Roskin
 */
#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "abspath.h"
#include "config.h"
#include "dir.h"
#include "gettext.h"
#include "parse-options.h"
#include "path.h"
#include "read-cache-ll.h"
#include "setup.h"
#include "string-list.h"
#include "quote.h"
#include "column.h"
#include "color.h"
#include "pathspec.h"
#include "help.h"
#include "prompt.h"

static int require_force =; /* unset */
static int interactive;
static struct string_list del_list =;
static unsigned int colopts;

static const char *const builtin_clean_usage[] =;

static const char *msg_remove =);
static const char *msg_would_remove =);
static const char *msg_skip_git_dir =);
static const char *msg_would_skip_git_dir =);
static const char *msg_warn_remove_failed =);
static const char *msg_warn_lstat_failed =);
static const char *msg_skip_cwd =);
static const char *msg_would_skip_cwd =);

enum color_clean {};

static const char *color_interactive_slots[] =;

static int clean_use_color =;
static char clean_colors[][COLOR_MAXLEN] =;

#define MENU_OPTS_SINGLETON
#define MENU_OPTS_IMMEDIATE
#define MENU_OPTS_LIST_ONLY

struct menu_opts {};

#define MENU_RETURN_NO_LOOP

struct menu_item {};

enum menu_stuff_type {};

struct menu_stuff {};

define_list_config_array();

static int git_clean_config(const char *var, const char *value,
			    const struct config_context *ctx, void *cb)
{}

static const char *clean_get_color(enum color_clean ix)
{}

static void clean_print_color(enum color_clean ix)
{}

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

static int remove_dirs(struct strbuf *path, const char *prefix, int force_flag,
		int dry_run, int quiet, int *dir_gone)
{}

static void pretty_print_dels(void)
{}

static void pretty_print_menus(struct string_list *menu_list)
{}

static void prompt_help_cmd(int singleton)
{}

/*
 * display menu stuff with number prefix and hotkey highlight
 */
static void print_highlight_menu_stuff(struct menu_stuff *stuff, int **chosen)
{}

static int find_unique(const char *choice, struct menu_stuff *menu_stuff)
{}

/*
 * Parse user input, and return choice(s) for menu (menu_stuff).
 *
 * Input
 *     (for single choice)
 *         1          - select a numbered item
 *         foo        - select item based on menu title
 *                    - (empty) select nothing
 *
 *     (for multiple choice)
 *         1          - select a single item
 *         3-5        - select a range of items
 *         2-3,6-9    - select multiple ranges
 *         foo        - select item based on menu title
 *         -...       - unselect specified items
 *         *          - choose all items
 *                    - (empty) finish selecting
 *
 * The parse result will be saved in array **chosen, and
 * return number of total selections.
 */
static int parse_choice(struct menu_stuff *menu_stuff,
			int is_single,
			struct strbuf input,
			int **chosen)
{}

/*
 * Implement a git-add-interactive compatible UI, which is borrowed
 * from add-interactive.c.
 *
 * Return value:
 *
 *   - Return an array of integers
 *   - , and it is up to you to free the allocated memory.
 *   - The array ends with EOF.
 *   - If user pressed CTRL-D (i.e. EOF), no selection returned.
 */
static int *list_and_choose(struct menu_opts *opts, struct menu_stuff *stuff)
{}

static int clean_cmd(void)
{}

static int filter_by_patterns_cmd(void)
{}

static int select_by_numbers_cmd(void)
{}

static int ask_each_cmd(void)
{}

static int quit_cmd(void)
{}

static int help_cmd(void)
{}

static void interactive_main_loop(void)
{}

static void correct_untracked_entries(struct dir_struct *dir)
{}

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