From: Jeff King <peff@peff.net>
To: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>
Cc: Michal Vyskocil <mvyskocil@suse.cz>, git@vger.kernel.org
Subject: Re: [PATCH] show git tag output in pager
Date: Fri, 7 Oct 2011 12:16:48 -0400 [thread overview]
Message-ID: <20111007161648.GA4399@sigill.intra.peff.net> (raw)
In-Reply-To: <vpqsjn4dfi4.fsf@bauges.imag.fr>
On Fri, Oct 07, 2011 at 04:48:35PM +0200, Matthieu Moy wrote:
> > On Mon, Oct 03, 2011 at 02:57:09PM +0200, Matthieu Moy wrote:
> >
> >> I like the try_subcommand_pager idea. Ideally, there would also be a
> >> nice mechanism to set defaults for subcommands, so that "git tag
> >> <whatever>" does the right thing without configuration.
> >
> > That's easy enough. Something like the patch below?
>
> It may have been better with a big centralized array of configurations
> like
>
> static struct cmd_struct commands[] = {
> { "add", cmd_add, RUN_SETUP | NEED_WORK_TREE },
> ...
>
> in git.c, but if we have only a few instances of this, your system is
> probably fine. I like it.
I don't think you can centralize it in the same way, because some of it
will have to be implemented in shell script (unlike the full-command
ones, which we can always trigger at the git.c wrapper layer).
So you could have:
static struct pager_default subcommands[] = {
{ "tag.list", 1 },
{ "branch.list", 1 },
};
but you'll never be able to put "stash.list" into that structure (and as
you probably guessed, my patch isn't enough to implement stash.list,
either; it would need a shell implementation of try_subcommand_pager).
-Peff
prev parent reply other threads:[~2011-10-07 16:16 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-27 13:42 [PATCH] show git tag output in pager Michal Vyskocil
2011-09-27 14:19 ` Matthieu Moy
2011-09-29 9:37 ` Michal Vyskocil
2011-09-30 10:42 ` Jeff King
2011-10-03 12:57 ` Matthieu Moy
2011-10-07 14:44 ` Jeff King
2011-10-07 14:48 ` Matthieu Moy
2011-10-07 16:16 ` Jeff King [this message]
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=20111007161648.GA4399@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=Matthieu.Moy@grenoble-inp.fr \
--cc=git@vger.kernel.org \
--cc=mvyskocil@suse.cz \
/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).