git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / mirror / code / Atom feed
115d00288fdee874c19f671955a23725442caad8 blob 5356 bytes (raw)

  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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
 
#ifndef REF_FILTER_H
#define REF_FILTER_H

#include "sha1-array.h"
#include "refs.h"
#include "commit.h"
#include "parse-options.h"

/* Quoting styles */
#define QUOTE_NONE 0
#define QUOTE_SHELL 1
#define QUOTE_PERL 2
#define QUOTE_PYTHON 4
#define QUOTE_TCL 8

#define FILTER_REFS_INCLUDE_BROKEN 0x0001
#define FILTER_REFS_TAGS           0x0002
#define FILTER_REFS_BRANCHES       0x0004
#define FILTER_REFS_REMOTES        0x0008
#define FILTER_REFS_OTHERS         0x0010
#define FILTER_REFS_ALL            (FILTER_REFS_TAGS | FILTER_REFS_BRANCHES | \
				    FILTER_REFS_REMOTES | FILTER_REFS_OTHERS)
#define FILTER_REFS_DETACHED_HEAD  0x0020
#define FILTER_REFS_KIND_MASK      (FILTER_REFS_ALL | FILTER_REFS_DETACHED_HEAD)

struct atom_value;

struct ref_sorting {
	struct ref_sorting *next;
	int atom; /* index into used_atom array (internal) */
	unsigned reverse : 1,
		ignore_case : 1,
		version : 1;
};

struct ref_array_item {
	struct object_id oid;
	int flag;
	unsigned int kind;
	const char *symref;
	struct commit *commit;
	struct atom_value *value;
	enum object_type type;
	unsigned long size;
	off_t disk_size;
	const char *rest;
	struct object_id *delta_base_oid;
	const char *objectname;
	char refname[FLEX_ARRAY];
};

struct ref_array {
	int nr, alloc;
	struct ref_array_item **items;
	struct rev_info *revs;
};

struct ref_filter {
	const char **name_patterns;
	struct oid_array points_at;
	struct commit_list *with_commit;
	struct commit_list *no_commit;

	enum {
		REF_FILTER_MERGED_NONE = 0,
		REF_FILTER_MERGED_INCLUDE,
		REF_FILTER_MERGED_OMIT
	} merge;
	struct commit *merge_commit;

	unsigned int with_commit_tag_algo : 1,
		match_as_path : 1,
		ignore_case : 1,
		detached : 1;
	unsigned int kind,
		lines;
	int abbrev,
		verbose;
};

struct expand_data {
	struct object_id oid;
	enum object_type type;
	unsigned long size;
	off_t disk_size;
	const char *rest;
	struct object_id delta_base_oid;

	/*
	 * After a mark_query run, this object_info is set up to be
	 * passed to sha1_object_info_extended. It will point to the data
	 * elements above, so you can retrieve the response from there.
	 */
	struct object_info info;

	/*
	 * This flag will be true if the requested batch format and options
	 * don't require us to call sha1_object_info, which can then be
	 * optimized out.
	 */
	unsigned skip_object_info : 1;
	unsigned is_cat_file : 1;
};

struct ref_format {
	/*
	 * Set these to define the format; make sure you call
	 * verify_ref_format() afterwards to finalize.
	 */
	const char *format;
	int quote_style;
	int use_color;

	/* Internal state to ref-filter */
	int need_color_reset_at_eol;

	unsigned all_objects : 1;
	unsigned is_cat_file : 1;
};

#define REF_FORMAT_INIT { NULL, 0, -1 }

/*  Macros for checking --merged and --no-merged options */
#define _OPT_MERGED_NO_MERGED(option, filter, h) \
	{ OPTION_CALLBACK, 0, option, (filter), N_("commit"), (h), \
	  PARSE_OPT_LASTARG_DEFAULT | PARSE_OPT_NONEG, \
	  parse_opt_merge_filter, (intptr_t) "HEAD" \
	}
#define OPT_MERGED(f, h) _OPT_MERGED_NO_MERGED("merged", f, h)
#define OPT_NO_MERGED(f, h) _OPT_MERGED_NO_MERGED("no-merged", f, h)

/*
 * API for filtering a set of refs. Based on the type of refs the user
 * has requested, we iterate through those refs and apply filters
 * as per the given ref_filter structure and finally store the
 * filtered refs in the ref_array structure.
 */
int filter_refs(struct ref_array *array, struct ref_filter *filter, unsigned int type);
/*  Clear all memory allocated to ref_array */
void ref_array_clear(struct ref_array *array);
/*  Used to verify if the given format is correct and to parse out the used atoms */
int verify_ref_format(struct ref_format *format);
/*  Sort the given ref_array as per the ref_sorting provided */
void ref_array_sort(struct ref_sorting *sort, struct ref_array *array);
/*
 * Based on the given format and quote_style, fill the strbuf.
 * Return 0 if everything was successful, -1 otherwise (and strbuf remains empty)
 */
int format_ref_array_item(struct ref_array_item *info,
			   const struct ref_format *format,
			   struct strbuf *final_buf);
/*
 * Print the ref using the given format and quote_style.
 * Return 0 if everything was successful, -1 otherwise.
 */
int show_ref_array_item(struct ref_array_item *info, const struct ref_format *format);
/*  Parse a single sort specifier and add it to the list */
void parse_ref_sorting(struct ref_sorting **sorting_tail, const char *atom);
/*  Callback function for parsing the sort option */
int parse_opt_ref_sorting(const struct option *opt, const char *arg, int unset);
/*  Default sort option based on refname */
struct ref_sorting *ref_default_sorting(void);
/*  Function to parse --merged and --no-merged options */
int parse_opt_merge_filter(const struct option *opt, const char *arg, int unset);
/*  Get the current HEAD's description */
char *get_head_description(void);
/*  Set up translated strings in the output. */
void setup_ref_filter_porcelain_msg(void);

/*
 * Print a single ref, outside of any ref-filter. Note that the
 * name must be a fully qualified refname.
 */
void pretty_print_ref(const char *name, const unsigned char *sha1,
		      const struct ref_format *format);

/* Search for atom in given format. */
int is_atom_used(const struct ref_format *format, const char *atom);

#endif /*  REF_FILTER_H  */
debug log:

solving 115d00288fdee ...
found 115d00288fdee in https://public-inbox.org/git/01020161890f4370-4ae9a8d6-4f01-4f56-9fde-c40fd76d69b5-000000@eu-west-1.amazonses.com/
found 4eaf6d0514502 in https://public-inbox.org/git/01020161890f4376-0d1c5615-ae9c-4320-bc2d-fd3bda19bce0-000000@eu-west-1.amazonses.com/
found b1c668c12428b in https://public-inbox.org/git/01020161890f435c-80fa0ef3-afaf-45b7-84a7-28e2bb66f320-000000@eu-west-1.amazonses.com/
found fffc443726e28 in https://public-inbox.org/git/01020161890f4357-05e636bc-8b44-425b-a252-ff2341f91cdd-000000@eu-west-1.amazonses.com/
found 5c6e019998716 in https://public-inbox.org/git/01020161890f435c-c3044984-d9aa-4aaf-90e3-1affa109b3b3-000000@eu-west-1.amazonses.com/ ||
	https://public-inbox.org/git/0102016165b8b44a-5508af8f-5539-4938-b41d-46137915de22-000000@eu-west-1.amazonses.com/
found 87b026b8b76d0 in https://public-inbox.org/git/01020161890f4354-a54075a4-9dba-45df-9e5c-196362b4e300-000000@eu-west-1.amazonses.com/ ||
	https://public-inbox.org/git/0102016165b8b43b-65f0cf49-6159-40d8-9bee-de4205e5532f-000000@eu-west-1.amazonses.com/
found e16ea2a990119 in https://public-inbox.org/git/01020161890f4356-2cfaddc9-cd7d-4bd7-9da4-df08783ed06b-000000@eu-west-1.amazonses.com/ ||
	https://public-inbox.org/git/0102016165b8b43d-02e7214d-c360-444d-a25f-2f1b5721db4d-000000@eu-west-1.amazonses.com/
found 781921d4e0978 in https://public-inbox.org/git/01020161890f435d-05435bc4-30da-41c4-8bb2-37dcccb4a413-000000@eu-west-1.amazonses.com/ ||
	https://public-inbox.org/git/0102016165b8b435-2029d2cf-fff4-4f4c-bc87-4c6f6a5ec1a5-000000@eu-west-1.amazonses.com/
found 52e07dbe6864a in https://public-inbox.org/git/0102016165b8b430-4da13fdc-470c-4b89-b576-3fc983f35a5b-000000@eu-west-1.amazonses.com/ ||
	https://public-inbox.org/git/01020161890f4348-10a54126-e31d-448d-93a3-55fd89c248c4-000000@eu-west-1.amazonses.com/
found 17f2ac24d2739 in https://public-inbox.org/git/01020161890f4325-7ab9a01a-ab67-4beb-9721-3dcc5095720a-000000@eu-west-1.amazonses.com/ ||
	https://public-inbox.org/git/0102016165b8b426-befe124b-fbe7-4b83-b7e0-c340b4f6dd57-000000@eu-west-1.amazonses.com/
found b75c8ac45248e in https://public-inbox.org/git/01020161890f4311-ab635cac-1d48-47ee-90e1-f178f134db1c-000000@eu-west-1.amazonses.com/ ||
	https://public-inbox.org/git/0102016165b8b41c-79ff8d08-8681-4bd2-b0a8-13580048c543-000000@eu-west-1.amazonses.com/
found 0d98342b34319 in git.git.git
preparing index
index prepared:
100644 0d98342b343196387c0f4e2dcd5978a9361d8edb	ref-filter.h

applying [1/18] https://public-inbox.org/git/01020161890f4311-ab635cac-1d48-47ee-90e1-f178f134db1c-000000@eu-west-1.amazonses.com/
diff --git a/ref-filter.h b/ref-filter.h
index 0d98342b34319..b75c8ac45248e 100644

Checking patch ref-filter.h...
Applied patch ref-filter.h cleanly.

skipping https://public-inbox.org/git/0102016165b8b41c-79ff8d08-8681-4bd2-b0a8-13580048c543-000000@eu-west-1.amazonses.com/ for b75c8ac45248e
index at:
100644 b75c8ac45248e5a66bfe7124cd94d2f83189dbde	ref-filter.h

applying [2/18] https://public-inbox.org/git/01020161890f4325-7ab9a01a-ab67-4beb-9721-3dcc5095720a-000000@eu-west-1.amazonses.com/
diff --git a/ref-filter.h b/ref-filter.h
index b75c8ac45248e..17f2ac24d2739 100644

Checking patch ref-filter.h...
Applied patch ref-filter.h cleanly.

skipping https://public-inbox.org/git/0102016165b8b426-befe124b-fbe7-4b83-b7e0-c340b4f6dd57-000000@eu-west-1.amazonses.com/ for 17f2ac24d2739
index at:
100644 17f2ac24d273930847376a465a82b0f66f5a4c96	ref-filter.h

applying [3/18] https://public-inbox.org/git/0102016165b8b430-4da13fdc-470c-4b89-b576-3fc983f35a5b-000000@eu-west-1.amazonses.com/
diff --git a/ref-filter.h b/ref-filter.h
index 17f2ac24d2739..52e07dbe6864a 100644

Checking patch ref-filter.h...
Applied patch ref-filter.h cleanly.

skipping https://public-inbox.org/git/01020161890f4348-10a54126-e31d-448d-93a3-55fd89c248c4-000000@eu-west-1.amazonses.com/ for 52e07dbe6864a
index at:
100644 52e07dbe6864a8ec9dad188ac2f5fff50537e49e	ref-filter.h

applying [4/18] https://public-inbox.org/git/01020161890f435d-05435bc4-30da-41c4-8bb2-37dcccb4a413-000000@eu-west-1.amazonses.com/
diff --git a/ref-filter.h b/ref-filter.h
index 52e07dbe6864a..781921d4e0978 100644

Checking patch ref-filter.h...
Applied patch ref-filter.h cleanly.

skipping https://public-inbox.org/git/0102016165b8b435-2029d2cf-fff4-4f4c-bc87-4c6f6a5ec1a5-000000@eu-west-1.amazonses.com/ for 781921d4e0978
index at:
100644 781921d4e0978f91c8c63e36994ccad76ff1ca40	ref-filter.h

applying [5/18] https://public-inbox.org/git/01020161890f4356-2cfaddc9-cd7d-4bd7-9da4-df08783ed06b-000000@eu-west-1.amazonses.com/
diff --git a/ref-filter.h b/ref-filter.h
index 781921d4e0978..e16ea2a990119 100644

Checking patch ref-filter.h...
Applied patch ref-filter.h cleanly.

skipping https://public-inbox.org/git/0102016165b8b43d-02e7214d-c360-444d-a25f-2f1b5721db4d-000000@eu-west-1.amazonses.com/ for e16ea2a990119
index at:
100644 e16ea2a990119a59010fa8fcfcf3a405ff97e0d8	ref-filter.h

applying [6/18] https://public-inbox.org/git/01020161890f4354-a54075a4-9dba-45df-9e5c-196362b4e300-000000@eu-west-1.amazonses.com/
diff --git a/ref-filter.h b/ref-filter.h
index e16ea2a990119..87b026b8b76d0 100644

Checking patch ref-filter.h...
Applied patch ref-filter.h cleanly.

skipping https://public-inbox.org/git/0102016165b8b43b-65f0cf49-6159-40d8-9bee-de4205e5532f-000000@eu-west-1.amazonses.com/ for 87b026b8b76d0
index at:
100644 87b026b8b76d0b9851ce98a7ae5573e1182a1daa	ref-filter.h

applying [7/18] https://public-inbox.org/git/01020161890f435c-c3044984-d9aa-4aaf-90e3-1affa109b3b3-000000@eu-west-1.amazonses.com/
diff --git a/ref-filter.h b/ref-filter.h
index 87b026b8b76d0..5c6e019998716 100644

Checking patch ref-filter.h...
Applied patch ref-filter.h cleanly.

skipping https://public-inbox.org/git/0102016165b8b44a-5508af8f-5539-4938-b41d-46137915de22-000000@eu-west-1.amazonses.com/ for 5c6e019998716
index at:
100644 5c6e019998716207b33d5bc049bc7c4f37ad0c1a	ref-filter.h

applying [8/18] https://public-inbox.org/git/01020161890f4357-05e636bc-8b44-425b-a252-ff2341f91cdd-000000@eu-west-1.amazonses.com/
diff --git a/ref-filter.h b/ref-filter.h
index 5c6e019998716..fffc443726e28 100644


applying [9/18] https://public-inbox.org/git/01020161890f435c-80fa0ef3-afaf-45b7-84a7-28e2bb66f320-000000@eu-west-1.amazonses.com/
diff --git a/ref-filter.h b/ref-filter.h
index fffc443726e28..b1c668c12428b 100644


applying [10/18] https://public-inbox.org/git/01020161890f4376-0d1c5615-ae9c-4320-bc2d-fd3bda19bce0-000000@eu-west-1.amazonses.com/
diff --git a/ref-filter.h b/ref-filter.h
index b1c668c12428b..4eaf6d0514502 100644


applying [11/18] https://public-inbox.org/git/01020161890f4370-4ae9a8d6-4f01-4f56-9fde-c40fd76d69b5-000000@eu-west-1.amazonses.com/
diff --git a/ref-filter.h b/ref-filter.h
index 4eaf6d0514502..115d00288fdee 100644

Checking patch ref-filter.h...
Applied patch ref-filter.h cleanly.
Checking patch ref-filter.h...
Applied patch ref-filter.h cleanly.
Checking patch ref-filter.h...
Applied patch ref-filter.h cleanly.
Checking patch ref-filter.h...
Applied patch ref-filter.h cleanly.

index at:
100644 115d00288fdee874c19f671955a23725442caad8	ref-filter.h

Code repositories for project(s) associated with this 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).