git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christian Couder <chriscool@tuxfamily.org>
To: Xavier Maillard <xma@gnu.org>
Cc: junkio@cox.net, pascal@obry.net, nanako3@bluebottle.com,
	git@vger.kernel.org
Subject: Re: [PATCH] help: implement multi-valued "man.viewer" config option
Date: Wed, 12 Mar 2008 08:23:37 +0100	[thread overview]
Message-ID: <200803120823.38100.chriscool@tuxfamily.org> (raw)
In-Reply-To: <200803120100.m2C105YM010496@localhost.localdomain>

Le mercredi 12 mars 2008, Xavier Maillard a écrit :
>
> Tested-by: Xavier Maillard <xma@gnu.org>

Thanks.

> Though, I thought that when one entry had failed we would have
> switched to the next until none could be found thus
>
> I (voluntary) made a typo in my .git/config file as reflected by:
>
> [xma@localhost 23:57:18 git]$ git config --get-all man.viewer
> woma  <- TYPO HERE
> konqueror
> man
>
> and I then tried git config --help. I thought it would have tried
> all entries and as a last resort would have failed back to man
> but it did not act like this:
>
> [xma@localhost 23:57:11 git]$ git config --help
> error: 'woma': unsupported man viewer.
> fatal: bad config file line 16 in .git/config
>
> Ok, woma in not supported here and it is reported like this but
> would it be possible to just throw an error on stdout and try
> another viewer ? 

Yes, with the following patch on top:

diff --git a/help.c b/help.c
index 5da8c9c..ecaca77 100644
--- a/help.c
+++ b/help.c
@@ -139,7 +139,7 @@ static int add_man_viewer(const char *value)
        else if (!strcasecmp(value, "konqueror"))
                do_add_man_viewer(exec_man_konqueror);
        else
-               return error("'%s': unsupported man viewer.", value);
+               warning("'%s': unsupported man viewer.", value);

        return 0;
 }

> We could even imagine something even more 
> general like the possibility for the user to write his own man
> viewer (a bash script for example) and set it as a candidate.

I will do that in a latter patch, it has been suggested a lot of times 
already.

> By the way, I do not see any reason to put man as a candidate.
> "man" should be the default when nothing is specified or when all
> candidates have failed.

It may be more explicit.

Thanks,
Christian.

> Anyway, thank you for this implementation.
>
> 	Xavier

  reply	other threads:[~2008-03-12  7:18 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-11  7:51 [PATCH] help: implement multi-valued "man.viewer" config option Christian Couder
2008-03-12  1:00 ` Xavier Maillard
2008-03-12  7:23   ` Christian Couder [this message]
2008-03-14  1:00     ` Xavier Maillard
2008-03-14  5:26       ` Christian Couder
2008-03-15 13:00         ` Xavier Maillard

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=200803120823.38100.chriscool@tuxfamily.org \
    --to=chriscool@tuxfamily.org \
    --cc=git@vger.kernel.org \
    --cc=junkio@cox.net \
    --cc=nanako3@bluebottle.com \
    --cc=pascal@obry.net \
    --cc=xma@gnu.org \
    /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).