From 95308d64ce43502507091ae5bbbdc41a918149ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20Th=C3=A1i=20Ng=E1=BB=8Dc=20Duy?= Date: Tue, 6 Mar 2018 17:16:14 +0700 Subject: object.h: update flag allocation comment MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Junio C Hamano diff --git a/builtin/index-pack.c b/builtin/index-pack.c index 4c51aec..c7f0184 100644 --- a/builtin/index-pack.c +++ b/builtin/index-pack.c @@ -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) diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c index 6b9cfc2..9c3e69e 100644 --- a/builtin/pack-objects.c +++ b/builtin/pack-objects.c @@ -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) diff --git a/builtin/reflog.c b/builtin/reflog.c index 2233725..95becf0 100644 --- a/builtin/reflog.c +++ b/builtin/reflog.c @@ -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) diff --git a/builtin/unpack-objects.c b/builtin/unpack-objects.c index 62ea264..b2ad6fb 100644 --- a/builtin/unpack-objects.c +++ b/builtin/unpack-objects.c @@ -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) diff --git a/object.h b/object.h index 87563d9..15901d2 100644 --- 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 -- cgit v0.10.2-6-g49f6