From: "Nguyen Thai Ngoc Duy" <pclouds@gmail.com>
To: "Junio C Hamano" <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 1/2] Show html help with git-help --html
Date: Wed, 6 Jun 2007 07:07:35 -0400 [thread overview]
Message-ID: <fcaeb9bf0706060407k26bfc0baw91c08f907384949b@mail.gmail.com> (raw)
In-Reply-To: <7vzm3e9lui.fsf@assigned-by-dhcp.cox.net>
On 6/5/07, Junio C Hamano <gitster@pobox.com> wrote:
> Nguyen Thai Ngoc Duy <pclouds@gmail.com> writes:
>
> > This patch was inspired by ClearCase command 'ct man',...
>
> > diff --git a/help.c b/help.c
> > index 6a9af4d..78b1023 100644
> > --- a/help.c
> > +++ b/help.c
> > @@ -9,6 +9,14 @@
> > #include "common-cmds.h"
> > #include <sys/ioctl.h>
> >
> > +#ifndef HTML_DIR
> > +#define HTML_DIR "/usr/share/html/"
> > +#endif
> > +
> > +#ifndef HTML_PROGRAM
> > +#define HTML_PROGRAM "xdg-open"
> > +#endif
> > +
> > /* most GUI terminals set COLUMNS (although some don't export it) */
> > static int term_columns(void)
> > {
> > @@ -183,6 +191,145 @@ static void show_man_page(const char *git_cmd)
> > execlp("man", "man", page, NULL);
> > }
> >
> > +static void show_html_page(const char *git_cmd)
> > +{
> > + const char *html_dir;
> > + int len, ret, nr_quotes;
> > + char *p, *p2;
> > + const char *cp, *cp2;
> > + struct stat st;
> > + char *quoted_git_cmd;
> > + char *default_command = NULL;
> > + const char *command;
> >...
> > + /* append %p if there is not any %x */
> > + if (!strchr(command, '%')) {
> > + len = strlen(command);
> > + default_command = xmalloc(len + 3 + 1); /* space %p */
> > + strcpy(default_command, command);
> > + strcat(default_command, " %p");
> > + command = default_command;
> > + }
> > +
> > + /* first pass, calculate command length */
> > ...
>
> Hmmm. Makes one wonder why interpolate is not used....
Sorry for my ignorant. I have no idea where to use interpolate :( Did
you mean to pretend adding %p to command without alloc new buffer
(default_command) ?
--
Duy
next prev parent reply other threads:[~2007-06-06 11:07 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-06-05 18:34 [PATCH 1/2] Show html help with git-help --html Nguyen Thai Ngoc Duy
2007-06-05 19:34 ` Frank Lichtenheld
2007-06-05 19:42 ` Nguyen Thai Ngoc Duy
2007-06-05 20:40 ` Junio C Hamano
2007-06-06 11:07 ` Nguyen Thai Ngoc Duy [this message]
2007-06-09 15:03 ` Nguyen Thai Ngoc Duy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=fcaeb9bf0706060407k26bfc0baw91c08f907384949b@mail.gmail.com \
--to=pclouds@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).