All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCHv2] Possibility to read both from ~/.gitconfig and from $XDG_CONFIG_HOME/git/config
@ 2012-05-31  8:46 nguyenhu
  0 siblings, 0 replies; 91+ messages in thread
From: nguyenhu @ 2012-05-31  8:46 UTC (permalink / raw)
  To: Junio C Hamano, Matthieu Moy
  Cc: git, Lucien KONG, Valentin DUPERRAY, Thomas NGUY, Franck JONAS


Junio C Hamano <gitster@pobox.com> wrote:
> Is it just me who finds the above three lines extremely unreadable?
>
> Also can you give this patch a bit more sensible title?
> "Possibility to" does not tell us much---anything is possible if you
> change code after all.
>
> I see the patch does not touch the writing codepath, which is
> probably a good thing, but the log message should explicitly state
> that.

I will change that in my next version.

> I am not sure in what way $HOME/.gitconfig has "priority".
>
> Your proposed log message says that You read from $HOME/.gitconfig
> and then from $XDG_CONFIG_HOME/git/config, which means that any
> single-valued variable set in $HOME/.gitconfig will be overwritten
> by whatever is in $XDG_CONFIG_HOME/git/config, no?  That sounds like
> you are giving priority to the latter to me.

You are right. Git takes into account $HOME/.gitconfig if one variable  
is defined in both configuration files. I will explains that more  
clearly in documentation.

> The original that read from $HOME/.gitconfig was simple enough so
> having three copies of getenv("HOME") was perfectly fine, but as you
> are introduce this much complexity to to decide which two files to
> read from, the code added this patch needs to be refactored and
> three copies of the same logic need to be consolidated, I would have
> to say.

Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> writes:
> Shouldn't there be a helper function to get the path ~/.config/git/
> and then append config? You're already computing this path twice, and
> we'll need more instances of it if we want to give default values to
> core.excludesfile and core.attributesfile in this directory too.

I agree. I will write a function to get ~/.config/git/ and refactor code.

^ permalink raw reply	[flat|nested] 91+ messages in thread
* Re: [PATCHv2] Possibility to read both from ~/.gitconfig and from $XDG_CONFIG_HOME/git/config
@ 2012-06-01 19:49 nguyenhu
  2012-06-04 17:27 ` Ramsay Jones
  0 siblings, 1 reply; 91+ messages in thread
From: nguyenhu @ 2012-06-01 19:49 UTC (permalink / raw)
  To: ramsay; +Cc: git

Ramsay Jones <ramsay@ramsay1.demon.co.uk> writes:
> I have not tried this patch (or the v3 version, which I haven't read  
> yet), but
> is it likely that this has re-introduced the bug addressed by commit 05bab3ea
> ("config.c: Fix a static buffer overwrite bug by avoiding mkpath()",  
> >19-11-2011)?.
>
> I don't know the answer, but I suspect that it may have done just  
> that. >(indeed, it
> may well have made the bug more likely to appear).
>
>
>> The original that read from $HOME/.gitconfig was simple enough so
>> having three copies of getenv("HOME") was perfectly fine, but as you
>> are introduce this much complexity to to decide which two files to
>> read from, the code added this patch needs to be refactored and
>> three copies of the same logic need to be consolidated, I would have
>> to say.
>
> I agree. Also, using mksnpath() in the refactored code (rather than
> mkpath()) would be a good idea. :-P
>
> ATB,
> Ramsay Jones

Is not mkpath() the same function as mksnpath with char *buff =  
buf[PATH_MAX] and size_t n = sizeof(buf) ?

^ permalink raw reply	[flat|nested] 91+ messages in thread

end of thread, other threads:[~2012-07-16 16:56 UTC | newest]

Thread overview: 91+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1338400509-26087-1-git-send-email-Huynh-Khoi-Nguyen.Nguyen@ensimag.imag.fr>
2012-05-30 21:19 ` [PATCHv2] Possibility to read both from ~/.gitconfig and from $XDG_CONFIG_HOME/git/config Huynh Khoi Nguyen NGUYEN
2012-05-30 21:54   ` Junio C Hamano
2012-05-31 22:06     ` Ramsay Jones
2012-05-31 14:40   ` [PATCHv3] Read from XDG configuration file, not write Huynh Khoi Nguyen NGUYEN
2012-05-31 20:13     ` Junio C Hamano
2012-06-01 21:23     ` [PATCHv4] Read (but not write) from XDG configuration, XDG attributes and XDG ignore files Huynh Khoi Nguyen NGUYEN
2012-06-02 11:20       ` Matthieu Moy
2012-06-02 15:52         ` nguyenhu
2012-06-02 21:05           ` Matthieu Moy
2012-06-03 20:14       ` [PATCHv5 1/4] Read (but not write) from $XDG_CONFIG_HOME/git/config file Huynh Khoi Nguyen NGUYEN
2012-06-03 20:14         ` [PATCHv5 2/4] Let core.excludesfile default to $XDG_CONFIG_HOME/git/ignore Huynh Khoi Nguyen NGUYEN
2012-06-04 11:43           ` Matthieu Moy
2012-06-05 13:17             ` nguyenhu
2012-06-03 20:14         ` [PATCHv5 3/4] Let core.attributesfile default to $XDG_CONFIG_HOME/git/attributes Huynh Khoi Nguyen NGUYEN
2012-06-03 20:14         ` [PATCHv5 4/4] Write to $XDG_CONFIG_HOME/git/config file Huynh Khoi Nguyen NGUYEN
2012-06-04 21:17           ` Matthieu Moy
2012-06-05 13:04             ` nguyenhu
2012-06-06 13:21         ` [PATCHv6 1/4] Read (but not write) from " Huynh Khoi Nguyen NGUYEN
2012-06-06 13:21           ` [PATCHv6 2/4] Let core.excludesfile default to $XDG_CONFIG_HOME/git/ignore Huynh Khoi Nguyen NGUYEN
2012-06-07 23:31             ` Junio C Hamano
2012-06-08  8:47               ` Matthieu Moy
2012-06-08  9:02               ` nguyenhu
2012-06-06 13:21           ` [PATCHv6 3/4] Let core.attributesfile default to $XDG_CONFIG_HOME/git/attributes Huynh Khoi Nguyen NGUYEN
2012-06-06 13:21           ` [PATCHv6 4/4] Write to $XDG_CONFIG_HOME/git/config file Huynh Khoi Nguyen NGUYEN
2012-06-09  3:48             ` David Aguilar
2012-06-09  6:19               ` Junio C Hamano
2012-06-09 17:25                 ` David Aguilar
2012-06-10 13:21                 ` Matthieu Moy
2012-06-11 23:45                   ` nguyenhu
2012-06-07 22:58           ` [PATCHv6 1/4] Read (but not write) from " Junio C Hamano
2012-06-08  9:57             ` nguyenhu
2012-06-12 17:42               ` Ramsay Jones
2012-06-08 12:26             ` nguyenhu
2012-06-08 12:33               ` Erik Faye-Lund
2012-06-08 12:54                 ` nguyenhu
2012-06-08 12:57                   ` Erik Faye-Lund
2012-06-08 15:08               ` Junio C Hamano
2012-06-09 10:53                 ` nguyenhu
2012-06-10  6:41                   ` Junio C Hamano
2012-06-10 13:48                     ` nguyenhu
2012-06-10 18:44                       ` Erik Faye-Lund
2012-06-10 20:02                         ` nguyenhu
2012-06-10 20:27                           ` Erik Faye-Lund
2012-06-11 15:50                         ` Junio C Hamano
2012-06-11 16:53                           ` nguyenhu
2012-06-11 22:59                             ` nguyenhu
2012-06-11 23:03                             ` Erik Faye-Lund
2012-06-12  2:49           ` [PATCHv7 " Huynh Khoi Nguyen Nguyen
2012-06-12  2:49             ` [PATCHv7 2/4] Let core.excludesfile default to $XDG_CONFIG_HOME/git/ignore Huynh Khoi Nguyen Nguyen
2012-06-12  2:49             ` [PATCHv7 3/4] Let core.attributesfile default to $XDG_CONFIG_HOME/git/attributes Huynh Khoi Nguyen Nguyen
2012-06-12  2:49             ` [PATCHv7 4/4] Write to $XDG_CONFIG_HOME/git/config file Huynh Khoi Nguyen Nguyen
2012-06-14 17:31             ` [PATCHv7 1/4] Read (but not write) from " Ramsay Jones
2012-06-21 16:55             ` Matthieu Moy
2012-06-21 17:22               ` Junio C Hamano
2012-06-22  9:03                 ` [PATCH 0/4 v8] Git configuration directory Matthieu Moy
2012-06-22  9:03                   ` [PATCH 1/4 v8] config: read (but not write) from $XDG_CONFIG_HOME/git/config file Matthieu Moy
2012-07-12  7:55                     ` Thomas Rast
2012-07-12 12:04                       ` [PATCH] config: fix several access(NULL) calls Matthieu Moy
2012-07-12 12:39                         ` Thomas Rast
2012-07-12 17:14                         ` Junio C Hamano
2012-07-12 19:34                           ` Matthieu Moy
2012-07-12 20:12                             ` Junio C Hamano
2012-07-13  8:48                               ` Matthieu Moy
2012-07-13  8:59                                 ` [PATCH v2] " Matthieu Moy
2012-07-13 13:00                                 ` [PATCH] " Jeff King
2012-07-13 13:15                                   ` Matthieu Moy
2012-07-13 14:05                                     ` Thomas Rast
2012-07-13 14:23                                       ` Matthieu Moy
2012-07-13 16:49                                         ` Junio C Hamano
2012-07-16  9:45                                           ` Matthieu Moy
2012-07-16 16:35                                             ` Junio C Hamano
2012-07-16 16:39                                               ` Matthieu Moy
2012-07-16 16:56                                                 ` Junio C Hamano
2012-06-22  9:03                   ` [PATCH 2/4 v8] Let core.excludesfile default to $XDG_CONFIG_HOME/git/ignore Matthieu Moy
2012-06-22  9:03                   ` [PATCH 3/4 v8] Let core.attributesfile " Matthieu Moy
2012-06-22 21:20                     ` Junio C Hamano
2012-06-25  6:32                       ` Matthieu Moy
2012-06-25  7:22                         ` Junio C Hamano
2012-06-25  7:56                           ` Matthieu Moy
2012-06-22  9:03                   ` [PATCH 4/4 v8] config: write to $XDG_CONFIG_HOME/git/config file if appropriate Matthieu Moy
2012-06-22 21:20                     ` Junio C Hamano
2012-06-25  6:45                       ` Matthieu Moy
2012-06-25 18:08                         ` Junio C Hamano
2012-06-22 21:19                   ` [PATCH 0/4 v8] Git configuration directory Junio C Hamano
2012-06-04 17:54       ` [PATCHv4] Read (but not write) from XDG configuration, XDG attributes and XDG ignore files Ramsay Jones
2012-06-04 18:41         ` Junio C Hamano
2012-06-12 17:32           ` Ramsay Jones
2012-06-05 12:19         ` nguyenhu
2012-05-31  8:46 [PATCHv2] Possibility to read both from ~/.gitconfig and from $XDG_CONFIG_HOME/git/config nguyenhu
2012-06-01 19:49 nguyenhu
2012-06-04 17:27 ` Ramsay Jones

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.