Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
sequencer.c: use commit-slab to mark seen commits
author
Nguyễn Thái Ngọc Duy
<pclouds@gmail.com>
Sat, 19 May 2018 05:28:22 +0000
(07:28 +0200)
committer
Junio C Hamano
<gitster@pobox.com>
Mon, 21 May 2018 05:07:20 +0000
(14:07 +0900)
It's done so that commit->util can be removed. See more explanation in
the commit that removes commit->util.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
sequencer.c
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
58dbe58
)
diff --git
a/sequencer.c
b/sequencer.c
index 4ce5120e777085227dd0f677dfed70a003cffe96..3af296db3b197b5591efa0f859b2e00e99b8a5dc 100644
(file)
--- a/
sequencer.c
+++ b/
sequencer.c
@@
-23,6
+23,7
@@
#include "hashmap.h"
#include "notes-utils.h"
#include "sigchain.h"
#include "hashmap.h"
#include "notes-utils.h"
#include "sigchain.h"
+#include "commit-slab.h"
#define GIT_REFLOG_ACTION "GIT_REFLOG_ACTION"
#define GIT_REFLOG_ACTION "GIT_REFLOG_ACTION"
@@
-3160,6
+3161,7
@@
static enum check_level get_missing_commit_check_level(void)
return CHECK_IGNORE;
}
return CHECK_IGNORE;
}
+define_commit_slab(commit_seen, unsigned char);
/*
* Check if the user dropped some commits by mistake
* Behaviour determined by rebase.missingCommitsCheck.
/*
* Check if the user dropped some commits by mistake
* Behaviour determined by rebase.missingCommitsCheck.
@@
-3173,6
+3175,9
@@
int check_todo_list(void)
struct todo_list todo_list = TODO_LIST_INIT;
struct strbuf missing = STRBUF_INIT;
int advise_to_edit_todo = 0, res = 0, i;
struct todo_list todo_list = TODO_LIST_INIT;
struct strbuf missing = STRBUF_INIT;
int advise_to_edit_todo = 0, res = 0, i;
+ struct commit_seen commit_seen;
+
+ init_commit_seen(&commit_seen);
strbuf_addstr(&todo_file, rebase_path_todo());
if (strbuf_read_file_or_whine(&todo_list.buf, todo_file.buf) < 0) {
strbuf_addstr(&todo_file, rebase_path_todo());
if (strbuf_read_file_or_whine(&todo_list.buf, todo_file.buf) < 0) {
@@
-3189,7
+3194,7
@@
int check_todo_list(void)
for (i = 0; i < todo_list.nr; i++) {
struct commit *commit = todo_list.items[i].commit;
if (commit)
for (i = 0; i < todo_list.nr; i++) {
struct commit *commit = todo_list.items[i].commit;
if (commit)
-
commit->util = (void *)
1;
+
*commit_seen_at(&commit_seen, commit) =
1;
}
todo_list_release(&todo_list);
}
todo_list_release(&todo_list);
@@
-3205,11
+3210,11
@@
int check_todo_list(void)
for (i = todo_list.nr - 1; i >= 0; i--) {
struct todo_item *item = todo_list.items + i;
struct commit *commit = item->commit;
for (i = todo_list.nr - 1; i >= 0; i--) {
struct todo_item *item = todo_list.items + i;
struct commit *commit = item->commit;
- if (commit && !
commit->util
) {
+ if (commit && !
*commit_seen_at(&commit_seen, commit)
) {
strbuf_addf(&missing, " - %s %.*s\n",
short_commit_name(commit),
item->arg_len, item->arg);
strbuf_addf(&missing, " - %s %.*s\n",
short_commit_name(commit),
item->arg_len, item->arg);
-
commit->util = (void *)
1;
+
*commit_seen_at(&commit_seen, commit) =
1;
}
}
}
}
@@
-3235,6
+3240,7
@@
int check_todo_list(void)
"The possible behaviours are: ignore, warn, error.\n\n"));
leave_check:
"The possible behaviours are: ignore, warn, error.\n\n"));
leave_check:
+ clear_commit_seen(&commit_seen);
strbuf_release(&todo_file);
todo_list_release(&todo_list);
strbuf_release(&todo_file);
todo_list_release(&todo_list);