Re: [PATCH 2/2] sequencer.c: plug mem leak in git_sequencer_config

2018-06-03 Thread Junio C Hamano
Stefan Beller writes: > Signed-off-by: Stefan Beller > --- > sequencer.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/sequencer.c b/sequencer.c > index b98690ecd41..aba03e9429a 100644 > --- a/sequencer.c > +++ b/sequencer.c > @@ -175,6 +175,7 @@ static int

Re: [PATCH] Use ZSH_NAME instead of ZSH_VERSION because it's redefined by git-completion.zsh

2018-06-03 Thread Junio C Hamano
Rick van Hattem writes: > The `git-completion.zsh` unsets the `$ZSH_VERSION` which makes this check > moot. The result (at least for me) is that zsh segfaults because of all the > variables it's unsetting. > --- Overlong line, lack of sign-off. > # Clear the variables caching builtins'

Re: [PATCH] update-ref --stdin: use skip_prefix()

2018-06-03 Thread Jeff King
On Sun, Jun 03, 2018 at 04:36:51PM +0200, SZEDER Gábor wrote: > Use skip_prefix() instead of starts_with() and strcmp() when parsing > 'git update-ref's stdin to avoid a couple of magic numbers. I was coincidentally looking at this the other day also noticed these. Thanks for cleaning it up (and

Re: [PATCH 2/2] sequencer.c: plug mem leak in git_sequencer_config

2018-06-03 Thread Jeff King
On Mon, Jun 04, 2018 at 12:44:15PM +0900, Junio C Hamano wrote: > >> diff --git a/sequencer.c b/sequencer.c > >> index b98690ecd41..aba03e9429a 100644 > >> --- a/sequencer.c > >> +++ b/sequencer.c > >> @@ -175,6 +175,7 @@ static int git_sequencer_config(const char *k, const > >> char *v, void

Re: [PATCH 2/2] sequencer.c: plug mem leak in git_sequencer_config

2018-06-03 Thread Jeff King
On Mon, Jun 04, 2018 at 01:26:57PM +0900, Junio C Hamano wrote: > > Doing it "right" in C would probably involve two variables: > > > > const char *some_var = "default"; > > const char *some_var_storage = NULL; > > > > int git_config_string_smart(const char **ptr, char **storage, > >

Re: [RFC PATCH 4/6] commit-graph: avoid writing when repo is shallow

2018-06-03 Thread Junio C Hamano
Derrick Stolee writes: >>> several reasons. Instead of doing the hard thing to fix those >>> interactions, instead prevent reading or writing a commit-graph file for >>> shallow repositories. >> The latter instead would want to vanish, I would guess. > > Do you mean that we should call

Re: [RFC PATCH 4/7] merge-recursive: fix assumption that head tree being merged is HEAD

2018-06-03 Thread Ramsay Jones
On 04/06/18 00:37, brian m. carlson wrote: > On Sun, Jun 03, 2018 at 02:52:12PM +0100, Ramsay Jones wrote: >> On 03/06/18 07:58, Elijah Newren wrote: >>> I'm really unsure where the index_has_changes() declaration should go; >>> I stuck it in tree.h, but is there a better spot? >> >> Err, leave

Re: [PATCH 2/2] sequencer.c: plug mem leak in git_sequencer_config

2018-06-03 Thread Jeff King
On Sun, Jun 03, 2018 at 11:56:37PM -0400, Jeff King wrote: > So sometimes some_var needs to be freed and sometimes not (and every one > of those uses is a potential leak, but it's OK because they're all > program-lifetime globals anyway, and people don't _tend_ to set the same > option over and

Re: [PATCH v7 1/2] http-backend: respect CONTENT_LENGTH as specified by rfc3875

2018-06-03 Thread Jeff King
On Sun, Jun 03, 2018 at 12:27:48AM +0300, Max Kirillov wrote: > http-backend reads whole input until EOF. However, the RFC 3875 specifies > that a script must read only as many bytes as specified by CONTENT_LENGTH > environment variable. Web server may exercise the specification by not closing >

Re: [PATCH 2/2] sequencer.c: plug mem leak in git_sequencer_config

2018-06-03 Thread Junio C Hamano
Jeff King writes: > With that strategy, we'd have to have a big initialize_defaults() > function. Which actually might not be _too_ bad since we now have > common-main.c, but: > > - it sucks to keep the default values far away from the declarations > > - it does carry a runtime cost. Not a

<    1   2