Skip to contentSkip to conversation

doc: remove unneeded TODO for release_commit_memory

PATCH Superseded Albert Burt 3 participants 5 messages Dec 31, 2018 – Jan 3, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 doc: remove unneeded TODO for release_commit_memory

The code that was merged with commit 1102405 left in an TODO that is no longer relevant. It seems as if we can remove this todo. util seems to not be a field of the struct commit, definition of struct commit --> commit.c:27
The commit list also, does not contain a field for util.

____
By making a contribution to this project, I certify that:

a. The contribution was created in whole or in part by me and I
have the right to submit it under the open source license indicated in the file; or

b. The contribution is based upon previous work that, to the best
of my knowledge, is covered under an appropriate open source license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the same open source license (unless I am permitted to submit under a different license), as indicated in the file; or

c. The contribution was provided directly to me by some other
person who certified (a), (b) or (c) and I have not modified it.

d. I understand and agree that this project and the contribution
are public and that a record of the contribution (including all personal information I submit with it, including my sign-off) is maintained indefinitely and may be redistributed consistent with this project or the open source license(s) involved.
____

---
 commit.c | 2 --
 1 file changed, 2 deletions(-)
commit.c +0 -2
index 2d94e0b199..2ff6dca0bc 100644
@@ -357,8 +357,6 @@ void release_commit_memory(struct commit *c)
 	c->index = 0;
 	free_commit_buffer(c);
 	free_commit_list(c->parents);
-	/* TODO: what about commit->util? */
-
 	c->object.parsed = 0;
 }
 
Signature · 1 line
2.17.2 (Apple Git-113)
#1 lore raw
Quoted 2 lines · Albert Burt

The code that was merged with commit 1102405 left in an TODO that

People usually use something this to produce the commit reference

    git show -s --date=short --pretty='format:%h (%s - %ad)'

which produces

110240588d (Merge branch 'sb/object-store-alloc' - 2018-06-25)

Quoted 4 lines

is no longer relevant. It seems as if we can remove this todo. util seems to not be a field of the struct commit, definition of struct commit --> commit.c:27
The commit list also, does not contain a field for util.

There was commit->util, which was deleted in 9d2c97016f (commit.h:
delete 'util' field in struct commit - 2018-05-19). You can mention it too if you reroll this patch.

Quoted 19 lines

____
By making a contribution to this project, I certify that:

a. The contribution was created in whole or in part by me and I
have the right to submit it under the open source license indicated in the file; or

b. The contribution is based upon previous work that, to the best
of my knowledge, is covered under an appropriate open source license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the same open source license (unless I am permitted to submit under a different license), as indicated in the file; or

c. The contribution was provided directly to me by some other
person who certified (a), (b) or (c) and I have not modified it.

Quoted 6 lines

d. I understand and agree that this project and the contribution
are public and that a record of the contribution (including all personal information I submit with it, including my sign-off) is maintained indefinitely and may be redistributed consistent with this project or the open source license(s) involved.
____

I think you can drop this. Your S-o-b below implies all this.

Quoted 10 lines
---
 commit.c | 2 --
 1 file changed, 2 deletions(-)
commit.c +0 -0
index 2d94e0b199..2ff6dca0bc 100644

commit.c void release_commit_memory(struct commit *c) · line 361

Quoted 5 lines
commit.c +0 -2
@@ -357,8 +357,6 @@ void release_commit_memory(struct commit *c)
        c->index = 0;
        free_commit_buffer(c);
        free_commit_list(c->parents);
-       /* TODO: what about commit->util? */
-

Obviously correct :)

Quoted 6 lines
commit.c +0 -1
        c->object.parsed = 0;
 }
 
--

2.17.2 (Apple Git-113)

Signature · 1 line
Duy
#2 lore raw

PATCH v2 1/1 doc: remove unneeded TODO for release_commit_memory

Remove TODO that was left in from:
commit 110240588d (Merge branch 'sb/object-store-alloc' - 2018-06-25)

Todo can be removed as:
9d2c97016f (commit.h: delete 'util' field in struct commit - 2018-05-19) deletes commit->util.

---

Thanks for looking at this for me Duy. I updated some of the changes you suggested.

Let me know if there's anything else that I would need to clean up, or do better. :)

 commit.c | 2 --
 1 file changed, 2 deletions(-)
commit.c +0 -2
index 2d94e0b199..2ff6dca0bc 100644
@@ -357,8 +357,6 @@ void release_commit_memory(struct commit *c)
 	c->index = 0;
 	free_commit_buffer(c);
 	free_commit_list(c->parents);
-	/* TODO: what about commit->util? */
-
 	c->object.parsed = 0;
 }
 
Signature · 1 line
2.17.2 (Apple Git-113)
#3 lore raw
Quoted 8 lines · Albert Burt

Remove TODO that was left in from:
commit 110240588d (Merge branch 'sb/object-store-alloc' - 2018-06-25)

Todo can be removed as:
9d2c97016f (commit.h: delete 'util' field in struct commit - 2018-05-19) deletes commit->util.

Quoted 8 lines

---

Thanks for looking at this for me Duy. I updated some of the changes you suggested.

Let me know if there's anything else that I would need to clean up, or do better. :)

Nope. The patch looks good to me.

Quoted 20 lines
 commit.c | 2 --
 1 file changed, 2 deletions(-)
commit.c +0 -3
index 2d94e0b199..2ff6dca0bc 100644
@@ -357,8 +357,6 @@ void release_commit_memory(struct commit *c)
        c->index = 0;
        free_commit_buffer(c);
        free_commit_list(c->parents);
-       /* TODO: what about commit->util? */
-
        c->object.parsed = 0;
 }
 
--

2.17.2 (Apple Git-113)

Signature · 1 line
Duy
#4 lore raw
Quoted 12 lines · Duy Nguyen
Quoted 11 lines · Albert Burt

Remove TODO that was left in from:
commit 110240588d (Merge branch 'sb/object-store-alloc' - 2018-06-25)

Todo can be removed as:
9d2c97016f (commit.h: delete 'util' field in struct commit - 2018-05-19) deletes commit->util.

---

Quoted 7 lines
Quoted 5 lines

Thanks for looking at this for me Duy. I updated some of the changes you suggested.

Let me know if there's anything else that I would need to clean up, or do better. :)

Nope. The patch looks good to me.

Yes, but we'll fix this with 6a7895fd ("commit: prepare free_commit_buffer and release_commit_memory for any repo", 2018-12-14) anyway, so I am not sure if this is worth pursuing separately.

Quoted 21 lines
Quoted 21 lines

 commit.c | 2 --
 1 file changed, 2 deletions(-)
commit.c +0 -3
index 2d94e0b199..2ff6dca0bc 100644
@@ -357,8 +357,6 @@ void release_commit_memory(struct commit *c)
        c->index = 0;
        free_commit_buffer(c);
        free_commit_list(c->parents);
-       /* TODO: what about commit->util? */
-
        c->object.parsed = 0;
 }
 
--

2.17.2 (Apple Git-113)