{"thread":{"id":"38563","subject":"[PATCH] Remove duplicate #include","startedAt":"2015-02-13T14:47:39Z","lastAt":"2015-02-13T21:57:27Z","messageCount":3,"participants":["Дилян Палаузов","Junio C Hamano","Dilyan Palauzov"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"256061","messageId":"1423838859-15413-1-git-send-email-git-dpa@aegee.org","threadId":"38563","inReplyTo":null,"subject":"[PATCH] Remove duplicate #include","fromName":"Дилян Палаузов","fromEmail":"git-dpa@aegee.org","sentAt":"2015-02-13T14:47:39Z","receivedAt":"2015-02-13T14:47:39Z","isPatch":true,"sender":{"key":"git-dpa@aegee.org","avatar":"https://avatars.githubusercontent.com/u/4992947?v=4"},"body":"deheader (git://gitorious.org/deheader/deheader.git) found out that\nsome .c files #include twice one and the same header file.\n\nThis patch removes such occurrences and hence speeds up the compilation.\n\nSigned-off-by: Дилян Палаузов <git-dpa@aegee.org>\n---\n builtin/fetch.c    | 1 -\n trailer.c          | 1 -\n transport-helper.c | 1 -\n userdiff.c         | 1 -\n 4 files changed, 4 deletions(-)\n\ndiff --git a/builtin/fetch.c b/builtin/fetch.c\nindex 7b84d35..75a55e5 100644\n--- a/builtin/fetch.c\n+++ b/builtin/fetch.c\n@@ -11,7 +11,6 @@\n #include \"run-command.h\"\n #include \"parse-options.h\"\n #include \"sigchain.h\"\n-#include \"transport.h\"\n #include \"submodule.h\"\n #include \"connected.h\"\n #include \"argv-array.h\"\ndiff --git a/trailer.c b/trailer.c\nindex 623adeb..05b3859 100644\n--- a/trailer.c\n+++ b/trailer.c\n@@ -1,7 +1,6 @@\n #include \"cache.h\"\n #include \"string-list.h\"\n #include \"run-command.h\"\n-#include \"string-list.h\"\n #include \"commit.h\"\n #include \"trailer.h\"\n /*\ndiff --git a/transport-helper.c b/transport-helper.c\nindex 0224687..3652b16 100644\n--- a/transport-helper.c\n+++ b/transport-helper.c\n@@ -5,7 +5,6 @@\n #include \"commit.h\"\n #include \"diff.h\"\n #include \"revision.h\"\n-#include \"quote.h\"\n #include \"remote.h\"\n #include \"string-list.h\"\n #include \"thread-utils.h\"\ndiff --git a/userdiff.c b/userdiff.c\nindex fad52d6..2ccbee5 100644\n--- a/userdiff.c\n+++ b/userdiff.c\n@@ -1,6 +1,5 @@\n #include \"cache.h\"\n #include \"userdiff.h\"\n-#include \"cache.h\"\n #include \"attr.h\"\n \n static struct userdiff_driver *drivers;\n-- \n2.3.0.1.g24c2b87\n"},{"id":"256086","messageId":"xmqqegptms1r.fsf@gitster.dls.corp.google.com","threadId":"38563","inReplyTo":"1423838859-15413-1-git-send-email-git-dpa@aegee.org","subject":"Re: [PATCH] Remove duplicate #include","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-02-13T21:15:44Z","receivedAt":"2015-02-13T21:15:44Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Дилян Палаузов  <git-dpa@aegee.org> writes:\n\n> deheader (git://gitorious.org/deheader/deheader.git) found out that\n> some .c files #include twice one and the same header file.\n>\n> This patch removes such occurrences and hence speeds up the compilation.\n\nDoes it speed up?  By how much?  Any numbers?\n\nI do not see any reason to reject this change.  Removing repeated\ninclusions of the same header is a good thing by itself [*1*].\n\nThanks.\n\n[Footnote]\n\n*1* If things break when repeated inclusions are removed, that would\nmean the headers were wrong in the first place.  I do not think\ntransport.h, string-list.h, quote.h and cache.h have any reason why\nthey need to be included twice to work correctly, and in fact they\nare designed to be no-op when included twice.\n\n> Signed-off-by: Дилян Палаузов <git-dpa@aegee.org>\n> ---\n>  builtin/fetch.c    | 1 -\n>  trailer.c          | 1 -\n>  transport-helper.c | 1 -\n>  userdiff.c         | 1 -\n>  4 files changed, 4 deletions(-)\n>\n> diff --git a/builtin/fetch.c b/builtin/fetch.c\n> index 7b84d35..75a55e5 100644\n> --- a/builtin/fetch.c\n> +++ b/builtin/fetch.c\n> @@ -11,7 +11,6 @@\n>  #include \"run-command.h\"\n>  #include \"parse-options.h\"\n>  #include \"sigchain.h\"\n> -#include \"transport.h\"\n>  #include \"submodule.h\"\n>  #include \"connected.h\"\n>  #include \"argv-array.h\"\n> diff --git a/trailer.c b/trailer.c\n> index 623adeb..05b3859 100644\n> --- a/trailer.c\n> +++ b/trailer.c\n> @@ -1,7 +1,6 @@\n>  #include \"cache.h\"\n>  #include \"string-list.h\"\n>  #include \"run-command.h\"\n> -#include \"string-list.h\"\n>  #include \"commit.h\"\n>  #include \"trailer.h\"\n>  /*\n> diff --git a/transport-helper.c b/transport-helper.c\n> index 0224687..3652b16 100644\n> --- a/transport-helper.c\n> +++ b/transport-helper.c\n> @@ -5,7 +5,6 @@\n>  #include \"commit.h\"\n>  #include \"diff.h\"\n>  #include \"revision.h\"\n> -#include \"quote.h\"\n>  #include \"remote.h\"\n>  #include \"string-list.h\"\n>  #include \"thread-utils.h\"\n> diff --git a/userdiff.c b/userdiff.c\n> index fad52d6..2ccbee5 100644\n> --- a/userdiff.c\n> +++ b/userdiff.c\n> @@ -1,6 +1,5 @@\n>  #include \"cache.h\"\n>  #include \"userdiff.h\"\n> -#include \"cache.h\"\n>  #include \"attr.h\"\n>  \n>  static struct userdiff_driver *drivers;\n"},{"id":"256092","messageId":"54DE7347.3000107@aegee.org","threadId":"38563","inReplyTo":"xmqqegptms1r.fsf@gitster.dls.corp.google.com","subject":"Re: [PATCH] Remove duplicate #include","fromName":"Dilyan Palauzov","fromEmail":"dilyan.palauzov@aegee.org","sentAt":"2015-02-13T21:57:27Z","receivedAt":"2015-02-13T21:57:27Z","isPatch":true,"sender":{"key":"dilyan.palauzov@aegee.org","avatar":null},"body":"Hello Junio,\n\nin theory it speeds up, because the preprocessor has less work to do.\nIn practice I don't know how much and this seems also irrelevant\ncriterion for accepting this patch.\n\nGreetings\n  Dilyan\n\nOn 13.02.2015 22:15, Junio C Hamano wrote:\n> Дилян Палаузов  <git-dpa@aegee.org> writes:\n> \n>> deheader (git://gitorious.org/deheader/deheader.git) found out that\n>> some .c files #include twice one and the same header file.\n>>\n>> This patch removes such occurrences and hence speeds up the compilation.\n> \n> Does it speed up?  By how much?  Any numbers?\n> \n> I do not see any reason to reject this change.  Removing repeated\n> inclusions of the same header is a good thing by itself [*1*].\n> \n> Thanks.\n> \n> [Footnote]\n> \n> *1* If things break when repeated inclusions are removed, that would\n> mean the headers were wrong in the first place.  I do not think\n> transport.h, string-list.h, quote.h and cache.h have any reason why\n> they need to be included twice to work correctly, and in fact they\n> are designed to be no-op when included twice.\n> \n>> Signed-off-by: Дилян Палаузов <git-dpa@aegee.org>\n>> ---\n>>   builtin/fetch.c    | 1 -\n>>   trailer.c          | 1 -\n>>   transport-helper.c | 1 -\n>>   userdiff.c         | 1 -\n>>   4 files changed, 4 deletions(-)\n>>\n>> diff --git a/builtin/fetch.c b/builtin/fetch.c\n>> index 7b84d35..75a55e5 100644\n>> --- a/builtin/fetch.c\n>> +++ b/builtin/fetch.c\n>> @@ -11,7 +11,6 @@\n>>   #include \"run-command.h\"\n>>   #include \"parse-options.h\"\n>>   #include \"sigchain.h\"\n>> -#include \"transport.h\"\n>>   #include \"submodule.h\"\n>>   #include \"connected.h\"\n>>   #include \"argv-array.h\"\n>> diff --git a/trailer.c b/trailer.c\n>> index 623adeb..05b3859 100644\n>> --- a/trailer.c\n>> +++ b/trailer.c\n>> @@ -1,7 +1,6 @@\n>>   #include \"cache.h\"\n>>   #include \"string-list.h\"\n>>   #include \"run-command.h\"\n>> -#include \"string-list.h\"\n>>   #include \"commit.h\"\n>>   #include \"trailer.h\"\n>>   /*\n>> diff --git a/transport-helper.c b/transport-helper.c\n>> index 0224687..3652b16 100644\n>> --- a/transport-helper.c\n>> +++ b/transport-helper.c\n>> @@ -5,7 +5,6 @@\n>>   #include \"commit.h\"\n>>   #include \"diff.h\"\n>>   #include \"revision.h\"\n>> -#include \"quote.h\"\n>>   #include \"remote.h\"\n>>   #include \"string-list.h\"\n>>   #include \"thread-utils.h\"\n>> diff --git a/userdiff.c b/userdiff.c\n>> index fad52d6..2ccbee5 100644\n>> --- a/userdiff.c\n>> +++ b/userdiff.c\n>> @@ -1,6 +1,5 @@\n>>   #include \"cache.h\"\n>>   #include \"userdiff.h\"\n>> -#include \"cache.h\"\n>>   #include \"attr.h\"\n>>   \n>>   static struct userdiff_driver *drivers;\n"}]}