Skip to content

Commit 95308d6

Browse files
pcloudsgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 38e79b1 commit 95308d6

File tree

5 files changed

+9
-1
lines changed

5 files changed

+9
-1
lines changed

builtin/index-pack.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ struct thread_local {
4949
int pack_fd;
5050
};
5151

52+
/* Remember to update object flag allocation in object.h */
5253
#define FLAG_LINK (1u<<20)
5354
#define FLAG_CHECKED (1u<<21)
5455

builtin/pack-objects.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2546,6 +2546,7 @@ static void read_object_list_from_stdin(void)
25462546
}
25472547
}
25482548

2549+
/* Remember to update object flag allocation in object.h */
25492550
#define OBJECT_ADDED (1u<<20)
25502551

25512552
static void show_commit(struct commit *commit, void *data)

builtin/reflog.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ struct collect_reflog_cb {
5252
int nr;
5353
};
5454

55+
/* Remember to update object flag allocation in object.h */
5556
#define INCOMPLETE (1u<<10)
5657
#define STUDYING (1u<<11)
5758
#define REACHABLE (1u<<12)

builtin/unpack-objects.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ struct obj_info {
158158
struct object *obj;
159159
};
160160

161+
/* Remember to update object flag allocation in object.h */
161162
#define FLAG_OPEN (1u<<20)
162163
#define FLAG_WRITTEN (1u<<21)
163164

object.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ struct object_array {
2929
/*
3030
* object flag allocation:
3131
* revision.h: 0---------10 26
32-
* fetch-pack.c: 0---5
32+
* fetch-pack.c: 0----5
3333
* walker.c: 0-2
3434
* upload-pack.c: 4 11----------------19
3535
* builtin/blame.c: 12-13
@@ -40,6 +40,10 @@ struct object_array {
4040
* sha1_name.c: 20
4141
* list-objects-filter.c: 21
4242
* 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
4347
*/
4448
#define FLAG_BITS 27
4549

0 commit comments

Comments
 (0)