{"thread":{"id":"42570","subject":"[PATCH] write_or_die: remove the unused write_or_whine() function","startedAt":"2016-06-16T02:19:50Z","lastAt":"2016-06-16T02:19:50Z","messageCount":2,"participants":["Ramsay Jones","Jeff King"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"288859","messageId":"5759F326.9080101@ramsayjones.plus.com","threadId":"42570","inReplyTo":null,"subject":"[PATCH] write_or_die: remove the unused write_or_whine() function","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsayjones.plus.com","sentAt":"2016-06-09T22:52:22Z","receivedAt":"2016-06-16T02:19:50Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"\nSigned-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>\n---\n\nHi Junio,\n\nCommit f0bca72d (\"send-pack: use buffered I/O to talk to pack-objects\",\n08-06-2016) removed the last use of write_or_whine(). I had intended to\ninclude this 'commit citation' in the commit message, but until it reaches\nthe next branch, I don't know how stable that information will be.\n\nAnyway, on reflection, the subject line says everything that needs to be\nsaid. However, you need to know which commit this one depends on. ;-)\n\nATB,\nRamsay Jones\n\n cache.h        |  1 -\n write_or_die.c | 11 -----------\n 2 files changed, 12 deletions(-)\n\ndiff --git a/cache.h b/cache.h\nindex 84d8812..258f154 100644\n--- a/cache.h\n+++ b/cache.h\n@@ -1767,7 +1767,6 @@ extern int copy_file(const char *dst, const char *src, int mode);\n extern int copy_file_with_time(const char *dst, const char *src, int mode);\n \n extern void write_or_die(int fd, const void *buf, size_t count);\n-extern int write_or_whine(int fd, const void *buf, size_t count, const char *msg);\n extern int write_or_whine_pipe(int fd, const void *buf, size_t count, const char *msg);\n extern void fsync_or_die(int fd, const char *);\n \ndiff --git a/write_or_die.c b/write_or_die.c\nindex 49e80aa..9816879 100644\n--- a/write_or_die.c\n+++ b/write_or_die.c\n@@ -94,14 +94,3 @@ int write_or_whine_pipe(int fd, const void *buf, size_t count, const char *msg)\n \n \treturn 1;\n }\n-\n-int write_or_whine(int fd, const void *buf, size_t count, const char *msg)\n-{\n-\tif (write_in_full(fd, buf, count) < 0) {\n-\t\tfprintf(stderr, \"%s: write error (%s)\\n\",\n-\t\t\tmsg, strerror(errno));\n-\t\treturn 0;\n-\t}\n-\n-\treturn 1;\n-}\n-- \n2.8.0\n"},{"id":"288862","messageId":"20160610000107.GA25874@sigill.intra.peff.net","threadId":"42570","inReplyTo":"5759F326.9080101@ramsayjones.plus.com","subject":"Re: [PATCH] write_or_die: remove the unused write_or_whine() function","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2016-06-10T00:01:07Z","receivedAt":"2016-06-16T02:19:50Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Thu, Jun 09, 2016 at 11:52:22PM +0100, Ramsay Jones wrote:\n\n> \n> Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>\n> ---\n> \n> Hi Junio,\n> \n> Commit f0bca72d (\"send-pack: use buffered I/O to talk to pack-objects\",\n> 08-06-2016) removed the last use of write_or_whine(). I had intended to\n> include this 'commit citation' in the commit message, but until it reaches\n> the next branch, I don't know how stable that information will be.\n> \n> Anyway, on reflection, the subject line says everything that needs to be\n> said. However, you need to know which commit this one depends on. ;-)\n\nIMHO, it's a good idea for removal patches to reflect on why the thing\nis appropriate to remove. Obviously there are no callers, but do we\nexpect any to come back? I think probably not, because this function is\ndoing very little that a regular if() does not besides obfuscating the\nerror message (and if we ever did want something like it, we would\nprobably prefer the function to come back with more \"normal\" return\nvalue semantics).\n\n-Peff\n"}]}