* [PATCH] usage.c: remove unused functions
@ 2008-09-25 9:41 Nanako Shiraishi
2008-09-25 11:48 ` Thomas Rast
0 siblings, 1 reply; 7+ messages in thread
From: Nanako Shiraishi @ 2008-09-25 9:41 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
This removes three functions that are not used anywhere.
Signed-off-by: Nanako Shiraishi <nanako3@lavabit.com>
---
git-compat-util.h | 3 ---
usage.c | 16 ----------------
2 files changed, 0 insertions(+), 19 deletions(-)
diff --git a/git-compat-util.h b/git-compat-util.h
index db2836f..2ac832f 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -154,10 +154,7 @@ extern void die(const char *err, ...) NORETURN __attribute__((format (printf, 1,
extern int error(const char *err, ...) __attribute__((format (printf, 1, 2)));
extern void warning(const char *err, ...) __attribute__((format (printf, 1, 2)));
-extern void set_usage_routine(void (*routine)(const char *err) NORETURN);
extern void set_die_routine(void (*routine)(const char *err, va_list params) NORETURN);
-extern void set_error_routine(void (*routine)(const char *err, va_list params));
-extern void set_warn_routine(void (*routine)(const char *warn, va_list params));
extern int prefixcmp(const char *str, const char *prefix);
extern time_t tm_to_time_t(const struct tm *tm);
diff --git a/usage.c b/usage.c
index a5fc4ec..24f5fc0 100644
--- a/usage.c
+++ b/usage.c
@@ -41,27 +41,11 @@ static void (*die_routine)(const char *err, va_list params) NORETURN = die_built
static void (*error_routine)(const char *err, va_list params) = error_builtin;
static void (*warn_routine)(const char *err, va_list params) = warn_builtin;
-void set_usage_routine(void (*routine)(const char *err) NORETURN)
-{
- usage_routine = routine;
-}
-
void set_die_routine(void (*routine)(const char *err, va_list params) NORETURN)
{
die_routine = routine;
}
-void set_error_routine(void (*routine)(const char *err, va_list params))
-{
- error_routine = routine;
-}
-
-void set_warn_routine(void (*routine)(const char *warn, va_list params))
-{
- warn_routine = routine;
-}
-
-
void usage(const char *err)
{
usage_routine(err);
--
1.6.0.2
--
Nanako Shiraishi
http://ivory.ap.teacup.com/nanako3/
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] usage.c: remove unused functions
2008-09-25 9:41 [PATCH] usage.c: remove unused functions Nanako Shiraishi
@ 2008-09-25 11:48 ` Thomas Rast
2008-09-25 12:48 ` Petr Baudis
2008-09-25 12:53 ` Jakub Narebski
0 siblings, 2 replies; 7+ messages in thread
From: Thomas Rast @ 2008-09-25 11:48 UTC (permalink / raw)
To: Nanako Shiraishi; +Cc: Junio C Hamano, git, Petr Baudis
[-- Attachment #1: Type: text/plain, Size: 971 bytes --]
Nanako Shiraishi wrote:
> This removes three functions that are not used anywhere.
[...]
> -void set_usage_routine(void (*routine)(const char *err) NORETURN)
[...]
> -void set_error_routine(void (*routine)(const char *err, va_list params))
[...]
> -void set_warn_routine(void (*routine)(const char *warn, va_list params))
These blame to the following commit:
commit 39a3f5ea7c0352a530338d30d4e618f6b4db84e4
Author: Petr Baudis <pasky@suse.cz>
Date: Sat Jun 24 04:34:38 2006 +0200
Customizable error handlers
This patch makes the usage(), die() and error() handlers customizable.
Nothing in the git code itself uses that but many other libgit users
(like Git.pm) will.
[...]
So apparently the intent was that they would only be used from outside
Git. I don't know whether anyone still plans to do that, but they're
certainly not "just" unused.
- Thomas
--
Thomas Rast
trast@student.ethz.ch
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] usage.c: remove unused functions
2008-09-25 11:48 ` Thomas Rast
@ 2008-09-25 12:48 ` Petr Baudis
2008-09-25 14:51 ` Shawn O. Pearce
2008-09-25 12:53 ` Jakub Narebski
1 sibling, 1 reply; 7+ messages in thread
From: Petr Baudis @ 2008-09-25 12:48 UTC (permalink / raw)
To: Thomas Rast; +Cc: Nanako Shiraishi, Junio C Hamano, git
On Thu, Sep 25, 2008 at 01:48:37PM +0200, Thomas Rast wrote:
> Nanako Shiraishi wrote:
> > This removes three functions that are not used anywhere.
> [...]
> > -void set_usage_routine(void (*routine)(const char *err) NORETURN)
> [...]
> > -void set_error_routine(void (*routine)(const char *err, va_list params))
> [...]
> > -void set_warn_routine(void (*routine)(const char *warn, va_list params))
>
> These blame to the following commit:
>
> commit 39a3f5ea7c0352a530338d30d4e618f6b4db84e4
> Author: Petr Baudis <pasky@suse.cz>
> Date: Sat Jun 24 04:34:38 2006 +0200
>
> Customizable error handlers
>
> This patch makes the usage(), die() and error() handlers customizable.
> Nothing in the git code itself uses that but many other libgit users
> (like Git.pm) will.
> [...]
>
> So apparently the intent was that they would only be used from outside
> Git. I don't know whether anyone still plans to do that, but they're
> certainly not "just" unused.
I don't think it will be a big deal to remove these functions, though it
does feel like a little bit of a step backwards in the libgit efforts.
There are some programs that already link to Git, like CGit - I wonder
if some of them don't use them (CGit itself doesn't).
--
Petr "Pasky" Baudis
People who take cold baths never have rheumatism, but they have
cold baths.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] usage.c: remove unused functions
2008-09-25 12:48 ` Petr Baudis
@ 2008-09-25 14:51 ` Shawn O. Pearce
2008-09-25 20:43 ` Jonas Fonseca
2008-09-29 6:35 ` Lars Hjemli
0 siblings, 2 replies; 7+ messages in thread
From: Shawn O. Pearce @ 2008-09-25 14:51 UTC (permalink / raw)
To: Petr Baudis, Jonas Fonseca, Lars Hjemli
Cc: Thomas Rast, Nanako Shiraishi, Junio C Hamano, git
Petr Baudis <pasky@suse.cz> wrote:
> On Thu, Sep 25, 2008 at 01:48:37PM +0200, Thomas Rast wrote:
> > Nanako Shiraishi wrote:
> > > This removes three functions that are not used anywhere.
> > [...]
> > > -void set_usage_routine(void (*routine)(const char *err) NORETURN)
> > > -void set_error_routine(void (*routine)(const char *err, va_list params))
> > > -void set_warn_routine(void (*routine)(const char *warn, va_list params))
> >
> > These blame to the following commit:
> >
> > commit 39a3f5ea7c0352a530338d30d4e618f6b4db84e4
> > Author: Petr Baudis <pasky@suse.cz>
> >
> > Customizable error handlers
...
> > So apparently the intent was that they would only be used from outside
> > Git. I don't know whether anyone still plans to do that, but they're
> > certainly not "just" unused.
>
> I don't think it will be a big deal to remove these functions, though it
> does feel like a little bit of a step backwards in the libgit efforts.
> There are some programs that already link to Git, like CGit - I wonder
> if some of them don't use them (CGit itself doesn't).
IMHO these are useless for a "libgit". However both tig and
cgit link to the non-existant libgit.a, so they may be using
these routines. I've CC'd their authors and am not applying this
particular change without an ACK from them.
--
Shawn.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] usage.c: remove unused functions
2008-09-25 14:51 ` Shawn O. Pearce
@ 2008-09-25 20:43 ` Jonas Fonseca
2008-09-29 6:35 ` Lars Hjemli
1 sibling, 0 replies; 7+ messages in thread
From: Jonas Fonseca @ 2008-09-25 20:43 UTC (permalink / raw)
To: Shawn O. Pearce
Cc: Petr Baudis, Lars Hjemli, Thomas Rast, Nanako Shiraishi,
Junio C Hamano, git
Shawn O. Pearce <spearce@spearce.org> wrote Thu, Sep 25, 2008:
> IMHO these are useless for a "libgit". However both tig and
> cgit link to the non-existant libgit.a, so they may be using
> these routines. I've CC'd their authors and am not applying this
> particular change without an ACK from them.
This is not a problem for tig since it doesn't use libgit at all.
--
Jonas Fonseca
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] usage.c: remove unused functions
2008-09-25 14:51 ` Shawn O. Pearce
2008-09-25 20:43 ` Jonas Fonseca
@ 2008-09-29 6:35 ` Lars Hjemli
1 sibling, 0 replies; 7+ messages in thread
From: Lars Hjemli @ 2008-09-29 6:35 UTC (permalink / raw)
To: Shawn O. Pearce
Cc: Petr Baudis, Jonas Fonseca, Thomas Rast, Nanako Shiraishi,
Junio C Hamano, git
On Thu, Sep 25, 2008 at 4:51 PM, Shawn O. Pearce <spearce@spearce.org> wrote:
> Petr Baudis <pasky@suse.cz> wrote:
>> On Thu, Sep 25, 2008 at 01:48:37PM +0200, Thomas Rast wrote:
>> > Nanako Shiraishi wrote:
>> > > This removes three functions that are not used anywhere.
>> > [...]
>> > > -void set_usage_routine(void (*routine)(const char *err) NORETURN)
>> > > -void set_error_routine(void (*routine)(const char *err, va_list params))
>> > > -void set_warn_routine(void (*routine)(const char *warn, va_list params))
>> >
>> > These blame to the following commit:
>> >
>> > commit 39a3f5ea7c0352a530338d30d4e618f6b4db84e4
>> > Author: Petr Baudis <pasky@suse.cz>
>> >
>> > Customizable error handlers
> ...
>> > So apparently the intent was that they would only be used from outside
>> > Git. I don't know whether anyone still plans to do that, but they're
>> > certainly not "just" unused.
>>
>> I don't think it will be a big deal to remove these functions, though it
>> does feel like a little bit of a step backwards in the libgit efforts.
>> There are some programs that already link to Git, like CGit - I wonder
>> if some of them don't use them (CGit itself doesn't).
>
> IMHO these are useless for a "libgit". However both tig and
> cgit link to the non-existant libgit.a, so they may be using
> these routines. I've CC'd their authors and am not applying this
> particular change without an ACK from them.
Sorry for the late reply. And no, cgit doesn't use these functions and
I don't think that's going to change, so
Acked-by: Lars Hjemli <hjemli@gmail.com>
--
larsh
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] usage.c: remove unused functions
2008-09-25 11:48 ` Thomas Rast
2008-09-25 12:48 ` Petr Baudis
@ 2008-09-25 12:53 ` Jakub Narebski
1 sibling, 0 replies; 7+ messages in thread
From: Jakub Narebski @ 2008-09-25 12:53 UTC (permalink / raw)
To: git
Thomas Rast wrote:
> Nanako Shiraishi wrote:
>> This removes three functions that are not used anywhere.
> [...]
>> -void set_usage_routine(void (*routine)(const char *err) NORETURN)
> [...]
>> -void set_error_routine(void (*routine)(const char *err, va_list params))
> [...]
>> -void set_warn_routine(void (*routine)(const char *warn, va_list params))
>
> These blame to the following commit:
>
> commit 39a3f5ea7c0352a530338d30d4e618f6b4db84e4
> Author: Petr Baudis <pasky@suse.cz>
> Date: Sat Jun 24 04:34:38 2006 +0200
>
> Customizable error handlers
>
> This patch makes the usage(), die() and error() handlers customizable.
> Nothing in the git code itself uses that but many other libgit users
> (like Git.pm) will.
> [...]
>
> So apparently the intent was that they would only be used from outside
> Git. I don't know whether anyone still plans to do that, but they're
> certainly not "just" unused.
By the way, those functions could be used to implement
"git --silent <cmd>", which is equivalent of "git <cmd> 2>/dev/null"
(which you don't always can do easily).
--
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2008-09-29 6:36 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-25 9:41 [PATCH] usage.c: remove unused functions Nanako Shiraishi
2008-09-25 11:48 ` Thomas Rast
2008-09-25 12:48 ` Petr Baudis
2008-09-25 14:51 ` Shawn O. Pearce
2008-09-25 20:43 ` Jonas Fonseca
2008-09-29 6:35 ` Lars Hjemli
2008-09-25 12:53 ` Jakub Narebski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).