object.h: update flag allocation comment
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>
Tue, 6 Mar 2018 10:16:14 +0000 (17:16 +0700)
committerJunio C Hamano <gitster@pobox.com>
Tue, 6 Mar 2018 19:41:21 +0000 (11:41 -0800)
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>
builtin/index-pack.c
builtin/pack-objects.c
builtin/reflog.c
builtin/unpack-objects.c
object.h
index 4c51aec81f374d52e7c6a1afa73ab9dea3cf40b8..c7f0184c1b1bfaba9de6e57f4069bf76582b8530 100644 (file)
@@ -49,6 +49,7 @@ struct thread_local {
        int pack_fd;
 };
 
+/* Remember to update object flag allocation in object.h */
 #define FLAG_LINK (1u<<20)
 #define FLAG_CHECKED (1u<<21)
 
index 6b9cfc289d87b543b747c4024504703a2e0d6641..9c3e69e0634c6ebf8170ed17eb1f002a329ae5eb 100644 (file)
@@ -2546,6 +2546,7 @@ static void read_object_list_from_stdin(void)
        }
 }
 
+/* Remember to update object flag allocation in object.h */
 #define OBJECT_ADDED (1u<<20)
 
 static void show_commit(struct commit *commit, void *data)
index 2233725315ba32832ec5c866b7dbdf72103ac74d..95becf0e7e26d44173cf880c8c697e50c132578a 100644 (file)
@@ -52,6 +52,7 @@ struct collect_reflog_cb {
        int nr;
 };
 
+/* Remember to update object flag allocation in object.h */
 #define INCOMPLETE     (1u<<10)
 #define STUDYING       (1u<<11)
 #define REACHABLE      (1u<<12)
index 62ea264c46783374d0f1968c19ea7581498a1f87..b2ad6fba2f03334bef9b230b6f4c899e60615d7f 100644 (file)
@@ -158,6 +158,7 @@ struct obj_info {
        struct object *obj;
 };
 
+/* Remember to update object flag allocation in object.h */
 #define FLAG_OPEN (1u<<20)
 #define FLAG_WRITTEN (1u<<21)
 
index 87563d90562b51859da8313b105a3e7785ed9d26..15901d2901214584f05358fe7df2064ad2ea6120 100644 (file)
--- a/object.h
+++ b/object.h
@@ -29,7 +29,7 @@ struct object_array {
 /*
  * object flag allocation:
  * revision.h:      0---------10                                26
- * fetch-pack.c:    0---5
+ * fetch-pack.c:    0----5
  * walker.c:        0-2
  * upload-pack.c:       4       11----------------19
  * builtin/blame.c:               12-13
@@ -40,6 +40,10 @@ struct object_array {
  * sha1_name.c:                                     20
  * list-objects-filter.c:                             21
  * builtin/fsck.c:  0--3
+ * builtin/index-pack.c:                            2021
+ * builtin/pack-objects.c:                          20
+ * builtin/reflog.c:          10--12
+ * builtin/unpack-objects.c:                        2021
  */
 #define FLAG_BITS  27