Re: [PATCH] Allow git_author|committer_info be called in the same expression
- From
Alex Riesen <raa.lkml@gmail.com>
- Date
- Aug 1, 2007, 09:35 UTC
- Message-ID
- <81b0412b0708010235j3c731b38v32b5a717ae9f1f0b@mail.gmail.com>
- In-Reply-To
- <7vhcnj7gkt.fsf@assigned-by-dhcp.cox.net>
On 8/1/07, Junio C Hamano <gitster@pobox.com> wrote:
Show 13 quoted lines
> "Alex Riesen" <raa.lkml@gmail.com> writes:
>
> > const char *git_committer_info(int error_on_no_name)
> > {
> > - return fmt_ident(getenv("GIT_COMMITTER_NAME"),
> > - getenv("GIT_COMMITTER_EMAIL"),
> > - getenv("GIT_COMMITTER_DATE"),
> > - error_on_no_name);
> > + static char *buffer;
> > + if (!buffer)
> > + buffer = xmalloc(FMT_IDENT_BUFSIZE);
>
> It is not like we are aiming to run on embedded devices, I thinkActually, I am planning to run it on Neo1973 (Openmoko), which is quite embedded with its 128mb.
Show 6 quoted lines
> trying to save static memory when the function is not called > by doing things like this is not worth it. Why not just: > > static char buffer[FMT_IDENT_BUFSIZE]; > > instead?
Just a custom. This is a big bugger, err... buffer.
> As to parts of the system that other people are primarily in > charge of, git-gui 0.8.0 is already in as promised, updates to > gitk were merged, and we've had a nice set of improvements from
BTW, gitk. Have you seen the gitk patches regarding errors in non-GIT and not-yet-GIT directory?