From: Junio C Hamano <gitster@pobox.com>
To: Felipe Contreras <felipe.contreras@gmail.com>
Cc: Johannes Schindelin <Johannes.Schindelin@gmx.de>, git@vger.kernel.org
Subject: Re: [PATCH v3] config: Add new option to open an editor.
Date: Sat, 07 Feb 2009 13:34:10 -0800 [thread overview]
Message-ID: <7vskmque25.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <94a0d4530902071315o78b2db58n481fbc6e956b5b64@mail.gmail.com> (Felipe Contreras's message of "Sat, 7 Feb 2009 23:15:30 +0200")
Felipe Contreras <felipe.contreras@gmail.com> writes:
>>> I think it should, how expensive would it be to call
>>> git_config(git_default_config, NULL) when it has been loaded already?
>>
>> We would not need the complete git_default_config(), would we?
>
> Nope, just core.editor. But I don't know how to load only that.
The most expensive part is to actually open and parse the files into
tokens, not strcmp/prefixcmp the parsed tokens and flipping internal bits
and storing value in const char * variables.
But you need to be careful about correctness issues. I do not want
launch_editor() to run git_config(). The caller, other than the caller
you happen to be interested in this thread, may already have read the
config and overrode some of the bits with what was given from the command
line. Calling git_config() overwrite the bits and will break these
callers.
I think the right thing to do is to call git_config() immediately before
you call launch_editor() in your patch.
next prev parent reply other threads:[~2009-02-07 21:35 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-03 22:40 [PATCH] config: Add new option to open an editor Felipe Contreras
2009-02-03 22:53 ` Johannes Schindelin
2009-02-03 22:56 ` Felipe Contreras
2009-02-03 23:05 ` Johannes Schindelin
2009-02-03 23:25 ` Felipe Contreras
2009-02-03 23:26 ` Felipe Contreras
2009-02-03 23:31 ` Johannes Schindelin
2009-02-03 23:43 ` Felipe Contreras
2009-02-04 14:53 ` Jeff King
2009-02-04 15:03 ` Felipe Contreras
2009-02-04 15:18 ` Jeff King
2009-02-04 15:41 ` Felipe Contreras
2009-02-04 22:34 ` [PATCH v3] " Felipe Contreras
2009-02-04 23:16 ` Junio C Hamano
2009-02-04 23:39 ` Felipe Contreras
2009-02-04 23:43 ` Johannes Schindelin
2009-02-04 23:49 ` Johannes Schindelin
2009-02-07 21:09 ` Felipe Contreras
2009-02-07 21:14 ` Johannes Schindelin
2009-02-07 21:15 ` Felipe Contreras
2009-02-07 21:34 ` Junio C Hamano [this message]
2009-02-07 21:50 ` Felipe Contreras
2009-02-07 21:53 ` [PATCH] " Felipe Contreras
2009-02-04 15:20 ` Johannes Schindelin
2009-02-04 15:42 ` Felipe Contreras
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=7vskmque25.fsf@gitster.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=Johannes.Schindelin@gmx.de \
--cc=felipe.contreras@gmail.com \
--cc=git@vger.kernel.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).