Re: [PATCH v3] config: Add new option to open an editor.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Feb 7, 2009 at 11:34 PM, Junio C Hamano <gitster@xxxxxxxxx> wrote:
> Felipe Contreras <felipe.contreras@xxxxxxxxx> 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.

Right, also for some reason the caller might actually call a specific
editor and not the one configured, but that would require more changes
to editor.c

For now I guess this patch should be fine (re-sending).

-- 
Felipe Contreras
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux