{"thread":{"id":"3977","subject":"Fix \"git help -a\" terminal autosizing","startedAt":"2006-04-27T16:02:54Z","lastAt":"2006-04-27T16:02:54Z","messageCount":1,"participants":["Linus Torvalds"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"19186","messageId":"Pine.LNX.4.64.0604270859050.3701@g5.osdl.org","threadId":"3977","inReplyTo":null,"subject":"Fix \"git help -a\" terminal autosizing","fromName":"Linus Torvalds","fromEmail":"torvalds@osdl.org","sentAt":"2006-04-27T16:02:54Z","receivedAt":"2006-04-27T16:02:54Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\nWhen I split out the builtin commands into their own files, I left the \ninclude of <sys/ioctl.h> in git.c rather than moving it to the file that \nneeded it (builtin-help.c).\n\nNobody seems to have noticed, because everything still worked, but because \nthe TIOCGWINSZ macro was now no longer defined when compiling the \n\"term_columns()\" function, it would no longer automatically notice the \nterminal size unless your system used the ancient \"COLUMNS\" environment \nvariable approach.\n\nTrivially fixed by just moving the header include to the file that \nactually needs it.\n\nSigned-off-by: Linus Torvalds <torvalds@osdl.org>\n---\ndiff --git a/builtin-help.c b/builtin-help.c\nindex 10a59cc..7470faa 100644\n--- a/builtin-help.c\n+++ b/builtin-help.c\n@@ -3,6 +3,7 @@\n  *\n  * Builtin help-related commands (help, usage, version)\n  */\n+#include <sys/ioctl.h>\n #include \"cache.h\"\n #include \"builtin.h\"\n #include \"exec_cmd.h\"\ndiff --git a/git.c b/git.c\nindex aa2b814..01b7e28 100644\n--- a/git.c\n+++ b/git.c\n@@ -8,7 +8,6 @@ #include <string.h>\n #include <errno.h>\n #include <limits.h>\n #include <stdarg.h>\n-#include <sys/ioctl.h>\n #include \"git-compat-util.h\"\n #include \"exec_cmd.h\"\n \n"}]}