object.h: update flag allocation comment

Since the "flags" is shared, it's a good idea to keep track of who uses what bit. When we need to use more flags in library code, we can be sure it won't be re-used for another purpose by some caller. While at there, fix the location of "5" (should be in a different column than "4" two lines down) Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Nguyễn Thái Ngọc Duy committed Mar 6, 2018 at 17:16 UTC 95308d64ce43502507091ae5bbbdc41a918149ce
5 files changed +9 -1
builtin/index-pack.c
+1
@@ -49,6 +49,7 @@ struct thread_local {
49 int pack_fd;
50 };
51
52 +/* Remember to update object flag allocation in object.h */
53 #define FLAG_LINK (1u<<20)
54 #define FLAG_CHECKED (1u<<21)
55
builtin/pack-objects.c
+1
@@ -2546,6 +2546,7 @@ static void read_object_list_from_stdin(void)
2546 }
2547 }
2548
2549 +/* Remember to update object flag allocation in object.h */
2550 #define OBJECT_ADDED (1u<<20)
2551
2552 static void show_commit(struct commit *commit, void *data)
builtin/reflog.c
+1
@@ -52,6 +52,7 @@ struct collect_reflog_cb {
52 int nr;
53 };
54
55 +/* Remember to update object flag allocation in object.h */
56 #define INCOMPLETE (1u<<10)
57 #define STUDYING (1u<<11)
58 #define REACHABLE (1u<<12)
builtin/unpack-objects.c
+1
@@ -158,6 +158,7 @@ struct obj_info {
158 struct object *obj;
159 };
160
161 +/* Remember to update object flag allocation in object.h */
162 #define FLAG_OPEN (1u<<20)
163 #define FLAG_WRITTEN (1u<<21)
164
object.h
+5 -1
@@ -29,7 +29,7 @@ struct object_array {
29 /*
30 * object flag allocation:
31 * revision.h: 0---------10 26
32 - * fetch-pack.c: 0---5
32 + * fetch-pack.c: 0----5
33 * walker.c: 0-2
34 * upload-pack.c: 4 11----------------19
35 * builtin/blame.c: 12-13
@@ -40,6 +40,10 @@ struct object_array {
40 * sha1_name.c: 20
41 * list-objects-filter.c: 21
42 * builtin/fsck.c: 0--3
43 + * builtin/index-pack.c: 2021
44 + * builtin/pack-objects.c: 20
45 + * builtin/reflog.c: 10--12
46 + * builtin/unpack-objects.c: 2021
47 */
48 #define FLAG_BITS 27
49