{"thread":{"id":"49181","subject":"[PATCH] commit: use timestamp_t for author_date_slab","startedAt":"2018-08-21T20:54:16Z","lastAt":"2018-08-21T21:05:24Z","messageCount":2,"participants":["Derrick Stolee","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"356215","messageId":"20180821205359.29569-1-dstolee@microsoft.com","threadId":"49181","inReplyTo":null,"subject":"[PATCH] commit: use timestamp_t for author_date_slab","fromName":"Derrick Stolee","fromEmail":"dstolee@microsoft.com","sentAt":"2018-08-21T20:54:12Z","receivedAt":"2018-08-21T20:54:16Z","isPatch":true,"sender":{"key":"stolee@gmail.com","avatar":"https://avatars.githubusercontent.com/u/570044?v=4"},"body":"The author_date_slab is used to store the author date of a commit\nwhen walking with the --author-date flag in rev-list or log. This\nwas added as an 'unsigned long' in\n\n\t81c6b38b \"log: --author-date-order\"\n\nSince 'unsigned long' is ambiguous in its bit-ness across platforms\n(64-bit in Linux, 32-bit in Windows, for example), most references\nto the author dates in commit.c were converted to timestamp_t in\n\n\tdddbad72 \"timestamp_t: a new data type for timestamps\"\n\nHowever, the slab definition was missed, leading to a mismatch in\nthe data types in Windows. This would not reveal itself as a bug\nunless someone authors a commit after February 2106, but commits\ncan store anything as their author date.\n\nSigned-off-by: Derrick Stolee <dstolee@microsoft.com>\n---\n\nI found this while reading up on the revision-walk machinery. This code\nhasn't been touched in years, so could apply to 'maint'.\n\n commit.c | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/commit.c b/commit.c\nindex 0030e79940..2ce5052b3e 100644\n--- a/commit.c\n+++ b/commit.c\n@@ -609,7 +609,7 @@ struct commit *pop_commit(struct commit_list **stack)\n define_commit_slab(indegree_slab, int);\n \n /* record author-date for each commit object */\n-define_commit_slab(author_date_slab, unsigned long);\n+define_commit_slab(author_date_slab, timestamp_t);\n \n static void record_author_date(struct author_date_slab *author_date,\n \t\t\t       struct commit *commit)\n-- \n2.19.0.rc0\n\n"},{"id":"356217","messageId":"xmqqy3cz77n4.fsf@gitster-ct.c.googlers.com","threadId":"49181","inReplyTo":"20180821205359.29569-1-dstolee@microsoft.com","subject":"Re: [PATCH] commit: use timestamp_t for author_date_slab","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2018-08-21T21:05:19Z","receivedAt":"2018-08-21T21:05:24Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Derrick Stolee <dstolee@microsoft.com> writes:\n\n> The author_date_slab is used to store the author date of a commit\n> when walking with the --author-date flag in rev-list or log. This\n> was added as an 'unsigned long' in\n>\n> \t81c6b38b \"log: --author-date-order\"\n>\n> Since 'unsigned long' is ambiguous in its bit-ness across platforms\n> (64-bit in Linux, 32-bit in Windows, for example), most references\n> to the author dates in commit.c were converted to timestamp_t in\n>\n> \tdddbad72 \"timestamp_t: a new data type for timestamps\"\n>\n> However, the slab definition was missed,\n\nMakes sense, and obviously correct.\n\n> I found this while reading up on the revision-walk machinery. This code\n> hasn't been touched in years, so could apply to 'maint'.\n\nThanks.\n"}]}