49854277
|
23
|
static int change_list(int argc, const char **argv, const char* prefix)
|
49854277
|
25
|
struct option options[] = {
|
49854277
|
31
|
struct ref_format format = REF_FORMAT_INIT;
|
49854277
|
35
|
argc = parse_options(argc, argv, prefix, options, builtin_list_usage, 0);
|
49854277
|
37
|
setup_ref_filter_porcelain_msg();
|
49854277
|
39
|
memset(&filter, 0, sizeof(filter));
|
49854277
|
40
|
memset(&array, 0, sizeof(array));
|
49854277
|
42
|
filter.kind = FILTER_REFS_CHANGES;
|
49854277
|
43
|
filter.name_patterns = argv;
|
49854277
|
45
|
filter_refs(&array, &filter, FILTER_REFS_CHANGES);
|
49854277
|
52
|
if (!format.format) {
|
49854277
|
53
|
format.format = "%(refname:lstrip=1)";
|
49854277
|
56
|
if (verify_ref_format(&format))
|
49854277
|
57
|
die(_("unable to parse format string"));
|
49854277
|
59
|
for (i = 0; i < array.nr; i++) {
|
49854277
|
60
|
show_ref_array_item(array.items[i], &format);
|
49854277
|
63
|
ref_array_clear(&array);
|
49854277
|
65
|
return 0;
|
73f8829d
|
76
|
static void init_update_state(struct update_state *state)
|
73f8829d
|
78
|
memset(state, 0, sizeof(*state));
|
73f8829d
|
79
|
state->content = "HEAD";
|
73f8829d
|
80
|
string_list_init(&state->replace, 0);
|
73f8829d
|
81
|
string_list_init(&state->origin, 0);
|
73f8829d
|
82
|
}
|
73f8829d
|
84
|
static void clear_update_state(struct update_state *state)
|
73f8829d
|
86
|
string_list_clear(&state->replace, 0);
|
73f8829d
|
87
|
string_list_clear(&state->origin, 0);
|
73f8829d
|
88
|
}
|
73f8829d
|
90
|
static int update_option_parse_replace(const struct option *opt,
|
73f8829d
|
93
|
struct update_state *state = opt->value;
|
73f8829d
|
94
|
string_list_append(&state->replace, arg);
|
73f8829d
|
95
|
return 0;
|
73f8829d
|
98
|
static int update_option_parse_origin(const struct option *opt,
|
73f8829d
|
101
|
struct update_state *state = opt->value;
|
73f8829d
|
102
|
string_list_append(&state->origin, arg);
|
73f8829d
|
103
|
return 0;
|
73f8829d
|
106
|
static int resolve_commit(const char *committish, struct object_id *result)
|
73f8829d
|
109
|
if (get_oid_committish(committish, result))
|
73f8829d
|
110
|
die(_("Failed to resolve '%s' as a valid revision."), committish);
|
73f8829d
|
111
|
commit = lookup_commit_reference(the_repository, result);
|
73f8829d
|
112
|
if (!commit)
|
73f8829d
|
113
|
die(_("Could not parse object '%s'."), committish);
|
73f8829d
|
114
|
oidcpy(result, &commit->object.oid);
|
73f8829d
|
115
|
return 0;
|
73f8829d
|
118
|
static void resolve_commit_list(const struct string_list *commitsish_list,
|
73f8829d
|
122
|
for (i = 0; i < commitsish_list->nr; i++) {
|
73f8829d
|
123
|
struct string_list_item *item = &commitsish_list->items[i];
|
73f8829d
|
125
|
resolve_commit(item->string, &next);
|
73f8829d
|
126
|
oid_array_append(result, &next);
|
73f8829d
|
128
|
}
|
73f8829d
|
134
|
static void get_metacommit_from_command_line(
|
73f8829d
|
137
|
resolve_commit(commands->content, &(result->content));
|
73f8829d
|
138
|
resolve_commit_list(&(commands->replace), &(result->replace));
|
73f8829d
|
139
|
resolve_commit_list(&(commands->origin), &(result->origin));
|
73f8829d
|
140
|
}
|
73f8829d
|
142
|
static int perform_update(
|
73f8829d
|
150
|
init_metacommit_data(&metacommit);
|
73f8829d
|
152
|
get_metacommit_from_command_line(state, &metacommit);
|
73f8829d
|
154
|
ret = record_metacommit(repo, &metacommit, state->change, state->options, err);
|
73f8829d
|
156
|
clear_metacommit_data(&metacommit);
|
73f8829d
|
158
|
return ret;
|
73f8829d
|
161
|
static int change_update(int argc, const char **argv, const char* prefix)
|
73f8829d
|
164
|
int force = 0;
|
73f8829d
|
165
|
int newchange = 0;
|
73f8829d
|
166
|
struct strbuf err = STRBUF_INIT;
|
73f8829d
|
168
|
struct option options[] = {
|
73f8829d
|
186
|
init_update_state(&state);
|
73f8829d
|
188
|
argc = parse_options(argc, argv, prefix, options, builtin_update_usage, 0);
|
73f8829d
|
190
|
if (force) state.options |= UPDATE_OPTION_FORCE;
|
73f8829d
|
191
|
if (newchange) state.options |= UPDATE_OPTION_NOAPPEND;
|
73f8829d
|
193
|
result = perform_update(the_repository, &state, &err);
|
73f8829d
|
195
|
if (result < 0) {
|
73f8829d
|
196
|
error("%s", err.buf);
|
73f8829d
|
197
|
strbuf_release(&err);
|
73f8829d
|
200
|
clear_update_state(&state);
|
73f8829d
|
202
|
return result;
|
73f8829d
|
216
|
if (argc < 1)
|
73f8829d
|
217
|
usage_with_options(builtin_change_usage, options);
|
49854277
|
218
|
else if (!strcmp(argv[0], "list"))
|
49854277
|
219
|
result = change_list(argc, argv, prefix);
|
73f8829d
|
220
|
else if (!strcmp(argv[0], "update"))
|
73f8829d
|
221
|
result = change_update(argc, argv, prefix);
|
73f8829d
|
223
|
error(_("Unknown subcommand: %s"), argv[0]);
|
73f8829d
|
224
|
usage_with_options(builtin_change_usage, options);
|
73f8829d
|
227
|
return result ? 1 : 0;
|
f6bbd781
|
128
|
die(_("'%s' is not a stash-like commit"), revision);
|
f6bbd781
|
161
|
free_stash_info(info);
|
f6bbd781
|
162
|
fprintf_ln(stderr, _("No stash entries found."));
|
f6bbd781
|
163
|
return -1;
|
f6bbd781
|
198
|
free_stash_info(info);
|
cdca49bc
|
225
|
return error(_("git stash clear with parameters is "
|
f6bbd781
|
241
|
return -1;
|
f6bbd781
|
249
|
return -1;
|
f6bbd781
|
265
|
return error(_("unable to write new index file"));
|
f6bbd781
|
377
|
remove_path(stash_index_path.buf);
|
f6bbd781
|
378
|
return -1;
|
f6bbd781
|
405
|
return -1;
|
f6bbd781
|
408
|
return error(_("cannot apply a stash in the middle of a merge"));
|
f6bbd781
|
418
|
strbuf_release(&out);
|
f6bbd781
|
419
|
return error(_("could not generate diff %s^!."),
|
f6bbd781
|
426
|
return error(_("conflicts in index."
|
f6bbd781
|
432
|
return error(_("could not save index tree"));
|
f6bbd781
|
439
|
return error(_("could not restore untracked files from stash"));
|
f6bbd781
|
470
|
return -1;
|
f6bbd781
|
475
|
strbuf_release(&out);
|
f6bbd781
|
480
|
strbuf_release(&out);
|
f6bbd781
|
481
|
return -1;
|
cdca49bc
|
557
|
return error(_("%s: Could not drop stash entry"),
|
e1d01876
|
632
|
printf_ln(_("The stash entry is kept in case "
|
b4493f26
|
766
|
free_stash_info(&info);
|
51809c70
|
767
|
usage_with_options(git_stash_show_usage, options);
|
847eb0b0
|
783
|
stash_msg = "Created via \"git stash store\".";
|
847eb0b0
|
789
|
if (!quiet) {
|
847eb0b0
|
790
|
fprintf_ln(stderr, _("Cannot update %s with %s"),
|
847eb0b0
|
793
|
return -1;
|
847eb0b0
|
817
|
if (!quiet)
|
847eb0b0
|
818
|
fprintf_ln(stderr, _("\"git stash store\" requires one "
|
847eb0b0
|
820
|
return -1;
|
1f5a011d
|
903
|
return -1;
|
1f5a011d
|
963
|
ret = -1;
|
1f5a011d
|
964
|
goto done;
|
1f5a011d
|
969
|
ret = -1;
|
1f5a011d
|
970
|
goto done;
|
1f5a011d
|
975
|
ret = -1;
|
1f5a011d
|
976
|
goto done;
|
1f5a011d
|
1002
|
ret = -1;
|
1f5a011d
|
1003
|
goto done;
|
1f5a011d
|
1014
|
ret = -1;
|
1f5a011d
|
1015
|
goto done;
|
1f5a011d
|
1021
|
ret = -1;
|
1f5a011d
|
1022
|
goto done;
|
1f5a011d
|
1029
|
ret = -1;
|
1f5a011d
|
1030
|
goto done;
|
1f5a011d
|
1068
|
ret = -1;
|
1f5a011d
|
1069
|
goto done;
|
1f5a011d
|
1075
|
ret = -1;
|
1f5a011d
|
1076
|
goto done;
|
1f5a011d
|
1087
|
ret = -1;
|
1f5a011d
|
1088
|
goto done;
|
1f5a011d
|
1093
|
ret = -1;
|
1f5a011d
|
1094
|
goto done;
|
9a95010a
|
1130
|
fprintf_ln(stderr, _("You do not have "
|
1f5a011d
|
1139
|
ret = 1;
|
1f5a011d
|
1140
|
goto done;
|
9a95010a
|
1156
|
if (!quiet)
|
9a95010a
|
1157
|
fprintf_ln(stderr, _("Cannot save the current "
|
1f5a011d
|
1159
|
ret = -1;
|
1f5a011d
|
1160
|
goto done;
|
9a95010a
|
1165
|
if (!quiet)
|
9a95010a
|
1166
|
fprintf_ln(stderr, _("Cannot save "
|
1f5a011d
|
1168
|
ret = -1;
|
1f5a011d
|
1169
|
goto done;
|
9a95010a
|
1176
|
if (!quiet)
|
9a95010a
|
1177
|
fprintf_ln(stderr, _("Cannot save the current "
|
1f5a011d
|
1179
|
goto done;
|
9a95010a
|
1213
|
if (!quiet)
|
9a95010a
|
1214
|
fprintf_ln(stderr, _("Cannot record "
|
1f5a011d
|
1216
|
ret = -1;
|
1f5a011d
|
1217
|
goto done;
|
fa38428f
|
1286
|
ret = -1;
|
fa38428f
|
1287
|
goto done;
|
fa38428f
|
1297
|
ret = -1;
|
9a95010a
|
1298
|
if (!quiet)
|
9a95010a
|
1299
|
fprintf_ln(stderr, _("Cannot initialize stash"));
|
fa38428f
|
1300
|
goto done;
|
fa38428f
|
1312
|
ret = -1;
|
9a95010a
|
1313
|
if (!quiet)
|
9a95010a
|
1314
|
fprintf_ln(stderr, _("Cannot save the current status"));
|
fa38428f
|
1315
|
goto done;
|
fa38428f
|
1332
|
ret = -1;
|
fa38428f
|
1351
|
ret = -1;
|
fa38428f
|
1352
|
goto done;
|
fa38428f
|
1361
|
ret = -1;
|
fa38428f
|
1362
|
goto done;
|
fa38428f
|
1370
|
ret = -1;
|
fa38428f
|
1379
|
ret = -1;
|
fa38428f
|
1390
|
ret = -1;
|
fa38428f
|
1391
|
goto done;
|
fa38428f
|
1400
|
ret = -1;
|
fa38428f
|
1401
|
goto done;
|
fa38428f
|
1409
|
ret = -1;
|
fa38428f
|
1435
|
ret = -1;
|
bec65d5b
|
1527
|
return env;
|
26799a20
|
1555
|
const char *path = mkpath("%s/git-legacy-stash",
|
26799a20
|
1558
|
if (sane_execvp(path, (char **)argv) < 0)
|
26799a20
|
1559
|
die_errno(_("could not exec %s"), path);
|
26799a20
|
1561
|
BUG("sane_execvp() returned???");
|
51809c70
|
1602
|
usage_msg_opt(xstrfmt(_("unknown subcommand: %s"), argv[0]),
|
51809c70
|
1630
|
continue;
|
287a8679
|
7
|
void change_table_init(struct change_table *to_initialize)
|
287a8679
|
9
|
memset(to_initialize, 0, sizeof(*to_initialize));
|
287a8679
|
10
|
mem_pool_init(&(to_initialize->memory_pool), 0);
|
287a8679
|
11
|
to_initialize->memory_pool->block_alloc = 4*1024 - sizeof(struct mp_block);
|
287a8679
|
12
|
oidmap_init(&(to_initialize->oid_to_metadata_index), 0);
|
287a8679
|
13
|
string_list_init(&(to_initialize->refname_to_change_head), 1);
|
287a8679
|
14
|
}
|
287a8679
|
16
|
static void change_list_clear(struct change_list *to_clear) {
|
287a8679
|
17
|
string_list_clear(&to_clear->additional_refnames, 0);
|
287a8679
|
18
|
}
|
287a8679
|
20
|
static void commit_change_list_entry_clear(
|
287a8679
|
22
|
change_list_clear(&(to_clear->changes));
|
287a8679
|
23
|
}
|
287a8679
|
25
|
static void change_head_array_clear(struct change_head_array *to_clear)
|
287a8679
|
27
|
FREE_AND_NULL(to_clear->array);
|
287a8679
|
28
|
}
|
287a8679
|
30
|
void change_table_clear(struct change_table *to_clear)
|
287a8679
|
34
|
for (next = oidmap_iter_first(&to_clear->oid_to_metadata_index, &iter);
|
287a8679
|
36
|
next = oidmap_iter_next(&iter)) {
|
287a8679
|
38
|
commit_change_list_entry_clear(next);
|
287a8679
|
41
|
oidmap_free(&to_clear->oid_to_metadata_index, 0);
|
287a8679
|
42
|
string_list_clear(&(to_clear->refname_to_change_head), 0);
|
287a8679
|
43
|
change_head_array_clear(&to_clear->heads);
|
287a8679
|
44
|
mem_pool_discard(to_clear->memory_pool, 0);
|
287a8679
|
45
|
}
|
287a8679
|
51
|
static int change_head_array_append(struct change_head_array *to_add)
|
287a8679
|
53
|
int index = to_add->nr++;
|
287a8679
|
55
|
ALLOC_GROW(to_add->array, to_add->nr, to_add->alloc);
|
287a8679
|
56
|
new_head = &(to_add->array[index]);
|
287a8679
|
57
|
memset(new_head, 0, sizeof(*new_head));
|
287a8679
|
58
|
return index;
|
287a8679
|
61
|
static void add_head_to_commit(struct change_table *to_modify,
|
287a8679
|
68
|
entry = oidmap_get(&(to_modify->oid_to_metadata_index), to_add);
|
287a8679
|
69
|
if (!entry) {
|
287a8679
|
70
|
entry = mem_pool_calloc(to_modify->memory_pool, 1,
|
287a8679
|
72
|
oidcpy(&entry->entry.oid, to_add);
|
287a8679
|
73
|
oidmap_put(&(to_modify->oid_to_metadata_index), entry);
|
287a8679
|
74
|
string_list_init(&(entry->changes.additional_refnames), 0);
|
287a8679
|
77
|
if (entry->changes.first_refname == NULL) {
|
287a8679
|
78
|
entry->changes.first_refname = refname;
|
287a8679
|
80
|
string_list_insert(&entry->changes.additional_refnames, refname);
|
287a8679
|
82
|
}
|
287a8679
|
84
|
void change_table_add(struct change_table *to_modify, const char *refname,
|
287a8679
|
92
|
index = change_head_array_append(&to_modify->heads);
|
287a8679
|
93
|
new_head = &(to_modify->heads.array[index]);
|
287a8679
|
95
|
oidcpy(&new_head->head, &(to_add->object.oid));
|
287a8679
|
97
|
metacommit_type = get_metacommit_content(to_add, &new_head->content);
|
287a8679
|
98
|
if (metacommit_type == METACOMMIT_TYPE_NONE) {
|
287a8679
|
99
|
oidcpy(&new_head->content, &(to_add->object.oid));
|
287a8679
|
101
|
new_head->abandoned = (metacommit_type == METACOMMIT_TYPE_ABANDONED);
|
287a8679
|
102
|
new_head->remote = starts_with(refname, "refs/remote/");
|
287a8679
|
103
|
new_head->hidden = starts_with(refname, "refs/hiddenmetas/");
|
287a8679
|
105
|
new_item = string_list_insert(&to_modify->refname_to_change_head, refname);
|
287a8679
|
106
|
new_item->util = (void*)index;
|
287a8679
|
108
|
refname = new_item->string;
|
287a8679
|
110
|
if (!oideq(&new_head->content, &new_head->head)) {
|
287a8679
|
111
|
add_head_to_commit(to_modify, &(new_head->content), refname);
|
287a8679
|
113
|
add_head_to_commit(to_modify, &(new_head->head), refname);
|
287a8679
|
114
|
}
|
287a8679
|
116
|
void change_table_add_all_visible(struct change_table *to_modify,
|
287a8679
|
120
|
const char *name_patterns[] = {NULL};
|
287a8679
|
121
|
memset(&filter, 0, sizeof(filter));
|
287a8679
|
122
|
filter.kind = FILTER_REFS_CHANGES;
|
287a8679
|
123
|
filter.name_patterns = name_patterns;
|
287a8679
|
125
|
change_table_add_matching_filter(to_modify, repo, &filter);
|
287a8679
|
126
|
}
|
287a8679
|
128
|
void change_table_add_matching_filter(struct change_table *to_modify,
|
287a8679
|
134
|
memset(&matching_refs, 0, sizeof(matching_refs));
|
287a8679
|
135
|
filter_refs(&matching_refs, filter, filter->kind);
|
287a8679
|
142
|
for (i = 0; i < matching_refs.nr; i++) {
|
287a8679
|
143
|
struct ref_array_item *item = matching_refs.items[i];
|
287a8679
|
144
|
struct commit *commit = item->commit;
|
287a8679
|
146
|
commit = lookup_commit_reference_gently(repo, &(item->objectname), 1);
|
287a8679
|
148
|
if (commit != NULL) {
|
287a8679
|
149
|
change_table_add(to_modify, item->refname, commit);
|
287a8679
|
153
|
ref_array_clear(&matching_refs);
|
287a8679
|
154
|
}
|
287a8679
|
156
|
static int return_true_callback(const char *refname, void *cb_data)
|
287a8679
|
158
|
return 1;
|
287a8679
|
161
|
int change_table_has_change_referencing(struct change_table *changes,
|
287a8679
|
164
|
return for_each_change_referencing(changes, referenced_commit_id,
|
287a8679
|
168
|
int for_each_change_referencing(struct change_table *table,
|
287a8679
|
176
|
entry = oidmap_get(&table->oid_to_metadata_index,
|
287a8679
|
179
|
if (!entry) {
|
287a8679
|
180
|
return 0;
|
287a8679
|
182
|
changes = &(entry->changes);
|
287a8679
|
183
|
if (changes->first_refname == NULL) {
|
287a8679
|
184
|
return 0;
|
287a8679
|
186
|
retvalue = fn(changes->first_refname, cb_data);
|
287a8679
|
187
|
for (i = 0; retvalue == 0 && i < changes->additional_refnames.nr; i++) {
|
287a8679
|
188
|
retvalue = fn(changes->additional_refnames.items[i].string, cb_data);
|
287a8679
|
190
|
return retvalue;
|
287a8679
|
193
|
struct change_head* get_change_head(struct change_table *heads,
|
287a8679
|
196
|
struct string_list_item *item = string_list_lookup(
|
287a8679
|
200
|
if (!item) {
|
287a8679
|
201
|
return NULL;
|
287a8679
|
204
|
index = (long)item->util;
|
287a8679
|
205
|
return &(heads->heads.array[index]);
|
6b8678e5
|
7
|
void init_metacommit_data(struct metacommit_data *state)
|
6b8678e5
|
9
|
memset(state, 0, sizeof(*state));
|
6b8678e5
|
10
|
}
|
6b8678e5
|
12
|
void clear_metacommit_data(struct metacommit_data *state)
|
6b8678e5
|
14
|
oid_array_clear(&state->replace);
|
6b8678e5
|
15
|
oid_array_clear(&state->origin);
|
6b8678e5
|
16
|
}
|
6b8678e5
|
18
|
static void compute_default_change_name(struct commit *initial_commit,
|
6b8678e5
|
21
|
const char *buffer = get_commit_buffer(initial_commit, NULL);
|
6b8678e5
|
25
|
find_commit_subject(buffer, &subject);
|
6b8678e5
|
26
|
eol = strchrnul(subject, '\n');
|
6b8678e5
|
27
|
for (len = 0;subject < eol && len < 10; ++subject, ++len) {
|
6b8678e5
|
28
|
char next = *subject;
|
6b8678e5
|
29
|
if (isspace(next)) {
|
6b8678e5
|
30
|
continue;
|
6b8678e5
|
33
|
strbuf_addch(result, next);
|
6b8678e5
|
35
|
}
|
6b8678e5
|
42
|
static void compute_change_name(struct commit *initial_commit, struct strbuf* result)
|
6b8678e5
|
47
|
strbuf_init(&default_name, 0);
|
6b8678e5
|
48
|
if (initial_commit) {
|
6b8678e5
|
49
|
compute_default_change_name(initial_commit, &default_name);
|
6b8678e5
|
51
|
strbuf_addstr(&default_name, "change");
|
6b8678e5
|
53
|
strbuf_addstr(result, "refs/metas/");
|
6b8678e5
|
54
|
strbuf_addstr(result, default_name.buf);
|
6b8678e5
|
57
|
if (!read_ref(result->buf, &unused)) {
|
6b8678e5
|
58
|
int suffix = 2;
|
6b8678e5
|
59
|
int original_length = result->len;
|
6b8678e5
|
62
|
strbuf_addf(result, "%d", suffix);
|
6b8678e5
|
63
|
if (read_ref(result->buf, &unused)) {
|
6b8678e5
|
64
|
break;
|
6b8678e5
|
66
|
strbuf_remove(result, original_length, result->len - original_length);
|
6b8678e5
|
67
|
++suffix;
|
6b8678e5
|
68
|
}
|
6b8678e5
|
71
|
strbuf_release(&default_name);
|
6b8678e5
|
72
|
}
|
6b8678e5
|
81
|
static int resolve_metacommit_callback(const char *refname, void *cb_data)
|
6b8678e5
|
83
|
struct resolve_metacommit_callback_data *data = (struct resolve_metacommit_callback_data *)cb_data;
|
6b8678e5
|
86
|
chhead = get_change_head(data->active_changes, refname);
|
6b8678e5
|
88
|
if (data->changes) {
|
6b8678e5
|
89
|
string_list_append(data->changes, refname)->util = &(chhead->head);
|
6b8678e5
|
91
|
if (data->heads) {
|
6b8678e5
|
92
|
oid_array_append(data->heads, &(chhead->head));
|
6b8678e5
|
95
|
return 0;
|
6b8678e5
|
101
|
static void resolve_metacommit(
|
6b8678e5
|
110
|
int len = to_resolve->replace.nr;
|
6b8678e5
|
112
|
int old_change_list_length = to_advance->nr;
|
6b8678e5
|
115
|
oidcpy(&resolved_output->content, &to_resolve->content);
|
6b8678e5
|
119
|
resolved_output->abandoned = to_resolve->abandoned;
|
6b8678e5
|
120
|
cbdata.active_changes = active_changes;
|
6b8678e5
|
121
|
cbdata.changes = to_advance;
|
6b8678e5
|
122
|
cbdata.heads = &(resolved_output->replace);
|
6b8678e5
|
124
|
if (allow_append) {
|
6b8678e5
|
125
|
for (i = 0; i < len; i++) {
|
6b8678e5
|
126
|
int old_number = resolved_output->replace.nr;
|
6b8678e5
|
127
|
for_each_change_referencing(active_changes, &(to_resolve->replace.oid[i]),
|
6b8678e5
|
130
|
if (old_number == resolved_output->replace.nr) {
|
6b8678e5
|
131
|
oid_array_append(&(resolved_output->replace), &(to_resolve->replace.oid[i]));
|
6b8678e5
|
136
|
cbdata.changes = NULL;
|
6b8678e5
|
137
|
cbdata.heads = &(resolved_output->origin);
|
6b8678e5
|
139
|
len = to_resolve->origin.nr;
|
6b8678e5
|
140
|
for (i = 0; i < len; i++) {
|
6b8678e5
|
141
|
int old_number = resolved_output->origin.nr;
|
6b8678e5
|
142
|
for_each_change_referencing(active_changes, &(to_resolve->origin.oid[i]),
|
6b8678e5
|
144
|
if (old_number == resolved_output->origin.nr) {
|
6b8678e5
|
145
|
oid_array_append(&(resolved_output->origin), &(to_resolve->origin.oid[i]));
|
6b8678e5
|
151
|
if (to_advance->nr == old_change_list_length) {
|
6b8678e5
|
154
|
strbuf_init(&change_name, 80);
|
6b8678e5
|
155
|
content = lookup_commit_reference_gently(repo, &(to_resolve->content), 1);
|
6b8678e5
|
157
|
compute_change_name(content, &change_name);
|
6b8678e5
|
158
|
string_list_append(to_advance, change_name.buf);
|
6b8678e5
|
159
|
strbuf_release(&change_name);
|
6b8678e5
|
161
|
}
|
6b8678e5
|
163
|
static void lookup_commits(
|
6b8678e5
|
168
|
int i = to_lookup->nr;
|
6b8678e5
|
170
|
while (--i >= 0) {
|
6b8678e5
|
171
|
struct object_id *next = &(to_lookup->oid[i]);
|
6b8678e5
|
172
|
struct commit *commit = lookup_commit_reference_gently(repo, next, 1);
|
6b8678e5
|
173
|
commit_list_insert(commit, result);
|
6b8678e5
|
175
|
}
|
6b8678e5
|
183
|
int write_metacommit(struct repository *repo, struct metacommit_data *state,
|
6b8678e5
|
186
|
struct commit_list *parents = NULL;
|
6b8678e5
|
191
|
strbuf_init(&comment, strlen(PARENT_TYPE_PREFIX)
|
6b8678e5
|
192
|
+ 1 + 2 * (state->origin.nr + state->replace.nr));
|
6b8678e5
|
193
|
lookup_commits(repo, &state->origin, &parents);
|
6b8678e5
|
194
|
lookup_commits(repo, &state->replace, &parents);
|
6b8678e5
|
195
|
content = lookup_commit_reference_gently(repo, &state->content, 1);
|
6b8678e5
|
196
|
if (!content) {
|
6b8678e5
|
197
|
strbuf_release(&comment);
|
6b8678e5
|
198
|
free_commit_list(parents);
|
6b8678e5
|
199
|
return -1;
|
6b8678e5
|
201
|
commit_list_insert(content, &parents);
|
6b8678e5
|
203
|
strbuf_addstr(&comment, PARENT_TYPE_PREFIX);
|
6b8678e5
|
204
|
strbuf_addstr(&comment, state->abandoned ? "a" : "c");
|
6b8678e5
|
205
|
for (i = 0; i < state->replace.nr; i++) {
|
6b8678e5
|
206
|
strbuf_addstr(&comment, " r");
|
6b8678e5
|
209
|
for (i = 0; i < state->origin.nr; i++) {
|
6b8678e5
|
210
|
strbuf_addstr(&comment, " o");
|
6b8678e5
|
214
|
commit_tree(comment.buf, comment.len, repo->hash_algo->empty_tree, parents,
|
6b8678e5
|
217
|
strbuf_release(&comment);
|
6b8678e5
|
218
|
return 0;
|
6b8678e5
|
225
|
static int is_nontrivial_metacommit(struct metacommit_data *state)
|
6b8678e5
|
227
|
return state->replace.nr || state->origin.nr || state->abandoned;
|
6b8678e5
|
240
|
int record_metacommit(struct repository *repo,
|
6b8678e5
|
248
|
struct ref_transaction *transaction = NULL;
|
6b8678e5
|
253
|
int ret = 0;
|
6b8678e5
|
254
|
int force = (options & UPDATE_OPTION_FORCE);
|
6b8678e5
|
256
|
init_metacommit_data(&resolved_metacommit);
|
6b8678e5
|
257
|
string_list_init(&changes, 1);
|
6b8678e5
|
259
|
change_table_init(&chtable);
|
6b8678e5
|
261
|
change_table_add_all_visible(&chtable, repo);
|
6b8678e5
|
263
|
resolve_metacommit(repo, &chtable, metacommit, &resolved_metacommit, &changes,
|
6b8678e5
|
264
|
(options & UPDATE_OPTION_NOAPPEND) == 0);
|
6b8678e5
|
266
|
if (override_change) {
|
6b8678e5
|
267
|
old_head = &old_head_working;
|
6b8678e5
|
268
|
string_list_clear(&changes, 0);
|
6b8678e5
|
269
|
if (get_oid_committish(override_change, &old_head_working)) {
|
6b8678e5
|
271
|
old_head = &null_oid;
|
6b8678e5
|
272
|
} else if (!force) {
|
6b8678e5
|
273
|
if (!oid_array_readonly_contains(&(resolved_metacommit.replace),
|
6b8678e5
|
276
|
strbuf_addf(err, _("non-fast-forward update to '%s'"),
|
6b8678e5
|
278
|
ret = -1;
|
6b8678e5
|
279
|
goto cleanup;
|
6b8678e5
|
283
|
string_list_append(&changes, override_change)->util = (void*)old_head;
|
6b8678e5
|
286
|
if (is_nontrivial_metacommit(&resolved_metacommit)) {
|
6b8678e5
|
289
|
if (write_metacommit(repo, &resolved_metacommit, &commit_target) < 0) {
|
6b8678e5
|
290
|
ret = -1;
|
6b8678e5
|
291
|
goto cleanup;
|
6b8678e5
|
296
|
oidcpy(&commit_target, &(resolved_metacommit.content));
|
6b8678e5
|
301
|
if (!override_change &&
|
6b8678e5
|
302
|
change_table_has_change_referencing(&chtable, &commit_target)) {
|
6b8678e5
|
304
|
goto cleanup;
|
6b8678e5
|
307
|
transaction = ref_transaction_begin(err);
|
6b8678e5
|
310
|
if (!transaction) {
|
6b8678e5
|
311
|
ret = -1;
|
6b8678e5
|
313
|
for (i = 0; i < changes.nr; i++) {
|
6b8678e5
|
314
|
struct string_list_item *it = &(changes.items[i]);
|
6b8678e5
|
318
|
if (it->util) {
|
6b8678e5
|
319
|
if (ref_transaction_update(transaction, it->string, &commit_target,
|
6b8678e5
|
322
|
ret = -1;
|
6b8678e5
|
325
|
if (ref_transaction_create(transaction, it->string,
|
6b8678e5
|
328
|
ret = -1;
|
6b8678e5
|
333
|
if (!ret) {
|
6b8678e5
|
334
|
if (ref_transaction_commit(transaction, err)) {
|
6b8678e5
|
335
|
ret = -1;
|
6b8678e5
|
341
|
ref_transaction_free(transaction);
|
6b8678e5
|
342
|
string_list_clear(&changes, 0);
|
6b8678e5
|
343
|
clear_metacommit_data(&resolved_metacommit);
|
6b8678e5
|
344
|
change_table_clear(&chtable);
|
6b8678e5
|
345
|
return ret;
|
6b8678e5
|
355
|
void modify_change(
|
6b8678e5
|
363
|
init_metacommit_data(&metacommit);
|
6b8678e5
|
364
|
oidcpy(&(metacommit.content), new_commit);
|
6b8678e5
|
365
|
oid_array_append(&(metacommit.replace), old_commit);
|
6b8678e5
|
367
|
record_metacommit(repo, &metacommit, NULL, 0, err);
|
6b8678e5
|
369
|
clear_metacommit_data(&metacommit);
|
63ab7419
|
124
|
static void tr2main_signal_handler(int signo)
|
63ab7419
|
131
|
us_now = getnanotime() / 1000;
|
63ab7419
|
132
|
us_elapsed_absolute = tr2tls_absolute_elapsed(us_now);
|
63ab7419
|
134
|
for_each_wanted_builtin(j, tgt_j) {
|
63ab7419
|
135
|
if (tgt_j->pfn_signal)
|
63ab7419
|
136
|
tgt_j->pfn_signal(us_elapsed_absolute, signo);
|
63ab7419
|
139
|
sigchain_pop(signo);
|
63ab7419
|
140
|
raise(signo);
|
63ab7419
|
141
|
}
|
63ab7419
|
149
|
return;
|
63ab7419
|
233
|
void trace2_cmd_path_fl(const char *file, int line, const char *pathname)
|
63ab7419
|
238
|
if (!trace2_enabled)
|
63ab7419
|
239
|
return;
|
63ab7419
|
241
|
for_each_wanted_builtin(j, tgt_j) {
|
63ab7419
|
242
|
if (tgt_j->pfn_command_path_fl)
|
63ab7419
|
243
|
tgt_j->pfn_command_path_fl(file, line, pathname);
|
63ab7419
|
275
|
for_each_wanted_builtin(j, tgt_j) {
|
63ab7419
|
276
|
if (tgt_j->pfn_command_subverb_fl)
|
63ab7419
|
277
|
tgt_j->pfn_command_subverb_fl(file, line,
|
63ab7419
|
291
|
for_each_wanted_builtin(j, tgt_j) {
|
63ab7419
|
292
|
if (tgt_j->pfn_alias_fl)
|
63ab7419
|
293
|
tgt_j->pfn_alias_fl(file, line, alias, argv);
|
63ab7419
|
311
|
tr2_cfg_set_fl(file, line, key, value);
|
63ab7419
|
357
|
us_elapsed_child = 0;
|
63ab7419
|
381
|
us_now = getnanotime() / 1000;
|
63ab7419
|
382
|
us_elapsed_absolute = tr2tls_absolute_elapsed(us_now);
|
63ab7419
|
384
|
exec_id = tr2tls_locked_increment(&tr2_next_exec_id);
|
63ab7419
|
386
|
for_each_wanted_builtin(j, tgt_j) {
|
63ab7419
|
387
|
if (tgt_j->pfn_exec_fl)
|
63ab7419
|
388
|
tgt_j->pfn_exec_fl(file, line, us_elapsed_absolute,
|
63ab7419
|
392
|
return exec_id;
|
63ab7419
|
395
|
void trace2_exec_result_fl(const char *file, int line, int exec_id, int code)
|
63ab7419
|
402
|
if (!trace2_enabled)
|
63ab7419
|
403
|
return;
|
63ab7419
|
405
|
us_now = getnanotime() / 1000;
|
63ab7419
|
406
|
us_elapsed_absolute = tr2tls_absolute_elapsed(us_now);
|
63ab7419
|
408
|
for_each_wanted_builtin(j, tgt_j) {
|
63ab7419
|
409
|
if (tgt_j->pfn_exec_result_fl)
|
63ab7419
|
410
|
tgt_j->pfn_exec_result_fl(file, line,
|
63ab7419
|
416
|
void trace2_thread_start_fl(const char *file, int line,
|
63ab7419
|
424
|
if (!trace2_enabled)
|
63ab7419
|
425
|
return;
|
63ab7419
|
427
|
if (tr2tls_is_main_thread())
|
63ab7419
|
438
|
trace2_region_enter_printf_fl(file, line, NULL, NULL, NULL,
|
63ab7419
|
441
|
return;
|
63ab7419
|
444
|
us_now = getnanotime() / 1000;
|
63ab7419
|
445
|
us_elapsed_absolute = tr2tls_absolute_elapsed(us_now);
|
63ab7419
|
447
|
tr2tls_create_self(thread_name);
|
63ab7419
|
449
|
for_each_wanted_builtin(j, tgt_j) {
|
63ab7419
|
450
|
if (tgt_j->pfn_thread_start_fl)
|
63ab7419
|
451
|
tgt_j->pfn_thread_start_fl(file, line,
|
63ab7419
|
456
|
void trace2_thread_exit_fl(const char *file, int line)
|
63ab7419
|
464
|
if (!trace2_enabled)
|
63ab7419
|
465
|
return;
|
63ab7419
|
467
|
if (tr2tls_is_main_thread())
|
63ab7419
|
478
|
trace2_region_leave_printf_fl(file, line, NULL, NULL, NULL,
|
63ab7419
|
480
|
return;
|
63ab7419
|
483
|
us_now = getnanotime() / 1000;
|
63ab7419
|
484
|
us_elapsed_absolute = tr2tls_absolute_elapsed(us_now);
|
63ab7419
|
491
|
tr2tls_pop_unwind_self();
|
63ab7419
|
492
|
us_elapsed_thread = tr2tls_region_elasped_self(us_now);
|
63ab7419
|
494
|
for_each_wanted_builtin(j, tgt_j) {
|
63ab7419
|
495
|
if (tgt_j->pfn_thread_exit_fl)
|
63ab7419
|
496
|
tgt_j->pfn_thread_exit_fl(file, line,
|
63ab7419
|
501
|
tr2tls_unset_self();
|
63ab7419
|
511
|
return;
|
63ab7419
|
529
|
return;
|
63ab7419
|
553
|
us_now = getnanotime() / 1000;
|
63ab7419
|
554
|
us_elapsed_absolute = tr2tls_absolute_elapsed(us_now);
|
63ab7419
|
563
|
for_each_wanted_builtin(j, tgt_j) {
|
63ab7419
|
564
|
if (tgt_j->pfn_region_enter_printf_va_fl)
|
63ab7419
|
565
|
tgt_j->pfn_region_enter_printf_va_fl(
|
63ab7419
|
570
|
tr2tls_push_self(us_now);
|
63ab7419
|
628
|
us_now = getnanotime() / 1000;
|
63ab7419
|
629
|
us_elapsed_absolute = tr2tls_absolute_elapsed(us_now);
|
63ab7419
|
637
|
us_elapsed_region = tr2tls_region_elasped_self(us_now);
|
63ab7419
|
639
|
tr2tls_pop_self();
|
63ab7419
|
645
|
for_each_wanted_builtin(j, tgt_j) {
|
63ab7419
|
646
|
if (tgt_j->pfn_region_leave_printf_va_fl)
|
63ab7419
|
647
|
tgt_j->pfn_region_leave_printf_va_fl(
|
63ab7419
|
708
|
return;
|
63ab7419
|
733
|
strbuf_addf(&buf_string, "%"PRIdMAX, value);
|
63ab7419
|
734
|
trace2_data_string_fl(file, line, category, repo, key, buf_string.buf);
|
63ab7419
|
735
|
strbuf_release(&buf_string);
|
63ab7419
|
738
|
void trace2_data_json_fl(const char *file, int line,
|
63ab7419
|
750
|
if (!trace2_enabled)
|
63ab7419
|
751
|
return;
|
63ab7419
|
753
|
us_now = getnanotime() / 1000;
|
63ab7419
|
754
|
us_elapsed_absolute = tr2tls_absolute_elapsed(us_now);
|
63ab7419
|
755
|
us_elapsed_region = tr2tls_region_elasped_self(us_now);
|
63ab7419
|
757
|
for_each_wanted_builtin(j, tgt_j) {
|
63ab7419
|
758
|
if (tgt_j->pfn_data_fl)
|
63ab7419
|
759
|
tgt_j->pfn_data_json_fl(file, line, us_elapsed_absolute,
|
63ab7419
|
765
|
void trace2_printf_va_fl(const char *file, int line,
|
63ab7419
|
773
|
if (!trace2_enabled)
|
63ab7419
|
774
|
return;
|
63ab7419
|
776
|
us_now = getnanotime() / 1000;
|
63ab7419
|
777
|
us_elapsed_absolute = tr2tls_absolute_elapsed(us_now);
|
63ab7419
|
783
|
for_each_wanted_builtin(j, tgt_j) {
|
63ab7419
|
784
|
if (tgt_j->pfn_printf_va_fl)
|
63ab7419
|
785
|
tgt_j->pfn_printf_va_fl(file, line, us_elapsed_absolute,
|
63ab7419
|
790
|
void trace2_printf_fl(const char *file, int line,
|
63ab7419
|
795
|
va_start(ap, fmt);
|
63ab7419
|
796
|
trace2_printf_va_fl(file, line, fmt, ap);
|
63ab7419
|
797
|
va_end(ap);
|
63ab7419
|
798
|
}
|
63ab7419
|
57
|
tr2env_event_nesting_wanted = want_nesting;
|
63ab7419
|
61
|
tr2env_event_brief = want_brief;
|
63ab7419
|
97
|
!strcmp(event_name, "version") ||
|
63ab7419
|
98
|
!strcmp(event_name, "atexit")) {
|
63ab7419
|
160
|
static void fn_signal(uint64_t us_elapsed_absolute, int signo)
|
63ab7419
|
162
|
const char *event_name = "signal";
|
63ab7419
|
163
|
struct json_writer jw = JSON_WRITER_INIT;
|
63ab7419
|
164
|
double t_abs = (double)us_elapsed_absolute / 1000000.0;
|
63ab7419
|
166
|
jw_object_begin(&jw, 0);
|
63ab7419
|
167
|
event_fmt_prepare(event_name, __FILE__, __LINE__, NULL, &jw);
|
63ab7419
|
168
|
jw_object_double(&jw, "t_abs", 6, t_abs);
|
63ab7419
|
169
|
jw_object_intmax(&jw, "signo", signo);
|
63ab7419
|
170
|
jw_end(&jw);
|
63ab7419
|
172
|
tr2_dst_write_line(&tr2dst_event, &jw.json);
|
63ab7419
|
173
|
jw_release(&jw);
|
63ab7419
|
174
|
}
|
63ab7419
|
209
|
if (fmt && *fmt) {
|
63ab7419
|
210
|
jw_object_string(jw, field_name, fmt);
|
63ab7419
|
211
|
return;
|
63ab7419
|
238
|
static void fn_command_path_fl(const char *file, int line,
|
63ab7419
|
241
|
const char *event_name = "cmd_path";
|
63ab7419
|
242
|
struct json_writer jw = JSON_WRITER_INIT;
|
63ab7419
|
244
|
jw_object_begin(&jw, 0);
|
63ab7419
|
245
|
event_fmt_prepare(event_name, file, line, NULL, &jw);
|
63ab7419
|
246
|
jw_object_string(&jw, "path", pathname);
|
63ab7419
|
247
|
jw_end(&jw);
|
63ab7419
|
249
|
tr2_dst_write_line(&tr2dst_event, &jw.json);
|
63ab7419
|
250
|
jw_release(&jw);
|
63ab7419
|
251
|
}
|
63ab7419
|
271
|
static void fn_command_subverb_fl(const char *file, int line,
|
63ab7419
|
274
|
const char *event_name = "cmd_subverb";
|
63ab7419
|
275
|
struct json_writer jw = JSON_WRITER_INIT;
|
63ab7419
|
277
|
jw_object_begin(&jw, 0);
|
63ab7419
|
278
|
event_fmt_prepare(event_name, file, line, NULL, &jw);
|
63ab7419
|
279
|
jw_object_string(&jw, "name", command_subverb);
|
63ab7419
|
280
|
jw_end(&jw);
|
63ab7419
|
282
|
tr2_dst_write_line(&tr2dst_event, &jw.json);
|
63ab7419
|
283
|
jw_release(&jw);
|
63ab7419
|
284
|
}
|
63ab7419
|
286
|
static void fn_alias_fl(const char *file, int line,
|
63ab7419
|
289
|
const char *event_name = "alias";
|
63ab7419
|
290
|
struct json_writer jw = JSON_WRITER_INIT;
|
63ab7419
|
292
|
jw_object_begin(&jw, 0);
|
63ab7419
|
293
|
event_fmt_prepare(event_name, file, line, NULL, &jw);
|
63ab7419
|
294
|
jw_object_string(&jw, "alias", alias);
|
63ab7419
|
295
|
jw_object_inline_begin_array(&jw, "argv");
|
63ab7419
|
296
|
jw_array_argv(&jw, argv);
|
63ab7419
|
297
|
jw_end(&jw);
|
63ab7419
|
298
|
jw_end(&jw);
|
63ab7419
|
300
|
tr2_dst_write_line(&tr2dst_event, &jw.json);
|
63ab7419
|
301
|
jw_release(&jw);
|
63ab7419
|
302
|
}
|
63ab7419
|
315
|
jw_object_string(&jw, "child_class", "hook");
|
63ab7419
|
316
|
jw_object_string(&jw, "hook_name", cmd->trace2_hook_name);
|
63ab7419
|
323
|
jw_object_string(&jw, "cd", cmd->dir);
|
63ab7419
|
327
|
jw_array_string(&jw, "git");
|
63ab7419
|
358
|
static void fn_thread_start_fl(const char *file, int line,
|
63ab7419
|
361
|
const char *event_name = "thread_start";
|
63ab7419
|
362
|
struct json_writer jw = JSON_WRITER_INIT;
|
63ab7419
|
364
|
jw_object_begin(&jw, 0);
|
63ab7419
|
365
|
event_fmt_prepare(event_name, file, line, NULL, &jw);
|
63ab7419
|
366
|
jw_end(&jw);
|
63ab7419
|
368
|
tr2_dst_write_line(&tr2dst_event, &jw.json);
|
63ab7419
|
369
|
jw_release(&jw);
|
63ab7419
|
370
|
}
|
63ab7419
|
372
|
static void fn_thread_exit_fl(const char *file, int line,
|
63ab7419
|
376
|
const char *event_name = "thread_exit";
|
63ab7419
|
377
|
struct json_writer jw = JSON_WRITER_INIT;
|
63ab7419
|
378
|
double t_rel = (double)us_elapsed_thread / 1000000.0;
|
63ab7419
|
380
|
jw_object_begin(&jw, 0);
|
63ab7419
|
381
|
event_fmt_prepare(event_name, file, line, NULL, &jw);
|
63ab7419
|
382
|
jw_object_double(&jw, "t_rel", 6, t_rel);
|
63ab7419
|
383
|
jw_end(&jw);
|
63ab7419
|
385
|
tr2_dst_write_line(&tr2dst_event, &jw.json);
|
63ab7419
|
386
|
jw_release(&jw);
|
63ab7419
|
387
|
}
|
63ab7419
|
389
|
static void fn_exec_fl(const char *file, int line,
|
63ab7419
|
393
|
const char *event_name = "exec";
|
63ab7419
|
394
|
struct json_writer jw = JSON_WRITER_INIT;
|
63ab7419
|
396
|
jw_object_begin(&jw, 0);
|
63ab7419
|
397
|
event_fmt_prepare(event_name, file, line, NULL, &jw);
|
63ab7419
|
398
|
jw_object_intmax(&jw, "exec_id", exec_id);
|
63ab7419
|
399
|
if (exe)
|
63ab7419
|
400
|
jw_object_string(&jw, "exe", exe);
|
63ab7419
|
401
|
jw_object_inline_begin_array(&jw, "argv");
|
63ab7419
|
402
|
jw_array_argv(&jw, argv);
|
63ab7419
|
403
|
jw_end(&jw);
|
63ab7419
|
404
|
jw_end(&jw);
|
63ab7419
|
406
|
tr2_dst_write_line(&tr2dst_event, &jw.json);
|
63ab7419
|
407
|
jw_release(&jw);
|
63ab7419
|
408
|
}
|
63ab7419
|
410
|
static void fn_exec_result_fl(const char *file, int line,
|
63ab7419
|
414
|
const char *event_name = "exec_result";
|
63ab7419
|
415
|
struct json_writer jw = JSON_WRITER_INIT;
|
63ab7419
|
417
|
jw_object_begin(&jw, 0);
|
63ab7419
|
418
|
event_fmt_prepare(event_name, file, line, NULL, &jw);
|
63ab7419
|
419
|
jw_object_intmax(&jw, "exec_id", exec_id);
|
63ab7419
|
420
|
jw_object_intmax(&jw, "code", code);
|
63ab7419
|
421
|
jw_end(&jw);
|
63ab7419
|
423
|
tr2_dst_write_line(&tr2dst_event, &jw.json);
|
63ab7419
|
424
|
jw_release(&jw);
|
63ab7419
|
425
|
}
|
63ab7419
|
458
|
static void fn_region_enter_printf_va_fl(const char *file, int line,
|
63ab7419
|
465
|
const char *event_name = "region_enter";
|
63ab7419
|
466
|
struct tr2tls_thread_ctx *ctx = tr2tls_get_self();
|
63ab7419
|
467
|
if (ctx->nr_open_regions <= tr2env_event_nesting_wanted) {
|
63ab7419
|
468
|
struct json_writer jw = JSON_WRITER_INIT;
|
63ab7419
|
470
|
jw_object_begin(&jw, 0);
|
63ab7419
|
471
|
event_fmt_prepare(
|
63ab7419
|
473
|
jw_object_intmax(&jw, "nesting", ctx->nr_open_regions);
|
63ab7419
|
474
|
if (category)
|
63ab7419
|
475
|
jw_object_string(&jw, "category", category);
|
63ab7419
|
476
|
if (label)
|
63ab7419
|
477
|
jw_object_string(&jw, "label", label);
|
63ab7419
|
478
|
maybe_add_string_va(&jw, "msg", fmt, ap);
|
63ab7419
|
479
|
jw_end(&jw);
|
63ab7419
|
481
|
tr2_dst_write_line(&tr2dst_event, &jw.json);
|
63ab7419
|
482
|
jw_release(&jw);
|
63ab7419
|
484
|
}
|
63ab7419
|
486
|
static void fn_region_leave_printf_va_fl(const char *file, int line,
|
63ab7419
|
494
|
const char *event_name = "region_leave";
|
63ab7419
|
495
|
struct tr2tls_thread_ctx *ctx = tr2tls_get_self();
|
63ab7419
|
496
|
if (ctx->nr_open_regions <= tr2env_event_nesting_wanted) {
|
63ab7419
|
497
|
struct json_writer jw = JSON_WRITER_INIT;
|
63ab7419
|
498
|
double t_rel = (double)us_elapsed_region / 1000000.0;
|
63ab7419
|
500
|
jw_object_begin(&jw, 0);
|
63ab7419
|
501
|
event_fmt_prepare(event_name, file, line, repo, &jw);
|
63ab7419
|
502
|
jw_object_double(&jw, "t_rel", 6, t_rel);
|
63ab7419
|
503
|
jw_object_intmax(&jw, "nesting", ctx->nr_open_regions);
|
63ab7419
|
504
|
if (category)
|
63ab7419
|
505
|
jw_object_string(&jw, "category", category);
|
63ab7419
|
506
|
if (label)
|
63ab7419
|
507
|
jw_object_string(&jw, "label", label);
|
63ab7419
|
508
|
maybe_add_string_va(&jw, "msg", fmt, ap);
|
63ab7419
|
509
|
jw_end(&jw);
|
63ab7419
|
511
|
tr2_dst_write_line(&tr2dst_event, &jw.json);
|
63ab7419
|
512
|
jw_release(&jw);
|
63ab7419
|
514
|
}
|
63ab7419
|
546
|
static void fn_data_json_fl(const char *file, int line,
|
63ab7419
|
554
|
const char *event_name = "data_json";
|
63ab7419
|
555
|
struct tr2tls_thread_ctx *ctx = tr2tls_get_self();
|
63ab7419
|
556
|
if (ctx->nr_open_regions <= tr2env_event_nesting_wanted) {
|
63ab7419
|
557
|
struct json_writer jw = JSON_WRITER_INIT;
|
63ab7419
|
558
|
double t_abs = (double)us_elapsed_absolute / 1000000.0;
|
63ab7419
|
559
|
double t_rel = (double)us_elapsed_region / 1000000.0;
|
63ab7419
|
561
|
jw_object_begin(&jw, 0);
|
63ab7419
|
562
|
event_fmt_prepare(event_name, file, line, repo, &jw);
|
63ab7419
|
563
|
jw_object_double(&jw, "t_abs", 6, t_abs);
|
63ab7419
|
564
|
jw_object_double(&jw, "t_rel", 6, t_rel);
|
63ab7419
|
565
|
jw_object_intmax(&jw, "nesting", ctx->nr_open_regions);
|
63ab7419
|
566
|
jw_object_string(&jw, "category", category);
|
63ab7419
|
567
|
jw_object_string(&jw, "key", key);
|
63ab7419
|
568
|
jw_object_sub_jw(&jw, "value", value);
|
63ab7419
|
569
|
jw_end(&jw);
|
63ab7419
|
571
|
tr2_dst_write_line(&tr2dst_event, &jw.json);
|
63ab7419
|
572
|
jw_release(&jw);
|
63ab7419
|
574
|
}
|
63ab7419
|
53
|
tr2_tbuf_local_time(&tb_now);
|
63ab7419
|
54
|
strbuf_addstr(buf, tb_now.buf);
|
63ab7419
|
55
|
strbuf_addch(buf, ' ');
|
63ab7419
|
57
|
if (file && *file)
|
63ab7419
|
58
|
strbuf_addf(buf, "%s:%d ", file, line);
|
63ab7419
|
59
|
while (buf->len < TR2FMT_NORMAL_FL_WIDTH)
|
63ab7419
|
60
|
strbuf_addch(buf, ' ');
|
63ab7419
|
106
|
static void fn_signal(uint64_t us_elapsed_absolute, int signo)
|
63ab7419
|
108
|
struct strbuf buf_payload = STRBUF_INIT;
|
63ab7419
|
109
|
double elapsed = (double)us_elapsed_absolute / 1000000.0;
|
63ab7419
|
111
|
strbuf_addf(&buf_payload, "signal elapsed:%.6f code:%d",
|
63ab7419
|
113
|
normal_io_write_fl(__FILE__, __LINE__, &buf_payload);
|
63ab7419
|
114
|
strbuf_release(&buf_payload);
|
63ab7419
|
115
|
}
|
63ab7419
|
140
|
if (fmt && *fmt) {
|
63ab7419
|
141
|
strbuf_addstr(buf, fmt);
|
63ab7419
|
142
|
return;
|
63ab7419
|
157
|
static void fn_command_path_fl(const char *file, int line,
|
63ab7419
|
160
|
struct strbuf buf_payload = STRBUF_INIT;
|
63ab7419
|
162
|
strbuf_addf(&buf_payload, "cmd_path %s", pathname);
|
63ab7419
|
163
|
normal_io_write_fl(file, line, &buf_payload);
|
63ab7419
|
164
|
strbuf_release(&buf_payload);
|
63ab7419
|
165
|
}
|
63ab7419
|
180
|
static void fn_command_subverb_fl(const char *file, int line,
|
63ab7419
|
183
|
struct strbuf buf_payload = STRBUF_INIT;
|
63ab7419
|
185
|
strbuf_addf(&buf_payload, "cmd_subverb %s", command_subverb);
|
63ab7419
|
186
|
normal_io_write_fl(file, line, &buf_payload);
|
63ab7419
|
187
|
strbuf_release(&buf_payload);
|
63ab7419
|
188
|
}
|
63ab7419
|
190
|
static void fn_alias_fl(const char *file, int line, const char *alias,
|
63ab7419
|
193
|
struct strbuf buf_payload = STRBUF_INIT;
|
63ab7419
|
195
|
strbuf_addf(&buf_payload, "alias %s ->", alias);
|
63ab7419
|
196
|
sq_quote_argv_pretty(&buf_payload, argv);
|
63ab7419
|
197
|
normal_io_write_fl(file, line, &buf_payload);
|
63ab7419
|
198
|
strbuf_release(&buf_payload);
|
63ab7419
|
199
|
}
|
63ab7419
|
201
|
static void fn_child_start_fl(const char *file, int line,
|
63ab7419
|
205
|
struct strbuf buf_payload = STRBUF_INIT;
|
63ab7419
|
207
|
strbuf_addf(&buf_payload, "child_start[%d] ", cmd->trace2_child_id);
|
63ab7419
|
209
|
if (cmd->dir) {
|
63ab7419
|
210
|
strbuf_addstr(&buf_payload, " cd");
|
63ab7419
|
211
|
sq_quote_buf_pretty(&buf_payload, cmd->dir);
|
63ab7419
|
212
|
strbuf_addstr(&buf_payload, "; ");
|
63ab7419
|
220
|
if (cmd->git_cmd)
|
63ab7419
|
221
|
strbuf_addstr(&buf_payload, "git");
|
63ab7419
|
222
|
sq_quote_argv_pretty(&buf_payload, cmd->argv);
|
63ab7419
|
224
|
normal_io_write_fl(file, line, &buf_payload);
|
63ab7419
|
225
|
strbuf_release(&buf_payload);
|
63ab7419
|
226
|
}
|
63ab7419
|
228
|
static void fn_child_exit_fl(const char *file, int line,
|
63ab7419
|
233
|
struct strbuf buf_payload = STRBUF_INIT;
|
63ab7419
|
234
|
double elapsed = (double)us_elapsed_child / 1000000.0;
|
63ab7419
|
236
|
strbuf_addf(&buf_payload, "child_exit[%d] pid:%d code:%d elapsed:%.6f",
|
63ab7419
|
238
|
normal_io_write_fl(file, line, &buf_payload);
|
63ab7419
|
239
|
strbuf_release(&buf_payload);
|
63ab7419
|
240
|
}
|
63ab7419
|
242
|
static void fn_exec_fl(const char *file, int line,
|
63ab7419
|
246
|
struct strbuf buf_payload = STRBUF_INIT;
|
63ab7419
|
248
|
strbuf_addf(&buf_payload, "exec[%d] ", exec_id);
|
63ab7419
|
249
|
if (exe)
|
63ab7419
|
250
|
strbuf_addstr(&buf_payload, exe);
|
63ab7419
|
251
|
sq_quote_argv_pretty(&buf_payload, argv);
|
63ab7419
|
252
|
normal_io_write_fl(file, line, &buf_payload);
|
63ab7419
|
253
|
strbuf_release(&buf_payload);
|
63ab7419
|
254
|
}
|
63ab7419
|
256
|
static void fn_exec_result_fl(const char *file, int line,
|
63ab7419
|
260
|
struct strbuf buf_payload = STRBUF_INIT;
|
63ab7419
|
262
|
strbuf_addf(&buf_payload, "exec_result[%d] code:%d", exec_id, code);
|
63ab7419
|
263
|
if (code > 0)
|
63ab7419
|
264
|
strbuf_addf(&buf_payload, " err:%s", strerror(code));
|
63ab7419
|
265
|
normal_io_write_fl(file, line, &buf_payload);
|
63ab7419
|
266
|
strbuf_release(&buf_payload);
|
63ab7419
|
267
|
}
|
63ab7419
|
269
|
static void fn_param_fl(const char *file, int line, const char *param,
|
63ab7419
|
272
|
struct strbuf buf_payload = STRBUF_INIT;
|
63ab7419
|
274
|
strbuf_addf(&buf_payload, "def_param %s=%s", param, value);
|
63ab7419
|
275
|
normal_io_write_fl(file, line, &buf_payload);
|
63ab7419
|
276
|
strbuf_release(&buf_payload);
|
63ab7419
|
277
|
}
|
63ab7419
|
279
|
static void fn_repo_fl(const char *file, int line,
|
63ab7419
|
282
|
struct strbuf buf_payload = STRBUF_INIT;
|
63ab7419
|
284
|
strbuf_addstr(&buf_payload, "worktree ");
|
63ab7419
|
285
|
sq_quote_buf_pretty(&buf_payload, repo->worktree);
|
63ab7419
|
286
|
normal_io_write_fl(file, line, &buf_payload);
|
63ab7419
|
287
|
strbuf_release(&buf_payload);
|
63ab7419
|
288
|
}
|
63ab7419
|
290
|
static void fn_printf_va_fl(const char *file, int line,
|
63ab7419
|
294
|
struct strbuf buf_payload = STRBUF_INIT;
|
63ab7419
|
296
|
maybe_append_string_va(&buf_payload, fmt, ap);
|
63ab7419
|
297
|
normal_io_write_fl(file, line, &buf_payload);
|
63ab7419
|
298
|
strbuf_release(&buf_payload);
|
63ab7419
|
299
|
}
|
63ab7419
|
83
|
tr2_tbuf_local_time(&tb_now);
|
63ab7419
|
84
|
strbuf_addstr(buf, tb_now.buf);
|
63ab7419
|
85
|
strbuf_addch(buf, ' ');
|
63ab7419
|
87
|
if (file && *file)
|
63ab7419
|
88
|
strbuf_addf(buf, "%s:%d ", file, line);
|
63ab7419
|
89
|
while (buf->len < TR2FMT_PERF_FL_WIDTH)
|
63ab7419
|
90
|
strbuf_addch(buf, ' ');
|
63ab7419
|
92
|
strbuf_addstr(buf, "| ");
|
63ab7419
|
102
|
strbuf_addf(buf, "r%d ", repo->trace2_repo_id);
|
63ab7419
|
125
|
strbuf_addf(buf, "%s", dots.buf);
|
63ab7419
|
126
|
len_indent -= dots.len;
|
63ab7419
|
192
|
static void fn_signal(uint64_t us_elapsed_absolute, int signo)
|
63ab7419
|
194
|
const char *event_name = "signal";
|
63ab7419
|
195
|
struct strbuf buf_payload = STRBUF_INIT;
|
63ab7419
|
197
|
strbuf_addf(&buf_payload, "signo:%d", signo);
|
63ab7419
|
199
|
perf_io_write_fl(__FILE__, __LINE__, event_name, NULL,
|
63ab7419
|
202
|
strbuf_release(&buf_payload);
|
63ab7419
|
203
|
}
|
63ab7419
|
230
|
if (fmt && *fmt) {
|
63ab7419
|
231
|
strbuf_addstr(buf, fmt);
|
63ab7419
|
232
|
return;
|
63ab7419
|
250
|
static void fn_command_path_fl(const char *file, int line,
|
63ab7419
|
253
|
const char *event_name = "cmd_path";
|
63ab7419
|
254
|
struct strbuf buf_payload = STRBUF_INIT;
|
63ab7419
|
256
|
strbuf_addstr(&buf_payload, pathname);
|
63ab7419
|
258
|
perf_io_write_fl(file, line, event_name, NULL,
|
63ab7419
|
261
|
strbuf_release(&buf_payload);
|
63ab7419
|
262
|
}
|
63ab7419
|
281
|
static void fn_command_subverb_fl(const char *file, int line,
|
63ab7419
|
284
|
const char *event_name = "cmd_subverb";
|
63ab7419
|
285
|
struct strbuf buf_payload = STRBUF_INIT;
|
63ab7419
|
287
|
strbuf_addstr(&buf_payload, command_subverb);
|
63ab7419
|
289
|
perf_io_write_fl(file, line, event_name, NULL,
|
63ab7419
|
292
|
strbuf_release(&buf_payload);
|
63ab7419
|
293
|
}
|
63ab7419
|
295
|
static void fn_alias_fl(const char *file, int line, const char *alias,
|
63ab7419
|
298
|
const char *event_name = "alias";
|
63ab7419
|
299
|
struct strbuf buf_payload = STRBUF_INIT;
|
63ab7419
|
301
|
strbuf_addf(&buf_payload, "alias:%s argv:", alias);
|
63ab7419
|
302
|
sq_quote_argv_pretty(&buf_payload, argv);
|
63ab7419
|
304
|
perf_io_write_fl(file, line, event_name, NULL,
|
63ab7419
|
307
|
strbuf_release(&buf_payload);
|
63ab7419
|
308
|
}
|
63ab7419
|
318
|
strbuf_addf(&buf_payload, "[ch%d] class:hook hook:%s",
|
63ab7419
|
328
|
strbuf_addstr(&buf_payload, " cd:");
|
63ab7419
|
329
|
sq_quote_buf_pretty(&buf_payload, cmd->dir);
|
63ab7419
|
334
|
strbuf_addstr(&buf_payload, " git");
|
63ab7419
|
359
|
static void fn_thread_start_fl(const char *file, int line,
|
63ab7419
|
362
|
const char *event_name = "thread_start";
|
63ab7419
|
363
|
struct strbuf buf_payload = STRBUF_INIT;
|
63ab7419
|
365
|
perf_io_write_fl(file, line, event_name, NULL,
|
63ab7419
|
368
|
strbuf_release(&buf_payload);
|
63ab7419
|
369
|
}
|
63ab7419
|
371
|
static void fn_thread_exit_fl(const char *file, int line,
|
63ab7419
|
375
|
const char *event_name = "thread_exit";
|
63ab7419
|
376
|
struct strbuf buf_payload = STRBUF_INIT;
|
63ab7419
|
378
|
perf_io_write_fl(file, line, event_name, NULL,
|
63ab7419
|
381
|
strbuf_release(&buf_payload);
|
63ab7419
|
382
|
}
|
63ab7419
|
384
|
static void fn_exec_fl(const char *file, int line,
|
63ab7419
|
388
|
const char *event_name = "exec";
|
63ab7419
|
389
|
struct strbuf buf_payload = STRBUF_INIT;
|
63ab7419
|
391
|
strbuf_addf(&buf_payload, "id:%d ", exec_id);
|
63ab7419
|
392
|
strbuf_addstr(&buf_payload, "argv:");
|
63ab7419
|
393
|
if (exe)
|
63ab7419
|
394
|
strbuf_addf(&buf_payload, " %s", exe);
|
63ab7419
|
395
|
sq_quote_argv_pretty(&buf_payload, argv);
|
63ab7419
|
397
|
perf_io_write_fl(file, line, event_name, NULL,
|
63ab7419
|
400
|
strbuf_release(&buf_payload);
|
63ab7419
|
401
|
}
|
63ab7419
|
403
|
static void fn_exec_result_fl(const char *file, int line,
|
63ab7419
|
407
|
const char *event_name = "exec_result";
|
63ab7419
|
408
|
struct strbuf buf_payload = STRBUF_INIT;
|
63ab7419
|
410
|
strbuf_addf(&buf_payload, "id:%d code:%d", exec_id, code);
|
63ab7419
|
411
|
if (code > 0)
|
63ab7419
|
412
|
strbuf_addf(&buf_payload, " err:%s", strerror(code));
|
63ab7419
|
414
|
perf_io_write_fl(file, line, event_name, NULL,
|
63ab7419
|
417
|
strbuf_release(&buf_payload);
|
63ab7419
|
418
|
}
|
63ab7419
|
420
|
static void fn_param_fl(const char *file, int line,
|
63ab7419
|
423
|
const char *event_name = "def_param";
|
63ab7419
|
424
|
struct strbuf buf_payload = STRBUF_INIT;
|
63ab7419
|
426
|
strbuf_addf(&buf_payload, "%s:%s", param, value);
|
63ab7419
|
428
|
perf_io_write_fl(file, line, event_name, NULL,
|
63ab7419
|
431
|
strbuf_release(&buf_payload);
|
63ab7419
|
432
|
}
|
63ab7419
|
434
|
static void fn_repo_fl(const char *file, int line,
|
63ab7419
|
437
|
const char *event_name = "def_repo";
|
63ab7419
|
438
|
struct strbuf buf_payload = STRBUF_INIT;
|
63ab7419
|
440
|
strbuf_addstr(&buf_payload, "worktree:");
|
63ab7419
|
441
|
sq_quote_buf_pretty(&buf_payload, repo->worktree);
|
63ab7419
|
443
|
perf_io_write_fl(file, line, event_name, repo,
|
63ab7419
|
446
|
strbuf_release(&buf_payload);
|
63ab7419
|
447
|
}
|
63ab7419
|
449
|
static void fn_region_enter_printf_va_fl(const char *file, int line,
|
63ab7419
|
456
|
const char *event_name = "region_enter";
|
63ab7419
|
457
|
struct strbuf buf_payload = STRBUF_INIT;
|
63ab7419
|
459
|
if (label)
|
63ab7419
|
460
|
strbuf_addf(&buf_payload, "label:%s ", label);
|
63ab7419
|
461
|
maybe_append_string_va(&buf_payload, fmt, ap);
|
63ab7419
|
463
|
perf_io_write_fl(file, line, event_name, repo,
|
63ab7419
|
466
|
strbuf_release(&buf_payload);
|
63ab7419
|
467
|
}
|
63ab7419
|
469
|
static void fn_region_leave_printf_va_fl(const char *file, int line,
|
63ab7419
|
477
|
const char *event_name = "region_leave";
|
63ab7419
|
478
|
struct strbuf buf_payload = STRBUF_INIT;
|
63ab7419
|
480
|
if (label)
|
63ab7419
|
481
|
strbuf_addf(&buf_payload, "label:%s ", label);
|
63ab7419
|
482
|
maybe_append_string_va(&buf_payload, fmt, ap);
|
63ab7419
|
484
|
perf_io_write_fl(file, line, event_name, repo,
|
63ab7419
|
487
|
strbuf_release(&buf_payload);
|
63ab7419
|
488
|
}
|
63ab7419
|
490
|
static void fn_data_fl(const char *file, int line,
|
63ab7419
|
498
|
const char *event_name = "data";
|
63ab7419
|
499
|
struct strbuf buf_payload = STRBUF_INIT;
|
63ab7419
|
501
|
strbuf_addf(&buf_payload, "%s:%s", key, value);
|
63ab7419
|
503
|
perf_io_write_fl(file, line, event_name, repo,
|
63ab7419
|
506
|
strbuf_release(&buf_payload);
|
63ab7419
|
507
|
}
|
63ab7419
|
509
|
static void fn_data_json_fl(const char *file, int line,
|
63ab7419
|
517
|
const char *event_name = "data_json";
|
63ab7419
|
518
|
struct strbuf buf_payload = STRBUF_INIT;
|
63ab7419
|
520
|
strbuf_addf(&buf_payload, "%s:%s", key, value->json.buf);
|
63ab7419
|
522
|
perf_io_write_fl(file, line, event_name, repo,
|
63ab7419
|
525
|
strbuf_release(&buf_payload);
|
63ab7419
|
526
|
}
|
63ab7419
|
528
|
static void fn_printf_va_fl(const char *file, int line,
|
63ab7419
|
532
|
const char *event_name = "printf";
|
63ab7419
|
533
|
struct strbuf buf_payload = STRBUF_INIT;
|
63ab7419
|
535
|
maybe_append_string_va(&buf_payload, fmt, ap);
|
63ab7419
|
537
|
perf_io_write_fl(file, line, event_name, NULL,
|
63ab7419
|
540
|
strbuf_release(&buf_payload);
|
63ab7419
|
541
|
}
|
Ævar Arnfjörð Bjarmason
|
6a83d902
|
coccinelle: make use of the "type" FREE_AND_NULL() rule
|
Alban Gruin
|
febebd99
|
sequencer: refactor rearrange_squash() to work on a todo_list
|
Alban Gruin
|
c27b32f0
|
sequencer: refactor check_todo_list() to work on a todo_list
|
Alban Gruin
|
4d55dfd7
|
rebase-interactive: move transform_todo_file() to rebase--interactive.c
|
Alban Gruin
|
8414c890
|
sequencer: refactor sequencer_add_exec_commands() to work on a todo_list
|
Alban Gruin
|
e5b1c9d9
|
rebase-interactive: rewrite edit_todo_list() to handle the initial edit
|
Anders Waldenborg
|
4681fe38
|
pretty: allow showing specific trailers
|
Anders Waldenborg
|
b755bf6f
|
pretty: allow %(trailers) options with explicit value
|
Barret Rhoden
|
07d04b91
|
blame: add a config option to mark ignored lines
|
Barret Rhoden
|
e7973c85
|
blame: add the ability to ignore commits and their changes
|
Barret Rhoden
|
ef644c41
|
Move init_skiplist() outside of fsck
|
Brandon Williams
|
373d70ef
|
protocol: introduce protocol extension mechanisms
|
Brandon Williams
|
0f1dc53f
|
remote-curl: implement stateless-connect command
|
Brian Gianforcaro
|
eeefa7c9
|
Style fixes, add a space after if/for/while.
|
brian m. carlson
|
6390fe20
|
pack-redundant: convert linked lists to use struct object_id
|
Charles Bailey
|
2a514ed8
|
parse-options: move unsigned long option parsing out of pack-objects.c
|
David Turner
|
d1dd94b3
|
Do not print 'dangling' for cat-file in case of ambiguity
|
Derrick Stolee
|
4f6d26b1
|
list-objects: consume sparse tree walk
|
Derrick Stolee
|
d5d2e935
|
revision: implement sparse algorithm
|
Derrick Stolee
|
f1f5de44
|
revision: add mark_tree_uninteresting_sparse
|
Eugene Letuchy
|
31653c1a
|
Make git blame's date output format configurable, like git log
|
Jeff Hostetler
|
3e56cbd8
|
trace2: t/helper/test-trace2, t0210.sh, t0211.sh, t0212.sh
|
Jeff Hostetler
|
63ab7419
|
trace2: create new combined trace facility
|
Jeff Hostetler
|
603036d9
|
trace2:data: add editor/pager child classification
|
Jeff King
|
01f8d594
|
prefer "hash mismatch" to "sha1 mismatch"
|
Jeff King
|
34a9469d
|
remote-curl: refactor smart-http discovery
|
Jeff King
|
76011357
|
sha1-file: prefer "loose object file" to "sha1 file" in messages
|
Jeff King
|
2c319886
|
sha1-file: avoid "sha1 file" for generic use in messages
|
Jeff King
|
dd63f169
|
move "--follow needs one pathspec" rule to diff_setup_done
|
Jeff King
|
246f0ede
|
execv_dashed_external: stop exiting with negative code
|
Jeff King
|
a5481a6c
|
convert "enum date_mode" into a struct
|
Jeff Smith
|
b543bb1c
|
blame: move scoreboard-related methods to libgit
|
Jiang Xin
|
cb7e0336
|
pack-redundant: rename pack_list.all_objects
|
Joel Teichroeb
|
f6bbd781
|
stash: convert apply to builtin
|
Joel Teichroeb
|
cdca49bc
|
stash: convert drop and clear to builtin
|
Joel Teichroeb
|
e1d01876
|
stash: convert pop to builtin
|
Johannes Schindelin
|
5f1a63e0
|
Read configuration also from $HOME/.gitconfig
|
Johannes Schindelin
|
3546c8d9
|
rebase -i: also expand/collapse the SHA-1s via the rebase--helper
|
Johannes Schindelin
|
d04fa788
|
ci: parallelize testing on Windows
|
Johannes Schindelin
|
dc2d9ba3
|
is_{hfs,ntfs}_dotgitmodules: add tests
|
Johannes Schindelin
|
a5c09131
|
tests: avoid calling Perl just to determine file sizes
|
Johannes Schindelin
|
cdac2b01
|
rebase -i: skip unnecessary picks using the rebase--helper
|
Johannes Schindelin
|
2987e8cd
|
tests: include detailed trace logs with --write-junit-xml upon failure
|
Johannes Schindelin
|
b6fc0026
|
tests: optionally write results as JUnit-style .xml
|
Johannes Schindelin
|
033abf97
|
Replace all die("BUG: ...") calls by BUG() ones
|
Johannes Schindelin
|
26799a20
|
stash: optionally use the scripted version again
|
Johannes Schindelin
|
bec65d5b
|
tests: add a special setup where stash.useBuiltin is off
|
Johannes Sixt
|
0ac77ec3
|
run_command: report system call errors instead of returning error codes
|
Jonathan Nieder
|
7d29afd4
|
i18n: mark relative dates for translation
|
Jonathan Nieder
|
309be813
|
update-index: migrate to parse-options API
|
Jonathan Nieder
|
1e5ce570
|
parse-options: clearer reporting of API misuse
|
Josh Steadmon
|
6da1f1a9
|
protocol: advertise multiple supported versions
|
Junio C Hamano
|
93c1e079
|
config-set: check write-in-full returns in set_multivar
|
Junio C Hamano
|
9409c7a5
|
config: "git config baa" should exit with status 1
|
Junio C Hamano
|
af465af8
|
parse-options: detect attempt to add a duplicate short option name
|
Liam Beguin
|
0cce4a27
|
rebase -i -x: add exec commands via the rebase--helper
|
Linus Torvalds
|
acdd3776
|
Add 'human' date format
|
Lukas_Sandström
|
1c3039e8
|
Make git-pack-redundant consider alt-odbs
|
Martin Koegler
|
5efde212
|
zlib.c: use size_t for size
|
Nguyễn Thái Ngọc Duy
|
a12c1ff3
|
config: factor out set_config_source_file()
|
Nguyễn Thái Ngọc Duy
|
1d28ff4c
|
builtin/config.c: mark more strings for translation
|
Nguyễn Thái Ngọc Duy
|
a92ec7ef
|
parse-options: fix SunCC compiler warning
|
Nguyễn Thái Ngọc Duy
|
f62470c6
|
parse-options: add OPT_BITOP()
|
Nguyễn Thái Ngọc Duy
|
b221b5ab
|
completion: collapse extra --no-.. options
|
Nguyễn Thái Ngọc Duy
|
8f7c7f55
|
config.c: add repo_config_set_worktree_gently()
|
Nguyễn Thái Ngọc Duy
|
ebc4a04e
|
remote: force completing --mirror= instead of --mirror
|
Nguyễn Thái Ngọc Duy
|
b9d7f4b4
|
parse-options: support --git-completion-helper
|
Nguyễn Thái Ngọc Duy
|
3ebbe289
|
parse-options: allow ll_callback with OPTION_CALLBACK
|
Nguyễn Thái Ngọc Duy
|
aad6fddb
|
connect.c: mark more strings for translation
|
Nguyễn Thái Ngọc Duy
|
8aa8c140
|
git.c: mark more strings for translation
|
Nguyễn Thái Ngọc Duy
|
d473e2e0
|
diff.c: convert -U|--unified
|
Paul-Sebastian Ungureanu
|
bfc3fe33
|
strbuf.c: add `strbuf_insertf()` and `strbuf_vinsertf()`
|
Paul-Sebastian Ungureanu
|
9a95010a
|
stash: make push -q quiet
|
Paul-Sebastian Ungureanu
|
847eb0b0
|
stash: convert store to builtin
|
Paul-Sebastian Ungureanu
|
fa38428f
|
stash: convert push to builtin
|
Paul-Sebastian Ungureanu
|
1f5a011d
|
stash: convert create to builtin
|
Paul-Sebastian Ungureanu
|
b4493f26
|
stash: convert show to builtin
|
Paul-Sebastian Ungureanu
|
51809c70
|
stash: convert `stash--helper.c` into `stash.c`
|
Peter Krefting
|
78bde923
|
i18n: read-cache: typofix
|
Pierre Habouzit
|
5817da01
|
git-blame: migrate to incremental parse-option [1/2]
|
Pratik Karki
|
c54dacb5
|
builtin rebase: start a new rebase only if none is in progress
|
Stefan Beller
|
c553c72e
|
run-command: add an asynchronous parallel child processor
|
Stefan Xenos
|
9e98e9b6
|
sha1-array: implement oid_array_readonly_contains()
|
Stefan Xenos
|
73f8829d
|
evolve: implement the 'git change' command
|
Stefan Xenos
|
6b8678e5
|
evolve: add support for writing metacommits
|
Stefan Xenos
|
287a8679
|
evolve: add the change-table structure
|
Stefan Xenos
|
49854277
|
evolve: add the 'git change list' command
|
Stefan Xenos
|
6930f34d
|
evolve: add support for parsing metacommits
|
Stephen Boyd
|
df217ed6
|
parse-opts: add OPT_FILENAME and transition builtins
|
Takashi Iwai
|
507d7804
|
pager: don't use unsafe functions in signal handlers
|
Timo Hirvonen
|
bd22c904
|
Fix sparse warnings
|
Torsten Bögershausen
|
76759c7d
|
git on Mac OS and precomposed unicode
|
Ævar Arnfjörð Bjarmason
|
8a6179bc
|
i18n: git-commit basic messages
|
Brandon Williams
|
685fbd32
|
fetch-pack: perform a fetch using v2
|
Brandon Williams
|
359efeff
|
repository: introduce the repository object
|
Daniels Umanovskis
|
0ecb1fc7
|
branch: introduce --show-current display option
|
Denton Liu
|
f39a9c65
|
remote: add --save-to-push option to git remote set-url
|
Derrick Stolee
|
467ae6f9
|
multi-pack-index: prepare 'repack' subcommand
|
Derrick Stolee
|
cce99cd8
|
commit-graph: writing missing parents is a BUG
|
Derrick Stolee
|
3c9e7185
|
multi-pack-index: implement 'expire' subcommand
|
Derrick Stolee
|
91336887
|
repack: refactor pack deletion for future use
|
Derrick Stolee
|
19c239d4
|
midx: implement midx_repack()
|
Derrick Stolee
|
cc6af73c
|
multi-pack-index: verify object offsets
|
Elijah Newren
|
c43ba42e
|
merge-recursive: Make BUG message more legible by adding a newline
|
Elijah Newren
|
d90e759f
|
merge-recursive: fix numerous argument alignment issues
|
Jay Soffian
|
66f4b98a
|
Teach merge the '[-e|--edit]' option
|
Jeff Hostetler
|
10ac85c7
|
upload-pack: add object filtering for partial clone
|
Jeff King
|
d6991cee
|
ident: keep separate "explicit" flags for author and committer
|
Jeff King
|
862e80a4
|
ident: handle NULL email when complaining of empty name
|
Jeff King
|
00a7760e
|
sha1-file: modernize loose header/stream functions
|
Jeff King
|
f6371f92
|
sha1_file: add read_loose_object() function
|
Jeff King
|
05e95155
|
upload-pack: send keepalive packets during pack computation
|
Jeff King
|
514c5fdd
|
sha1-file: modernize loose object file functions
|
Johannes Schindelin
|
2b6ad0f4
|
rebase --rebase-merges: add support for octopus merges
|
Johannes Schindelin
|
21853626
|
built-in rebase: call `git am` directly
|
Johannes Schindelin
|
c5233708
|
rebase: move `reset_head()` into a better spot
|
Johannes Schindelin
|
9055e401
|
sequencer: introduce new commands to reset the revision
|
Johannes Schindelin
|
6003303a
|
merge-recursive: switch to returning errors instead of dying
|
Johannes Schindelin
|
033abf97
|
Replace all die("BUG: ...") calls by BUG() ones
|
Jonathan Nieder
|
ee70c128
|
index: offer advice for unknown index extensions
|
Jonathan Tan
|
fbd76cd4
|
sideband: reverse its dependency on pkt-line
|
Jonathan Tan
|
0bbc0bc5
|
{fetch,upload}-pack: sideband v2 fetch response
|
Josh Steadmon
|
aa658574
|
commit-graph, fuzz: add fuzzer for commit-graph
|
Junio C Hamano
|
19c6a4f8
|
merge-recursive: do not return NULL only to cause segfault
|
Junio C Hamano
|
bad68ec9
|
index: make the index file format extensible.
|
Junio C Hamano
|
a85b377d
|
push: the beginning of "git push --signed"
|
Junio C Hamano
|
d21f8426
|
unpack_sha1_header(): detect malformed object header
|
Lars Schneider
|
bb643d8b
|
pkt-line: add functions to read/write flush terminated packet streams
|
Martin Ågren
|
e0c4a731
|
setup: fix memory leaks with `struct repository_format`
|
Masaya Suzuki
|
01f9ec64
|
Use packet_reader instead of packet_read_line
|
Michael J Gruber
|
62dc42b9
|
merge: clarify call chain
|
Miklos Vajna
|
9047ebbc
|
Split out merge_recursive() to merge-recursive.c
|
Nguyễn Thái Ngọc Duy
|
f616db6a
|
builtin/pack-objects.c: mark more strings for translation
|
Nguyễn Thái Ngọc Duy
|
4f5b532d
|
commit-graph.c: mark more strings for translation
|
Nguyễn Thái Ngọc Duy
|
1dd73e20
|
fetch-pack.c: mark strings for translating
|
Nguyễn Thái Ngọc Duy
|
ac77d0c3
|
pack-objects: shrink size field in struct object_entry
|
Nguyễn Thái Ngọc Duy
|
ff7fe37b
|
diff.c: move read_index() code back to the caller
|
Nickolai Belakovski
|
6ccd3780
|
ref-filter: add worktreepath atom
|
Olga Telezhnaya
|
74efea94
|
ref-filter: add return value to parsers
|
Paul Tan
|
7ff26832
|
builtin-am: implement -i/--interactive
|
Paul Tan
|
11b6d178
|
pull: pass git-merge's options to git-merge
|
Phillip Wood
|
d0aaa46f
|
commit: move empty message checks to libgit
|
Phillip Wood
|
66618a50
|
sequencer: run 'prepare-commit-msg' hook
|
Pranit Bauva
|
e3b1e3bd
|
wrapper: move is_empty_file() and rename it as is_empty_or_missing_file()
|
Pranit Bauva
|
06f5608c
|
bisect--helper: `bisect_start` shell function partially in C
|
Pranit Bauva
|
450ebb73
|
bisect--helper: `get_terms` & `bisect_terms` shell function in C
|
Pranit Bauva
|
129a6cf3
|
bisect--helper: `bisect_next_check` shell function in C
|
Pranit Bauva
|
0f30233a
|
bisect--helper: `bisect_write` shell function in C
|
Pranit Bauva
|
5e82c3dd
|
bisect--helper: `bisect_reset` shell function in C
|
Pranit Bauva
|
ecb3f373
|
bisect--helper: `write_terms` shell function in C
|
Pratik Karki
|
122420c2
|
builtin rebase: support --skip
|
Stefan Beller
|
18cfc088
|
submodule.c: move submodule merging to merge-recursive.c
|
Stephan Beyer
|
73118f89
|
merge-recursive.c: Add more generic merge_recursive_generic()
|
Sven Strickroth
|
b64c1e07
|
commit: do not lose SQUASH_MSG contents
|
Torsten Bögershausen
|
ca473cef
|
Upcast size_t variables to uintmax_t when printing
|
Torsten Bögershausen
|
9472935d
|
add: introduce "--renormalize"
|
William Hubbs
|
7e43b32b
|
Add author and committer configuration settings
|
Ævar Arnfjörð Bjarmason
|
e8a8a4d7
|
i18n: git-checkout basic messages
|
Brandon Williams
|
f9ee2fcd
|
grep: recurse in-process using 'struct repository'
|
Brandon Williams
|
f7e20501
|
fetch-pack: support shallow requests
|
brian m. carlson
|
ac73cedf
|
hash: create union for hash context allocation
|
brian m. carlson
|
50c817e0
|
t: make the sha1 test-tool helper generic
|
brian m. carlson
|
0a3faa45
|
tree-walk: copy object ID before use
|
brian m. carlson
|
37649b7f
|
t/helper: add a test helper to compute hash speed
|
brian m. carlson
|
47edb649
|
hex: introduce functions to print arbitrary hashes
|
brian m. carlson
|
ea82b2a0
|
tree-walk: store object_id in a separate member
|
Derrick Stolee
|
5227c385
|
commit-reach: move walk methods from commit.c
|
Issac Trotts
|
ad6f028f
|
log: add %S option (like --source) to log --format
|
Jeff Hostetler
|
aa57b871
|
fetch: inherit filter-spec from partial clone
|
Jeff King
|
ee1c6c34
|
sha1_file: only freshen packs once per run
|
Johannes Schindelin
|
d421afa0
|
rebase: introduce --reschedule-failed-exec
|
Jonathan Tan
|
4316ff30
|
fetch-pack: support protocol version 2
|
Jonathan Tan
|
0b6069fe
|
fetch-pack: test support excluding large blobs
|
Jonathan Tan
|
3390e42a
|
fetch-pack: support negotiation tip whitelist
|
Junio C Hamano
|
60c38b9e
|
Merge branch 'bc/tree-walk-oid' into next
|
Linus Torvalds
|
12dccc16
|
Make fiel checkout function available to the git library
|
Masaya Suzuki
|
b79bdd8c
|
remote-curl: unset CURLOPT_FAILONERROR
|
Masaya Suzuki
|
e6cf87b1
|
http: enable keep_error for HTTP requests
|
Matthew DeVore
|
bc5975d2
|
list-objects-filter: implement filter tree:0
|
Nguyễn Thái Ngọc Duy
|
1a07e59c
|
Update messages in preparation for i18n
|
Nicolas Pitre
|
bd2c39f5
|
[PATCH] don't load and decompress objects twice with parse_object()
|
Phillip Wood
|
21536d07
|
diff --color-moved-ws: modify allow-indentation-change
|
Phillip Wood
|
b73bcbac
|
diff: allow --no-color-moved-ws
|
Pratik Karki
|
ba1905a5
|
builtin rebase: add support for custom merge strategies
|
Takuto Ikuta
|
024aa469
|
fetch-pack.c: use oidset to check existence of loose object
|
Thomas Gummerer
|
536ec183
|
entry: support CE_WT_REMOVE flag in checkout_entry
|
Thomas Gummerer
|
091e04bc
|
checkout: introduce --{,no-}overlay option
|
Vasco Almeida
|
e923a8ab
|
i18n: standardise messages
|
Ævar Arnfjörð Bjarmason
|
9f97ab08
|
i18n: git-checkout: our/their version message
|
Ævar Arnfjörð Bjarmason
|
dd8dd300
|
push: add an advice on unqualified push
|
Brandon Casey
|
3c386aa3
|
reflog-delete: parse standard reflog options
|
Brandon Williams
|
debca9d2
|
object: rename function 'typename' to 'type_name'
|
brian m. carlson
|
273f8ee8
|
builtin/fast-export: convert to struct object_id
|
David Barr
|
8dc6a373
|
fast-import: add 'ls' command
|
David Turner
|
afcb2e7a
|
git-reflog: add exists command
|
Derrick Stolee
|
cce99cd8
|
commit-graph: writing missing parents is a BUG
|
Elijah Newren
|
37b65ce3
|
merge-recursive: new function for better colliding conflict resolutions
|
Elijah Newren
|
f129c427
|
fast-export: move commit rewriting logic into a function for reuse
|
Elijah Newren
|
7f867165
|
merge-recursive: fix rename/add conflict handling
|
Elijah Newren
|
02c48cd6
|
fast-export: Omit tags that tag trees
|
Erik Faye-Lund
|
2d07f6d4
|
builtin-fast-export.c: turn error into warning
|
Felipe Contreras
|
3e9b9cb1
|
fast-export: refactor get_tags_and_duplicates()
|
Force Charlie
|
d73019fe
|
http: add support selecting http version
|
Jameson Miller
|
a849735b
|
block alloc: add lifecycle APIs for cache_entry structs
|
Jameson Miller
|
8616a2d0
|
block alloc: add validations around cache_entry lifecyle
|
Jeff King
|
a8722750
|
teach fast-export an --anonymize option
|
Jeff King
|
b69fb867
|
sha1_file_name(): overwrite buffer instead of appending
|
Jeff King
|
3a2e0824
|
object-store: provide helpers for loose_objects_cache
|
Jeff King
|
c8d521fa
|
Add delta-islands.{c,h}
|
Jeff King
|
f0eaf638
|
sha1-file: use an object_directory for the main object dir
|
Jeff Smith
|
09002f1b
|
blame: move scoreboard setup to libgit
|
Johannes Schindelin
|
ba97aea1
|
sequencer: extract helper to update active_cache_tree
|
Johannes Schindelin
|
aee42e1f
|
sequencer: strip bogus LF at end of error messages
|
Johannes Schindelin
|
6e98de72
|
sequencer (rebase -i): add support for the 'fixup' and 'squash' commands
|
Johannes Schindelin
|
88d5a271
|
sequencer: lib'ify save_opts()
|
Johannes Schindelin
|
2b6ad0f4
|
rebase --rebase-merges: add support for octopus merges
|
Johannes Schindelin
|
552cecc2
|
Teach "git reflog" a subcommand to delete single entries
|
Johannes Schindelin
|
cdac2b01
|
rebase -i: skip unnecessary picks using the rebase--helper
|
Johannes Schindelin
|
2863584f
|
sequencer: get rid of the subcommand field
|
Johannes Schindelin
|
033abf97
|
Replace all die("BUG: ...") calls by BUG() ones
|
Johannes Schindelin
|
75456f96
|
merge-recursive: handle return values indicating errors
|
Johannes Schindelin
|
f2dc849e
|
Add 'git fast-export', the sister of 'git fast-import'
|
Johannes Schindelin
|
15ef6931
|
rebase --skip: clean up commit message after a failed fixup/squash
|
Johannes Schindelin
|
56dc3ab0
|
sequencer (rebase -i): implement the 'edit' command
|
Jonathan Tan
|
b3e8ca89
|
fast-export: do not copy from modified file
|
Junio C Hamano
|
2842c0f9
|
traverse_trees(): allow pruning with pathspec
|
Junio C Hamano
|
4264dc15
|
git reflog expire
|
Junio C Hamano
|
ae7c0c92
|
Git-prune-script loses blobs referenced from an uncommitted cache.
|
Junio C Hamano
|
3813a89f
|
Merge branch 'nd/i18n'
|
Junio C Hamano
|
be042aff
|
Teach progress eye-candy to fetch_refs_from_bundle()
|
Junio C Hamano
|
bad68ec9
|
index: make the index file format extensible.
|
Linus Torvalds
|
85003492
|
Make fsck-cache do better tree checking.
|
Linus Torvalds
|
18af29f2
|
fsck-objects: refactor checking for connectivity
|
Nguyễn Thái Ngọc Duy
|
ec36c42a
|
Indent code with TABs
|
Nguyễn Thái Ngọc Duy
|
8aa8c140
|
git.c: mark more strings for translation
|
Nguyễn Thái Ngọc Duy
|
391408e5
|
read-cache.c: turn die("internal error") to BUG()
|
Nguyễn Thái Ngọc Duy
|
ad8f8f4a
|
attr.c: mark more string for translation
|
Nguyễn Thái Ngọc Duy
|
74ae4b63
|
bundle.c: remove the_repository references
|
Nguyễn Thái Ngọc Duy
|
1a07e59c
|
Update messages in preparation for i18n
|
Nguyễn Thái Ngọc Duy
|
674ba340
|
fsck: mark strings for translation
|
Nguyễn Thái Ngọc Duy
|
9440b831
|
parse-options: replace opterror() with optname()
|
Nguyễn Thái Ngọc Duy
|
9d0a9e90
|
read-cache.c: mark more strings for translation
|
Nguyễn Thái Ngọc Duy
|
c83d950e
|
repack: mark more strings for translation
|
Nguyễn Thái Ngọc Duy
|
3b335762
|
style: the opening '{' of a function is in a separate line
|
Nguyễn Thái Ngọc Duy
|
22af33be
|
dir.c: move, rename and export match_attrs()
|
Nguyễn Thái Ngọc Duy
|
00a6d4d1
|
worktree: allow to (re)move worktrees with uninitialized submodules
|
Nguyễn Thái Ngọc Duy
|
0f086e6d
|
checkout: print something when checking out paths
|
Olga Telezhnaya
|
33311fa1
|
ref-filter: add deltabase option
|
Olga Telezhnaya
|
1867ce6c
|
ref-filter: add objectsize:disk option
|
Phillip Wood
|
66618a50
|
sequencer: run 'prepare-commit-msg' hook
|
Phillip Wood
|
e47c6caf
|
commit: move print_commit_summary() to libgit
|
Phillip Wood
|
bc9238bb
|
rebase -i: fix SIGSEGV when 'merge ' fails
|
Pieter de Bie
|
df6a7ff7
|
builtin-fast-export: Add importing and exporting of revision marks
|
Stefan Beller
|
a1bbc6c0
|
repack: rewrite the shell script in C
|
Stefan Beller
|
da14a7ff
|
blob: add repository argument to lookup_blob
|
Stefan Beller
|
6e3c1595
|
update submodules: add submodule_move_head
|
Stephan Beyer
|
1e41229d
|
sequencer: make sequencer abort safer
|