{"thread":{"id":"47987","subject":"[PATCH 1/2] object.h: update flag allocation comment","startedAt":"2018-03-06T10:16:28Z","lastAt":"2018-03-06T10:16:32Z","messageCount":2,"participants":["Nguyễn Thái Ngọc Duy"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"341109","messageId":"20180306101615.5173-1-pclouds@gmail.com","threadId":"47987","inReplyTo":null,"subject":"[PATCH 1/2] object.h: update flag allocation comment","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-03-06T10:16:14Z","receivedAt":"2018-03-06T10:16:28Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Since the \"flags\" is shared, it's a good idea to keep track of who\nuses what bit. When we need to use more flags in library code, we can\nbe sure it won't be re-used for another purpose by some caller.\n\nWhile at there, fix the location of \"5\" (should be in a different\ncolumn than \"4\" two lines down)\n\nSigned-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n builtin/index-pack.c     | 1 +\n builtin/pack-objects.c   | 1 +\n builtin/reflog.c         | 1 +\n builtin/unpack-objects.c | 1 +\n object.h                 | 6 +++++-\n 5 files changed, 9 insertions(+), 1 deletion(-)\n\ndiff --git a/builtin/index-pack.c b/builtin/index-pack.c\nindex 7e3e1a461c..b4239a633c 100644\n--- a/builtin/index-pack.c\n+++ b/builtin/index-pack.c\n@@ -49,6 +49,7 @@ struct thread_local {\n \tint pack_fd;\n };\n \n+/* Remember to update object flag allocation in object.h */\n #define FLAG_LINK (1u<<20)\n #define FLAG_CHECKED (1u<<21)\n \ndiff --git a/builtin/pack-objects.c b/builtin/pack-objects.c\nindex 5c674b2843..833126e671 100644\n--- a/builtin/pack-objects.c\n+++ b/builtin/pack-objects.c\n@@ -2549,6 +2549,7 @@ static void read_object_list_from_stdin(void)\n \t}\n }\n \n+/* Remember to update object flag allocation in object.h */\n #define OBJECT_ADDED (1u<<20)\n \n static void show_commit(struct commit *commit, void *data)\ndiff --git a/builtin/reflog.c b/builtin/reflog.c\nindex 2233725315..95becf0e7e 100644\n--- a/builtin/reflog.c\n+++ b/builtin/reflog.c\n@@ -52,6 +52,7 @@ struct collect_reflog_cb {\n \tint nr;\n };\n \n+/* Remember to update object flag allocation in object.h */\n #define INCOMPLETE\t(1u<<10)\n #define STUDYING\t(1u<<11)\n #define REACHABLE\t(1u<<12)\ndiff --git a/builtin/unpack-objects.c b/builtin/unpack-objects.c\nindex 7235d2ffbf..fba9498ffe 100644\n--- a/builtin/unpack-objects.c\n+++ b/builtin/unpack-objects.c\n@@ -158,6 +158,7 @@ struct obj_info {\n \tstruct object *obj;\n };\n \n+/* Remember to update object flag allocation in object.h */\n #define FLAG_OPEN (1u<<20)\n #define FLAG_WRITTEN (1u<<21)\n \ndiff --git a/object.h b/object.h\nindex 87563d9056..15901d2901 100644\n--- a/object.h\n+++ b/object.h\n@@ -29,7 +29,7 @@ struct object_array {\n /*\n  * object flag allocation:\n  * revision.h:      0---------10                                26\n- * fetch-pack.c:    0---5\n+ * fetch-pack.c:    0----5\n  * walker.c:        0-2\n  * upload-pack.c:       4       11----------------19\n  * builtin/blame.c:               12-13\n@@ -40,6 +40,10 @@ struct object_array {\n  * sha1_name.c:                                     20\n  * list-objects-filter.c:                             21\n  * builtin/fsck.c:  0--3\n+ * builtin/index-pack.c:                            2021\n+ * builtin/pack-objects.c:                          20\n+ * builtin/reflog.c:          10--12\n+ * builtin/unpack-objects.c:                        2021\n  */\n #define FLAG_BITS  27\n \n-- \n2.16.2.784.gb291bd247e\n\n"},{"id":"341110","messageId":"20180306101615.5173-2-pclouds@gmail.com","threadId":"47987","inReplyTo":"20180306101615.5173-1-pclouds@gmail.com","subject":"[PATCH 2/2] object.h: realign object flag allocation comment","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-03-06T10:16:15Z","receivedAt":"2018-03-06T10:16:32Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Some new path names are too long and eat into the graph part. Move the\ngraph 9 columns to the right to avoid this.\n\nSigned-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n object.h | 32 ++++++++++++++++----------------\n 1 file changed, 16 insertions(+), 16 deletions(-)\n\ndiff --git a/object.h b/object.h\nindex 15901d2901..6f56a86937 100644\n--- a/object.h\n+++ b/object.h\n@@ -28,22 +28,22 @@ struct object_array {\n #define TYPE_BITS   3\n /*\n  * object flag allocation:\n- * revision.h:      0---------10                                26\n- * fetch-pack.c:    0----5\n- * walker.c:        0-2\n- * upload-pack.c:       4       11----------------19\n- * builtin/blame.c:               12-13\n- * bisect.c:                               16\n- * bundle.c:                               16\n- * http-push.c:                            16-----19\n- * commit.c:                               16-----19\n- * sha1_name.c:                                     20\n- * list-objects-filter.c:                             21\n- * builtin/fsck.c:  0--3\n- * builtin/index-pack.c:                            2021\n- * builtin/pack-objects.c:                          20\n- * builtin/reflog.c:          10--12\n- * builtin/unpack-objects.c:                        2021\n+ * revision.h:               0---------10                                26\n+ * fetch-pack.c:             0----5\n+ * walker.c:                 0-2\n+ * upload-pack.c:                4       11----------------19\n+ * builtin/blame.c:                        12-13\n+ * bisect.c:                                        16\n+ * bundle.c:                                        16\n+ * http-push.c:                                     16-----19\n+ * commit.c:                                        16-----19\n+ * sha1_name.c:                                              20\n+ * list-objects-filter.c:                                      21\n+ * builtin/fsck.c:           0--3\n+ * builtin/index-pack.c:                                     2021\n+ * builtin/pack-objects.c:                                   20\n+ * builtin/reflog.c:                   10--12\n+ * builtin/unpack-objects.c:                                 2021\n  */\n #define FLAG_BITS  27\n \n-- \n2.16.2.784.gb291bd247e\n\n"}]}