user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
From: Eric Wong <e@80x24.org>
To: meta@public-inbox.org
Subject: [PATCH 6/7] config: use '-f' key to store config file pathname
Date: Thu, 11 Mar 2021 02:45:37 -0800	[thread overview]
Message-ID: <20210311104538.7743-7-e@80x24.org> (raw)
In-Reply-To: <20210311104538.7743-1-e@80x24.org>

This fixes ->urlmatch use from lei, which already sets '-f'.
I noticed this because imap.$URL.compress was ignored in
my lei config file.
---
 lib/PublicInbox/Config.pm | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/PublicInbox/Config.pm b/lib/PublicInbox/Config.pm
index a4b1756d..87a03fd3 100644
--- a/lib/PublicInbox/Config.pm
+++ b/lib/PublicInbox/Config.pm
@@ -26,6 +26,7 @@ sub new {
 		$self = config_fh_parse($fh, "\n", '=');
 	} else {
 		$self = git_config_dump($file);
+		$self->{'-f'} = $file;
 	}
 	bless $self, $class;
 	# caches
@@ -505,7 +506,7 @@ sub urlmatch {
 	my ($self, $key, $url) = @_;
 	state $urlmatch_broken; # requires git 1.8.5
 	return if $urlmatch_broken;
-	my $file = default_file();
+	my $file = $self->{'-f'} // default_file();
 	my $cmd = [qw/git config -z --includes --get-urlmatch/,
 		"--file=$file", $key, $url ];
 	my $fh = popen_rd($cmd);

  parent reply	other threads:[~2021-03-11 10:45 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-11 10:45 [PATCH 0/7] doc updates, fixups, and more Eric Wong
2021-03-11 10:45 ` [PATCH 1/7] doc: glossary: add information for dates and timestamps Eric Wong
2021-03-11 10:45 ` [PATCH 2/7] searchidx: remove smsg_from_doc Eric Wong
2021-03-11 10:45 ` [PATCH 3/7] lei_curl: note proposed master/client mode for curl Eric Wong
2021-03-11 10:45 ` [PATCH 4/7] doc: update 1.7 release notes, tuning, TODO Eric Wong
2021-03-11 10:45 ` [PATCH 5/7] imapclient: disable workaround for Mail::IMAPClient 3.43+ Eric Wong
2021-03-11 20:34   ` [SQUASH] " Eric Wong
2021-03-11 10:45 ` Eric Wong [this message]
2021-03-11 10:45 ` [PATCH 7/7] v2writable: fix undocumented --xapian-only Eric Wong

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

  List information: https://public-inbox.org/README

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210311104538.7743-7-e@80x24.org \
    --to=e@80x24.org \
    --cc=meta@public-inbox.org \
    --subject='Re: [PATCH 6/7] config: use '\''-f'\'' key to store config file pathname' \
    /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

Code repositories for project(s) associated with this inbox:

	https://80x24.org/public-inbox.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).