git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
blob ca1dceed375339395ea435fac949a1cd82f2ead5 3249 bytes (raw)
name: apply.h 	 # note: path name is non-authoritative(*)

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
 
#ifndef APPLY_H
#define APPLY_H

enum apply_ws_error_action {
	nowarn_ws_error,
	warn_on_ws_error,
	die_on_ws_error,
	correct_ws_error
};

enum apply_ws_ignore {
	ignore_ws_none,
	ignore_ws_change
};

/*
 * We need to keep track of how symlinks in the preimage are
 * manipulated by the patches.  A patch to add a/b/c where a/b
 * is a symlink should not be allowed to affect the directory
 * the symlink points at, but if the same patch removes a/b,
 * it is perfectly fine, as the patch removes a/b to make room
 * to create a directory a/b so that a/b/c can be created.
 *
 * See also "struct string_list symlink_changes" in "struct
 * apply_state".
 */
#define APPLY_SYMLINK_GOES_AWAY 01
#define APPLY_SYMLINK_IN_RESULT 02

struct apply_state {
	const char *prefix;
	int prefix_length;

	/* These are lock_file related */
	struct lock_file *lock_file;
	int newfd;

	/* These control what gets looked at and modified */
	int apply; /* this is not a dry-run */
	int cached; /* apply to the index only */
	int check; /* preimage must match working tree, don't actually apply */
	int check_index; /* preimage must match the indexed version */
	int update_index; /* check_index && apply */

	/* These control cosmetic aspect of the output */
	int diffstat; /* just show a diffstat, and don't actually apply */
	int numstat; /* just show a numeric diffstat, and don't actually apply */
	int summary; /* just report creation, deletion, etc, and don't actually apply */

	/* These boolean parameters control how the apply is done */
	int allow_overlap;
	int apply_in_reverse;
	int apply_with_reject;
	int apply_verbosely;
	int no_add;
	int threeway;
	int unidiff_zero;
	int unsafe_paths;

	/* Other non boolean parameters */
	const char *fake_ancestor;
	const char *patch_input_file;
	int line_termination;
	struct strbuf root;
	int p_value;
	int p_value_known;
	unsigned int p_context;

	/* Exclude and include path parameters */
	struct string_list limit_by_name;
	int has_include;

	/* Various "current state" */
	int linenr; /* current line number */
	struct string_list symlink_changes; /* we have to track symlinks */

	/*
	 * For "diff-stat" like behaviour, we keep track of the biggest change
	 * we've seen, and the longest filename. That allows us to do simple
	 * scaling.
	 */
	int max_change;
	int max_len;

	/*
	 * Records filenames that have been touched, in order to handle
	 * the case where more than one patches touch the same file.
	 */
	struct string_list fn_table;

	/* These control whitespace errors */
	enum apply_ws_error_action ws_error_action;
	enum apply_ws_ignore ws_ignore_action;
	const char *whitespace_option;
	int whitespace_error;
	int squelch_whitespace_errors;
	int applied_after_fixing_ws;
};

extern int parse_whitespace_option(struct apply_state *state,
				   const char *option);
extern int parse_ignorewhitespace_option(struct apply_state *state,
					 const char *option);

extern int init_apply_state(struct apply_state *state,
			    const char *prefix,
			    struct lock_file *lock_file);
extern void clear_apply_state(struct apply_state *state);
extern int check_apply_state(struct apply_state *state, int force_apply);

#define APPLY_OPT_INACCURATE_EOF	(1<<0)
#define APPLY_OPT_RECOUNT		(1<<1)

#endif

debug log:

solving ca1dcee ...
found ca1dcee in https://public-inbox.org/git/20160808210337.5038-30-chriscool@tuxfamily.org/ ||
	https://public-inbox.org/git/20160730172509.22939-30-chriscool@tuxfamily.org/ ||
	https://public-inbox.org/git/20160627182429.31550-30-chriscool@tuxfamily.org/ ||
	https://public-inbox.org/git/20160827184547.4365-3-chriscool@tuxfamily.org/ ||
	https://public-inbox.org/git/20160811184501.384-3-chriscool@tuxfamily.org/
found 53f09b5 in https://80x24.org/mirrors/git.git
preparing index
index prepared:
100644 53f09b5a45afc1109d1f13f1393c4af9f9c15bfe	apply.h

applying [1/1] https://public-inbox.org/git/20160808210337.5038-30-chriscool@tuxfamily.org/
diff --git a/apply.h b/apply.h
index 53f09b5..ca1dcee 100644

Checking patch apply.h...
Applied patch apply.h cleanly.

skipping https://public-inbox.org/git/20160730172509.22939-30-chriscool@tuxfamily.org/ for ca1dcee
skipping https://public-inbox.org/git/20160627182429.31550-30-chriscool@tuxfamily.org/ for ca1dcee
skipping https://public-inbox.org/git/20160827184547.4365-3-chriscool@tuxfamily.org/ for ca1dcee
skipping https://public-inbox.org/git/20160811184501.384-3-chriscool@tuxfamily.org/ for ca1dcee
index at:
100644 ca1dceed375339395ea435fac949a1cd82f2ead5	apply.h

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).