* [PATCH 1/2] object.h: update flag allocation comment
@ 2018-03-06 10:16 Nguyễn Thái Ngọc Duy
2018-03-06 10:16 ` [PATCH 2/2] object.h: realign object " Nguyễn Thái Ngọc Duy
0 siblings, 1 reply; 2+ messages in thread
From: Nguyễn Thái Ngọc Duy @ 2018-03-06 10:16 UTC (permalink / raw)
To: git; +Cc: Junio C Hamano, Nguyễn Thái Ngọc Duy
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>
---
builtin/index-pack.c | 1 +
builtin/pack-objects.c | 1 +
builtin/reflog.c | 1 +
builtin/unpack-objects.c | 1 +
object.h | 6 +++++-
5 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/builtin/index-pack.c b/builtin/index-pack.c
index 7e3e1a461c..b4239a633c 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 5c674b2843..833126e671 100644
--- a/builtin/pack-objects.c
+++ b/builtin/pack-objects.c
@@ -2549,6 +2549,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 2233725315..95becf0e7e 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 7235d2ffbf..fba9498ffe 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 87563d9056..15901d2901 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
--
2.16.2.784.gb291bd247e
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH 2/2] object.h: realign object flag allocation comment
2018-03-06 10:16 [PATCH 1/2] object.h: update flag allocation comment Nguyễn Thái Ngọc Duy
@ 2018-03-06 10:16 ` Nguyễn Thái Ngọc Duy
0 siblings, 0 replies; 2+ messages in thread
From: Nguyễn Thái Ngọc Duy @ 2018-03-06 10:16 UTC (permalink / raw)
To: git; +Cc: Junio C Hamano, Nguyễn Thái Ngọc Duy
Some new path names are too long and eat into the graph part. Move the
graph 9 columns to the right to avoid this.
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
object.h | 32 ++++++++++++++++----------------
1 file changed, 16 insertions(+), 16 deletions(-)
diff --git a/object.h b/object.h
index 15901d2901..6f56a86937 100644
--- a/object.h
+++ b/object.h
@@ -28,22 +28,22 @@ struct object_array {
#define TYPE_BITS 3
/*
* object flag allocation:
- * revision.h: 0---------10 26
- * fetch-pack.c: 0----5
- * walker.c: 0-2
- * upload-pack.c: 4 11----------------19
- * builtin/blame.c: 12-13
- * bisect.c: 16
- * bundle.c: 16
- * http-push.c: 16-----19
- * commit.c: 16-----19
- * 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
+ * revision.h: 0---------10 26
+ * fetch-pack.c: 0----5
+ * walker.c: 0-2
+ * upload-pack.c: 4 11----------------19
+ * builtin/blame.c: 12-13
+ * bisect.c: 16
+ * bundle.c: 16
+ * http-push.c: 16-----19
+ * commit.c: 16-----19
+ * 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
--
2.16.2.784.gb291bd247e
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-03-06 10:16 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-06 10:16 [PATCH 1/2] object.h: update flag allocation comment Nguyễn Thái Ngọc Duy
2018-03-06 10:16 ` [PATCH 2/2] object.h: realign object " Nguyễn Thái Ngọc Duy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).