From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: Kevin Ballard <kevin@sb.org>, Git Mailing List <git@vger.kernel.org>
Subject: Re: To page or not to page
Date: Thu, 01 May 2008 23:19:49 -0700 [thread overview]
Message-ID: <7vd4o5xm62.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <20080502060930.GA1079@sigill.intra.peff.net> (Jeff King's message of "Fri, 2 May 2008 02:09:30 -0400")
Jeff King <peff@peff.net> writes:
> @@ -267,103 +270,103 @@ static int run_command(struct cmd_struct *p, int argc, const char **argv)
> return 0;
> }
>
> +static struct cmd_struct commands[] = {
> + { "add", cmd_add, RUN_SETUP | NEED_WORK_TREE },
> + { "annotate", cmd_annotate, RUN_SETUP },
> + { "apply", cmd_apply },
> + { "archive", cmd_archive },
> + { "blame", cmd_blame, RUN_SETUP },
> + { "branch", cmd_branch, RUN_SETUP },
> + { "bundle", cmd_bundle },
> + { "cat-file", cmd_cat_file, RUN_SETUP },
...
> +};
> ...
> @@ -380,6 +383,31 @@ static void handle_internal_command(int argc, const char **argv)
> }
> }
>
> +void set_command_pager(const char *cmd, int use_pager)
> +{
> + int i;
> + for (i = 0; i < ARRAY_SIZE(commands); i++) {
> + struct cmd_struct *p = commands+i;
> + if (!strcmp(p->cmd, cmd)) {
> + if (use_pager)
> + p->option |= USE_PAGER;
> + else
> + p->option &= ~USE_PAGER;
> + return;
> + }
> + }
> +}
Heh, I like it. I briefly thought that pager.cat-file may wreak havoc on
scripts, but our pager machanism should be clever enough not to, and
cat-file is a valid variable name in the configuration file format ;-).
next prev parent reply other threads:[~2008-05-02 6:20 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-02 5:41 To page or not to page Kevin Ballard
2008-05-02 5:45 ` Jeff King
2008-05-02 5:56 ` Junio C Hamano
2008-05-02 6:04 ` Kevin Ballard
2008-05-02 6:08 ` Junio C Hamano
2008-05-02 13:47 ` Bart Trojanowski
2008-05-02 9:41 ` Pedro Melo
2008-05-02 16:58 ` Kevin Ballard
2008-05-02 10:34 ` Wincent Colaiuta
2008-05-02 12:36 ` Jeff King
2008-05-02 13:49 ` Pedro Melo
2008-05-02 14:00 ` Aidan Van Dyk
2008-05-02 16:13 ` Wincent Colaiuta
2008-05-02 16:56 ` Kevin Ballard
2008-05-02 18:40 ` Wincent Colaiuta
2008-05-02 6:11 ` Jeff King
2008-05-02 7:53 ` Johannes Schindelin
2008-05-02 6:09 ` Jeff King
2008-05-02 6:19 ` Junio C Hamano [this message]
2008-05-02 12:55 ` Jeff King
2008-05-02 18:18 ` Junio C Hamano
2008-05-05 21:59 ` Jeff King
2008-05-06 5:51 ` Jeff King
2008-05-06 5:53 ` Jeff King
2008-05-11 17:15 ` Junio C Hamano
2008-05-16 4:42 ` Jeff King
2008-05-16 4:51 ` Jeff King
2008-05-16 10:29 ` Johannes Schindelin
2008-05-02 6:56 ` Jakub Narebski
2008-05-02 12:57 ` Jeff King
2008-05-02 15:36 ` Jeff King
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=7vd4o5xm62.fsf@gitster.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=kevin@sb.org \
--cc=peff@peff.net \
/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).