{"thread":{"id":"15668","subject":"[PATCH] usage.c: remove unused functions","startedAt":"2008-09-25T09:41:04Z","lastAt":"2008-09-29T06:35:44Z","messageCount":7,"participants":["Nanako Shiraishi","Thomas Rast","Petr Baudis","Jakub Narebski","Shawn O. Pearce","Jonas Fonseca","Lars Hjemli"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"91570","messageId":"20080925184104.6117@nanako3.lavabit.com","threadId":"15668","inReplyTo":null,"subject":"[PATCH] usage.c: remove unused functions","fromName":"Nanako Shiraishi","fromEmail":"nanako3@lavabit.com","sentAt":"2008-09-25T09:41:04Z","receivedAt":"2008-09-25T09:41:04Z","isPatch":true,"sender":{"key":"nanako3@lavabit.com","avatar":"https://gravatar.com/avatar/3777b9e201c5883a62b1a6fdf7c53f2d712d1d80989146063ea861e33aad72a8?d=mp&s=160"},"body":"This removes three functions that are not used anywhere.\n\nSigned-off-by: Nanako Shiraishi <nanako3@lavabit.com>\n---\n git-compat-util.h |    3 ---\n usage.c           |   16 ----------------\n 2 files changed, 0 insertions(+), 19 deletions(-)\n\ndiff --git a/git-compat-util.h b/git-compat-util.h\nindex db2836f..2ac832f 100644\n--- a/git-compat-util.h\n+++ b/git-compat-util.h\n@@ -154,10 +154,7 @@ extern void die(const char *err, ...) NORETURN __attribute__((format (printf, 1,\n extern int error(const char *err, ...) __attribute__((format (printf, 1, 2)));\n extern void warning(const char *err, ...) __attribute__((format (printf, 1, 2)));\n \n-extern void set_usage_routine(void (*routine)(const char *err) NORETURN);\n extern void set_die_routine(void (*routine)(const char *err, va_list params) NORETURN);\n-extern void set_error_routine(void (*routine)(const char *err, va_list params));\n-extern void set_warn_routine(void (*routine)(const char *warn, va_list params));\n \n extern int prefixcmp(const char *str, const char *prefix);\n extern time_t tm_to_time_t(const struct tm *tm);\ndiff --git a/usage.c b/usage.c\nindex a5fc4ec..24f5fc0 100644\n--- a/usage.c\n+++ b/usage.c\n@@ -41,27 +41,11 @@ static void (*die_routine)(const char *err, va_list params) NORETURN = die_built\n static void (*error_routine)(const char *err, va_list params) = error_builtin;\n static void (*warn_routine)(const char *err, va_list params) = warn_builtin;\n \n-void set_usage_routine(void (*routine)(const char *err) NORETURN)\n-{\n-\tusage_routine = routine;\n-}\n-\n void set_die_routine(void (*routine)(const char *err, va_list params) NORETURN)\n {\n \tdie_routine = routine;\n }\n \n-void set_error_routine(void (*routine)(const char *err, va_list params))\n-{\n-\terror_routine = routine;\n-}\n-\n-void set_warn_routine(void (*routine)(const char *warn, va_list params))\n-{\n-\twarn_routine = routine;\n-}\n-\n-\n void usage(const char *err)\n {\n \tusage_routine(err);\n\n-- \n1.6.0.2\n\n-- \nNanako Shiraishi\nhttp://ivory.ap.teacup.com/nanako3/\n"},{"id":"91581","messageId":"200809251348.42789.trast@student.ethz.ch","threadId":"15668","inReplyTo":"20080925184104.6117@nanako3.lavabit.com","subject":"Re: [PATCH] usage.c: remove unused functions","fromName":"Thomas Rast","fromEmail":"trast@student.ethz.ch","sentAt":"2008-09-25T11:48:37Z","receivedAt":"2008-09-25T11:48:37Z","isPatch":true,"sender":{"key":"tr@thomasrast.ch","avatar":"https://avatars.githubusercontent.com/u/153510?v=4"},"body":"Nanako Shiraishi wrote:\n> This removes three functions that are not used anywhere.\n[...]\n> -void set_usage_routine(void (*routine)(const char *err) NORETURN)\n[...]\n> -void set_error_routine(void (*routine)(const char *err, va_list params))\n[...]\n> -void set_warn_routine(void (*routine)(const char *warn, va_list params))\n\nThese blame to the following commit:\n\n  commit 39a3f5ea7c0352a530338d30d4e618f6b4db84e4\n  Author: Petr Baudis <pasky@suse.cz>\n  Date:   Sat Jun 24 04:34:38 2006 +0200\n\n      Customizable error handlers\n      \n      This patch makes the usage(), die() and error() handlers customizable.\n      Nothing in the git code itself uses that but many other libgit users\n      (like Git.pm) will.\n  [...]\n\nSo apparently the intent was that they would only be used from outside\nGit.  I don't know whether anyone still plans to do that, but they're\ncertainly not \"just\" unused.\n\n- Thomas\n\n-- \nThomas Rast\ntrast@student.ethz.ch\n\n"},{"id":"91588","messageId":"20080925124836.GI10360@machine.or.cz","threadId":"15668","inReplyTo":"200809251348.42789.trast@student.ethz.ch","subject":"Re: [PATCH] usage.c: remove unused functions","fromName":"Petr Baudis","fromEmail":"pasky@suse.cz","sentAt":"2008-09-25T12:48:36Z","receivedAt":"2008-09-25T12:48:36Z","isPatch":true,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"On Thu, Sep 25, 2008 at 01:48:37PM +0200, Thomas Rast wrote:\n> Nanako Shiraishi wrote:\n> > This removes three functions that are not used anywhere.\n> [...]\n> > -void set_usage_routine(void (*routine)(const char *err) NORETURN)\n> [...]\n> > -void set_error_routine(void (*routine)(const char *err, va_list params))\n> [...]\n> > -void set_warn_routine(void (*routine)(const char *warn, va_list params))\n> \n> These blame to the following commit:\n> \n>   commit 39a3f5ea7c0352a530338d30d4e618f6b4db84e4\n>   Author: Petr Baudis <pasky@suse.cz>\n>   Date:   Sat Jun 24 04:34:38 2006 +0200\n> \n>       Customizable error handlers\n>       \n>       This patch makes the usage(), die() and error() handlers customizable.\n>       Nothing in the git code itself uses that but many other libgit users\n>       (like Git.pm) will.\n>   [...]\n> \n> So apparently the intent was that they would only be used from outside\n> Git.  I don't know whether anyone still plans to do that, but they're\n> certainly not \"just\" unused.\n\nI don't think it will be a big deal to remove these functions, though it\ndoes feel like a little bit of a step backwards in the libgit efforts.\nThere are some programs that already link to Git, like CGit - I wonder\nif some of them don't use them (CGit itself doesn't).\n\n-- \n\t\t\t\tPetr \"Pasky\" Baudis\nPeople who take cold baths never have rheumatism, but they have\ncold baths.\n"},{"id":"91589","messageId":"gbg1jc$hjm$1@ger.gmane.org","threadId":"15668","inReplyTo":"200809251348.42789.trast@student.ethz.ch","subject":"Re: [PATCH] usage.c: remove unused functions","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2008-09-25T12:53:01Z","receivedAt":"2008-09-25T12:53:01Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Thomas Rast wrote:\n\n> Nanako Shiraishi wrote:\n>> This removes three functions that are not used anywhere.\n> [...]\n>> -void set_usage_routine(void (*routine)(const char *err) NORETURN)\n> [...]\n>> -void set_error_routine(void (*routine)(const char *err, va_list params))\n> [...]\n>> -void set_warn_routine(void (*routine)(const char *warn, va_list params))\n> \n> These blame to the following commit:\n> \n>   commit 39a3f5ea7c0352a530338d30d4e618f6b4db84e4\n>   Author: Petr Baudis <pasky@suse.cz>\n>   Date:   Sat Jun 24 04:34:38 2006 +0200\n> \n>       Customizable error handlers\n>       \n>       This patch makes the usage(), die() and error() handlers customizable.\n>       Nothing in the git code itself uses that but many other libgit users\n>       (like Git.pm) will.\n>   [...]\n> \n> So apparently the intent was that they would only be used from outside\n> Git.  I don't know whether anyone still plans to do that, but they're\n> certainly not \"just\" unused.\n\nBy the way, those functions could be used to implement \n\"git --silent <cmd>\", which is equivalent of \"git <cmd> 2>/dev/null\"\n(which you don't always can do easily).\n\n-- \nJakub Narebski\nWarsaw, Poland\nShadeHawk on #git\n"},{"id":"91603","messageId":"20080925145134.GL3669@spearce.org","threadId":"15668","inReplyTo":"20080925124836.GI10360@machine.or.cz","subject":"Re: [PATCH] usage.c: remove unused functions","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2008-09-25T14:51:34Z","receivedAt":"2008-09-25T14:51:34Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Petr Baudis <pasky@suse.cz> wrote:\n> On Thu, Sep 25, 2008 at 01:48:37PM +0200, Thomas Rast wrote:\n> > Nanako Shiraishi wrote:\n> > > This removes three functions that are not used anywhere.\n> > [...]\n> > > -void set_usage_routine(void (*routine)(const char *err) NORETURN)\n> > > -void set_error_routine(void (*routine)(const char *err, va_list params))\n> > > -void set_warn_routine(void (*routine)(const char *warn, va_list params))\n> > \n> > These blame to the following commit:\n> > \n> >   commit 39a3f5ea7c0352a530338d30d4e618f6b4db84e4\n> >   Author: Petr Baudis <pasky@suse.cz>\n> > \n> >       Customizable error handlers\n...\n> > So apparently the intent was that they would only be used from outside\n> > Git.  I don't know whether anyone still plans to do that, but they're\n> > certainly not \"just\" unused.\n> \n> I don't think it will be a big deal to remove these functions, though it\n> does feel like a little bit of a step backwards in the libgit efforts.\n> There are some programs that already link to Git, like CGit - I wonder\n> if some of them don't use them (CGit itself doesn't).\n\nIMHO these are useless for a \"libgit\".  However both tig and\ncgit link to the non-existant libgit.a, so they may be using\nthese routines.  I've CC'd their authors and am not applying this\nparticular change without an ACK from them.\n\n-- \nShawn.\n"},{"id":"91626","messageId":"20080925204341.GA22708@diku.dk","threadId":"15668","inReplyTo":"20080925145134.GL3669@spearce.org","subject":"Re: [PATCH] usage.c: remove unused functions","fromName":"Jonas Fonseca","fromEmail":"fonseca@diku.dk","sentAt":"2008-09-25T20:43:41Z","receivedAt":"2008-09-25T20:43:41Z","isPatch":true,"sender":{"key":"fonseca@diku.dk","avatar":"https://gravatar.com/avatar/f82f3ad698717c51873b020c750a92438c820a24056dc39fe4d07baa10a92264?d=mp&s=160"},"body":"Shawn O. Pearce <spearce@spearce.org> wrote Thu, Sep 25, 2008:\n> IMHO these are useless for a \"libgit\".  However both tig and\n> cgit link to the non-existant libgit.a, so they may be using\n> these routines.  I've CC'd their authors and am not applying this\n> particular change without an ACK from them.\n\nThis is not a problem for tig since it doesn't use libgit at all.\n\n-- \nJonas Fonseca\n"},{"id":"91826","messageId":"8c5c35580809282335q7eb828eei1fd545d308d9e5ca@mail.gmail.com","threadId":"15668","inReplyTo":"20080925145134.GL3669@spearce.org","subject":"Re: [PATCH] usage.c: remove unused functions","fromName":"Lars Hjemli","fromEmail":"hjemli@gmail.com","sentAt":"2008-09-29T06:35:44Z","receivedAt":"2008-09-29T06:35:44Z","isPatch":true,"sender":{"key":"hjemli@gmail.com","avatar":null},"body":"On Thu, Sep 25, 2008 at 4:51 PM, Shawn O. Pearce <spearce@spearce.org> wrote:\n> Petr Baudis <pasky@suse.cz> wrote:\n>> On Thu, Sep 25, 2008 at 01:48:37PM +0200, Thomas Rast wrote:\n>> > Nanako Shiraishi wrote:\n>> > > This removes three functions that are not used anywhere.\n>> > [...]\n>> > > -void set_usage_routine(void (*routine)(const char *err) NORETURN)\n>> > > -void set_error_routine(void (*routine)(const char *err, va_list params))\n>> > > -void set_warn_routine(void (*routine)(const char *warn, va_list params))\n>> >\n>> > These blame to the following commit:\n>> >\n>> >   commit 39a3f5ea7c0352a530338d30d4e618f6b4db84e4\n>> >   Author: Petr Baudis <pasky@suse.cz>\n>> >\n>> >       Customizable error handlers\n> ...\n>> > So apparently the intent was that they would only be used from outside\n>> > Git.  I don't know whether anyone still plans to do that, but they're\n>> > certainly not \"just\" unused.\n>>\n>> I don't think it will be a big deal to remove these functions, though it\n>> does feel like a little bit of a step backwards in the libgit efforts.\n>> There are some programs that already link to Git, like CGit - I wonder\n>> if some of them don't use them (CGit itself doesn't).\n>\n> IMHO these are useless for a \"libgit\".  However both tig and\n> cgit link to the non-existant libgit.a, so they may be using\n> these routines.  I've CC'd their authors and am not applying this\n> particular change without an ACK from them.\n\nSorry for the late reply. And no, cgit doesn't use these functions and\nI don't think that's going to change, so\n\nAcked-by: Lars Hjemli <hjemli@gmail.com>\n\n--\nlarsh\n"}]}