<commit_before>/*
 * apply.c
 *
 * Copyright (C) <NAME>, 2005
 *
 * This applies patches on top of some (arbitrary) version of the SCM.
 *
 */
#include <fnmatch.h>
#include "cache.h"
#include "quote.h"

//  --check turns on checking that the working tree matches the
//    files that are being modified, but doesn't apply the patch
//  --stat does just a diffstat, and doesn't actually apply
//  --numstat does numeric diffstat, and doesn't actually apply
//  --index-info shows the old and new index info for paths if available.
//
static const char *prefix;
static int prefix_length = -1;

static int p_value = 1;
static int allow_binary_replacement = 0;
static int check_index = 0;
static int write_index = 0;
static int diffstat = 0;
static int numstat = 0;
static int summary = 0;
static int check = 0;
static int apply = 1;
static int no_add = 0;
static int show_index_info = 0;
static int line_termination = '\n';
static const char apply_usage[] =
"git-apply [--stat] [--numstat] [--summary] [--check] [--index] [--apply] [--no-add] [--index-info] [--allow-binary-replacement] [-z] [-pNUM] <patch>...";

static enum whitespace_eol {
	nowarn_whitespace,
	warn_on_whitespace,
	error_on_whitespace,
	strip_whitespace,
} new_whitespace = nowarn_whitespace;
static int whitespace_error = 0;
static int squelch_whitespace_errors = 5;
static int applied_after_stripping = 0;
static const char *patch_input_file = NULL;

static void parse_whitespace_option(const char *option)
{
	if (!option) {
		new_whitespace = nowarn_whitespace;
		return;
	}
	if (!strcmp(option, "warn")) {
		new_whitespace = warn_on_whitespace;
		return;
	}
	if (!strcmp(option, "error")) {
		new_whitespace = error_on_whitespace;
		return;
	}
	if (!strcmp(option, "error-all")) {
		new_whitespace = error_on_whitespace;<commit_msg>git-apply --whitespace=nowarn<commit_after>/*
 * apply.c
 *
 * Copyright (C) <NAME>, 2005
 *
 * This applies patches on top of some (arbitrary) version of the SCM.
 *
 */
#include <fnmatch.h>
#include "cache.h"
#include "quote.h"

//  --check turns on checking that the working tree matches the
//    files that are being modified, but doesn't apply the patch
//  --stat does just a diffstat, and doesn't actually apply
//  --numstat does numeric diffstat, and doesn't actually apply
//  --index-info shows the old and new index info for paths if available.
//
static const char *prefix;
static int prefix_length = -1;

static int p_value = 1;
static int allow_binary_replacement = 0;
static int check_index = 0;
static int write_index = 0;
static int diffstat = 0;
static int numstat = 0;
static int summary = 0;
static int check = 0;
static int apply = 1;
static int no_add = 0;
static int show_index_info = 0;
static int line_termination = '\n';
static const char apply_usage[] =
"git-apply [--stat] [--numstat] [--summary] [--check] [--index] [--apply] [--no-add] [--index-info] [--allow-binary-replacement] [-z] [-pNUM] <patch>...";

static enum whitespace_eol {
	nowarn_whitespace,
	warn_on_whitespace,
	error_on_whitespace,
	strip_whitespace,
} new_whitespace = warn_on_whitespace;
static int whitespace_error = 0;
static int squelch_whitespace_errors = 5;
static int applied_after_stripping = 0;
static const char *patch_input_file = NULL;

static void parse_whitespace_option(const char *option)
{
	if (!option) {
		new_whitespace = warn_on_whitespace;
		return;
	}
	if (!strcmp(option, "warn")) {
		new_whitespace = warn_on_whitespace;
		return;
	}
	if (!strcmp(option, "nowarn")) {
		new_whitespace = nowarn_whitespace;
		return;
	}
	if (!strcmp(option, "error")) {
		new_whitespace = error_on_whitespace;
		return;
	}
	if (!strcmp(option, "error-all")) {
		new_whitespace = error_on_whitespace;
{'fraction_non_alphanumeric': 0.12267457535723915, 'fraction_numerical': 0.010245349150714478, 'mean_word_length': 4.196078431372549, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2661054', 'n_tokens_mistral': 1341, 'n_tokens_neox': 1282, 'n_words': 404}