Re: [PATCH] Feature: custom guitool commands can now have custom keyboard shortcuts

2016-03-31 Thread harish k
Hi David, Actually Im a TCL primer. This is the first time Im dealing with. That is why I kept it simple ( ie both accel-key and accel-label need to be defined in config ). I think, git-cola is using Qt style representation accel-key in the config file. Is git-cola is an official tool from git

Re: git alias quoting help

2016-03-31 Thread shawn wilson
FWIW, I (finally) found two projects that like they'll do what I want: git-splits and git_filter The later was lacking in documentation and after the build I couldn't figure it out at a glance and I think git-splits will DWIW. On Thu, Mar 31, 2016 at 10:27 AM, shawn wilson wrote: > BTW, just tryi

RPM spec file broken by README.md

2016-03-31 Thread Ron Isaacson
Hi everyone, I've noticed that "make rpm" is failing for 2.8.0 because README was replaced with README.md. This line in git.spec is the culprit: %doc README COPYING Documentation/*.txt Would it be possible to change this to README.md to match the source tree? The rpm packages build just fine wit

Re: [PATCH v2 3/4] format-patch: introduce --base=auto option

2016-03-31 Thread Ye Xiaolong
On Thu, Mar 24, 2016 at 10:01:58AM -0700, Junio C Hamano wrote: >Ye Xiaolong writes: > >> On Wed, Mar 23, 2016 at 11:25:41AM -0700, Junio C Hamano wrote: >>>I also do not see the point of showing "parent id" which as far as I >>>can see is just a random commit object name and show different >>>out

Re: [PATCH v2] clone: respect configured fetch respecs during initial fetch

2016-03-31 Thread SZEDER Gábor
Quoting Junio C Hamano : SZEDER Gábor writes: Quoting Junio C Hamano : IOW, special casing -c remote.origin.fetch=spec is a bad idea. I completely agree :) But it's the other way around. 'remote.origin.fetch=spec' during clone is special _now_, because the initial fetch ignores it, no m

Re: [PATCH 00/21] replacement for dt/refs-backend-lmdb v7 patch 04/33

2016-03-31 Thread Stefan Beller
On Wed, Mar 30, 2016 at 1:05 PM, David Turner wrote: > On Wed, 2016-03-30 at 08:37 +0200, Michael Haggerty wrote: >> On 03/29/2016 10:12 PM, David Turner wrote: >> > On Sun, 2016-03-27 at 07:22 +0200, Michael Haggerty wrote: >> > > On 03/24/2016 07:47 AM, David Turner wrote: >> > > > [...] >> > >

GIT_CONFIG - what's the point?

2016-03-31 Thread Matthew Persico
Greetings. Given the GIT_CONFIG environment variable can change 'git config' behaves, it stands to reason that if GIT_CONFIG is defined, then ALL git commands obey the value of GIT_CONFIG and use that file for config info. As a test, exported GIT_CONFIG=/tmp/ohm, copied ~/.gitconfig to /tmp/ohm,

Re: `git rev-parse --is-inside-work-tree` and $GIT_WORK_TREE

2016-03-31 Thread Elliott Cable
oh, wow, this got over my head *real* fast. Okay, 1. Yeah, my `$GIT_WORK_TREE` was def. an absolute path; I typed that example code without running it *precisely* that way (entirely my mistake! I'm so sorry for the confusion it caused, and all that typing you did!); if I remember correctly (not at

Re: [PATCHv4 1/4] notes: don't leak memory in git_config_get_notes_strategy

2016-03-31 Thread Eric Sunshine
On Thu, Mar 31, 2016 at 8:35 PM, Stefan Beller wrote: > `value` is just a temporary scratchpad, so we need to make sure it doesn't > leak. It is xstrdup'd in `git_config_get_string_const` and > `parse_notes_merge_strategy` just compares the string against predefined > values, so no need to keep it

[PATCHv4 4/4] credential-cache, send_request: close fd when done

2016-03-31 Thread Stefan Beller
No need to keep it open any further. Signed-off-by: Stefan Beller --- credential-cache.c | 1 + 1 file changed, 1 insertion(+) diff --git a/credential-cache.c b/credential-cache.c index f4afdc6..86e21de 100644 --- a/credential-cache.c +++ b/credential-cache.c @@ -32,6 +32,7 @@ static int send_r

[PATCHv4 2/4] abbrev_sha1_in_line: don't leak memory

2016-03-31 Thread Stefan Beller
`split` is of type `struct strbuf **`, and currently we are leaking split itself as well as each element in split[i]. We have a dedicated free function for `struct strbuf **`, which takes care of freeing all related memory. Helped-by: Eric Sunshine Signed-off-by: Stefan Beller --- wt-status.c |

[PATCHv4 3/4] bundle: don't leak an fd in case of early return

2016-03-31 Thread Stefan Beller
In successful operation `write_pack_data` will close the `bundle_fd`, but when we exit early, we need to take care of the file descriptor as well as the lock file ourselves. The lock file may be deleted at the end of running the program, but we are in library code, so we should not rely on that. H

[PATCHv4 1/4] notes: don't leak memory in git_config_get_notes_strategy

2016-03-31 Thread Stefan Beller
`value` is just a temporary scratchpad, so we need to make sure it doesn't leak. It is xstrdup'd in `git_config_get_string_const` and `parse_notes_merge_strategy` just compares the string against predefined values, so no need to keep it around longer. Signed-off-by: Stefan Beller --- builtin/not

[PATCHv4 0/4] Some cleanups

2016-03-31 Thread Stefan Beller
Thanks for the reviews! Thanks Jeff, Eric, Junio! This replaces sb/misc-cleanups. * Revert the builtin/notes fix to the first version as git_config_get_value is dangerous, and the memory allocation and free is just a small overhead here * the bundle code integrates all of the suggestions (i.e.

Re: [PATCH v2] clone: respect configured fetch respecs during initial fetch

2016-03-31 Thread SZEDER Gábor
Quoting Junio C Hamano : SZEDER Gábor writes: Conceptually 'git clone' should behave as if the following commands were run: git init git config ... # set default configuration and origin remote git fetch git checkout # unless '--bare' is given However, that initial 'git fetch' be

Re: [PATCHv2 3/4] bundle: don't leak an fd in case of early return

2016-03-31 Thread Stefan Beller
On Thu, Mar 31, 2016 at 12:00 PM, Philip Oakley wrote: > From: "Stefan Beller" >> >> In successful operation `write_pack_data` will close the `bundle_fd`, >> but when we exit early, we need to take care of the file descriptor >> as well as the lock file ourselves. The lock file may be deleted at

[PATCH 2/2] submodule--helper, module_clone: catch fprintf failure

2016-03-31 Thread Stefan Beller
The return value of fprintf is unchecked, which may lead to unreported errors. Use fprintf_or_die to report the error to the user. Signed-off-by: Stefan Beller --- builtin/submodule--helper.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/builtin/submodule--helper.c b/bu

[PATCH 1/2] submodule--helper, module_clone: always operate on absolute paths

2016-03-31 Thread Stefan Beller
When giving relative paths to `relative_path` to compute a relative path from one directory to another, this may fail in `relative_path`. Make sure both arguments to `relative_path` are always absolute. Signed-off-by: Stefan Beller --- builtin/submodule--helper.c | 28 ++-

[PATCHv3 0/2] Fix relative path issues in recursive submodules.

2016-03-31 Thread Stefan Beller
Thanks Junio for review! v3: * This is a resend of the last two patches of the series, i.e. it replaces 44859d6626d4 and efdef1e2e in sb/submodule-helper-clone-regression-fix * use absolute_path for sm_gitdir * removed todo * we need to free the intermediate sm_gitdir, so rename that to

Re: [PATCH] builtin/apply: free patch when parse_chunk() fails

2016-03-31 Thread Christian Couder
On Fri, Apr 1, 2016 at 12:56 AM, Junio C Hamano wrote: > Christian Couder writes: > >> On Wed, Mar 16, 2016 at 3:35 PM, Christian Couder >> wrote: >>> When parse_chunk() fails it can return -1, for example >>> when find_header() doesn't find a patch header. >>> >>> In this case it's better in ap

Re: [PATCHv3 1/4] notes: don't leak memory in git_config_get_notes_strategy

2016-03-31 Thread Jeff King
On Thu, Mar 31, 2016 at 05:08:30PM -0400, Eric Sunshine wrote: > On Thu, Mar 31, 2016 at 2:04 PM, Stefan Beller wrote: > > `value` is just a temporary scratchpad, so we need to make sure it doesn't > > leak. It is xstrdup'd in `git_config_get_string_const` and > > `parse_notes_merge_strategy` jus

Re: [PATCH v4] git-send-pack: fix --all option when used with directory

2016-03-31 Thread Jeff King
On Thu, Mar 31, 2016 at 03:02:43PM -0700, Junio C Hamano wrote: > By the way, for some reason it was unusually painful to find the > exact breakage by bisecting between maint-2.4 and maint-2.6. It > somehow ended up on fingering random places like v2.6.0 itself. > > The true culprit is 068c77a5

Re: [PATCHv2 4/5] submodule--helper, module_clone: always operate on absolute paths

2016-03-31 Thread Stefan Beller
On Thu, Mar 31, 2016 at 3:59 PM, Stefan Beller wrote: > > Further checking reveals any caller uses it with > > desired= xstrdup(absolute_path(my_argument)); > > We are loosing memory of the strbuf here. so if I we'd > take the diff above we can also get rid of all the xstrdups > at the callers

Re: [PATCHv2 4/5] submodule--helper, module_clone: always operate on absolute paths

2016-03-31 Thread Stefan Beller
On Thu, Mar 31, 2016 at 3:26 PM, Junio C Hamano wrote: > Stefan Beller writes: > >> + if (!is_absolute_path(sm_gitdir)) { >> + char *cwd = xgetcwd(); >> + strbuf_addf(&sb, "%s/%s", cwd, sm_gitdir); >> + sm_gitdir = strbuf_detach(&sb, 0); >> + fr

Re: [PATCH] builtin/apply: free patch when parse_chunk() fails

2016-03-31 Thread Junio C Hamano
Christian Couder writes: > On Wed, Mar 16, 2016 at 3:35 PM, Christian Couder > wrote: >> When parse_chunk() fails it can return -1, for example >> when find_header() doesn't find a patch header. >> >> In this case it's better in apply_patch() to free the >> "struct patch" that we just allocated

Re: [PATCH v4] git-send-pack: fix --all option when used with directory

2016-03-31 Thread Eric Sunshine
On Thu, Mar 31, 2016 at 6:02 PM, Junio C Hamano wrote: > By the way, for some reason it was unusually painful to find the > exact breakage by bisecting between maint-2.4 and maint-2.6. It > somehow ended up on fingering random places like v2.6.0 itself. > > The true culprit is 068c77a5 (builtin/s

Re: [PATCHv3 1/4] notes: don't leak memory in git_config_get_notes_strategy

2016-03-31 Thread Junio C Hamano
Eric Sunshine writes: > On Thu, Mar 31, 2016 at 2:04 PM, Stefan Beller wrote: >> `value` is just a temporary scratchpad, so we need to make sure it doesn't >> leak. It is xstrdup'd in `git_config_get_string_const` and >> `parse_notes_merge_strategy` just compares the string against predefined >>

Re: [PATCH v2] clone: respect configured fetch respecs during initial fetch

2016-03-31 Thread Junio C Hamano
SZEDER Gábor writes: > Quoting Junio C Hamano : > >> IOW, special casing -c remote.origin.fetch=spec >> is a bad idea. > > I completely agree :) > But it's the other way around. > > 'remote.origin.fetch=spec' during clone is special _now_, because the > initial fetch ignores it, no matter where i

Re: [PATCH] builtin/apply: free patch when parse_chunk() fails

2016-03-31 Thread Christian Couder
On Wed, Mar 16, 2016 at 3:35 PM, Christian Couder wrote: > When parse_chunk() fails it can return -1, for example > when find_header() doesn't find a patch header. > > In this case it's better in apply_patch() to free the > "struct patch" that we just allocated instead of > leaking it. Maybe this

Re: [PATCH v3] builtin/apply: handle parse_binary() failure

2016-03-31 Thread Christian Couder
On Fri, Mar 18, 2016 at 1:30 PM, Christian Couder wrote: > In parse_binary() there is: > > forward = parse_binary_hunk(&buffer, &size, &status, &used); > if (!forward && !status) > /* there has to be one hunk (forward hunk) */ > return error(_("unrec

Re: [PATCHv2 4/5] submodule--helper, module_clone: always operate on absolute paths

2016-03-31 Thread Junio C Hamano
Stefan Beller writes: > + if (!is_absolute_path(sm_gitdir)) { > + char *cwd = xgetcwd(); > + strbuf_addf(&sb, "%s/%s", cwd, sm_gitdir); > + sm_gitdir = strbuf_detach(&sb, 0); > + free(cwd); It would be surprising that this would be the first co

Re: [PATCH 00/21] replacement for dt/refs-backend-lmdb v7 patch 04/33

2016-03-31 Thread David Turner
On Thu, 2016-03-31 at 18:14 +0200, Michael Haggerty wrote: > On 03/30/2016 10:05 PM, David Turner wrote: > > On Wed, 2016-03-30 at 08:37 +0200, Michael Haggerty wrote: > > > On 03/29/2016 10:12 PM, David Turner wrote: > > > > On Sun, 2016-03-27 at 07:22 +0200, Michael Haggerty wrote: > > > > > On 0

Re: [PATCHv2 3/5] submodule--helper clone: remove double path checking

2016-03-31 Thread Junio C Hamano
Eric Sunshine writes: > On Thu, Mar 31, 2016 at 5:04 PM, Stefan Beller wrote: >> submodule--helper clone: remove double path checking > > I think Junio mentioned in v1 that calling this "path checking" is misleading. I'd tentatively use: "submodule--helper clone: create the submodule path

Re: [PATCH v4] git-send-pack: fix --all option when used with directory

2016-03-31 Thread Junio C Hamano
Junio C Hamano writes: > stanis...@assembla.com writes: > >> From: Stanislav Kolotinskiy >> >> When using git send-pack with --all option >> and a target repository specification ([:]), >> usage message is being displayed instead of performing >> the actual transmission. >> >> The reason for thi

Re: [PATCHv2 3/5] submodule--helper clone: remove double path checking

2016-03-31 Thread Eric Sunshine
On Thu, Mar 31, 2016 at 5:04 PM, Stefan Beller wrote: > submodule--helper clone: remove double path checking I think Junio mentioned in v1 that calling this "path checking" is misleading. > We make sure that the parent directory of path exists (or create it > otherwise) and then do the same for

Re: [PATCHv2 2/5] submodule--helper clone: simplify path check

2016-03-31 Thread Eric Sunshine
On Thu, Mar 31, 2016 at 5:04 PM, Stefan Beller wrote: > submodule--helper clone: simplify path check I don't see anything in the patch which simplifies a path check. Instead, this version of the patch is now fixing a potential NULL-dereference. > The calling shell code makes sure that `path` is

Re: [PATCHv3 1/4] notes: don't leak memory in git_config_get_notes_strategy

2016-03-31 Thread Eric Sunshine
On Thu, Mar 31, 2016 at 2:04 PM, Stefan Beller wrote: > `value` is just a temporary scratchpad, so we need to make sure it doesn't > leak. It is xstrdup'd in `git_config_get_string_const` and > `parse_notes_merge_strategy` just compares the string against predefined > values, so no need to keep it

[PATCHv2 5/5] submodule--helper, module_clone: catch fprintf failure

2016-03-31 Thread Stefan Beller
The return value of fprintf is unchecked, which may lead to unreported errors. Use fprintf_or_die to report the error to the user. Signed-off-by: Stefan Beller --- builtin/submodule--helper.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/builtin/submodule--helper.c b/bu

[PATCHv2 2/5] submodule--helper clone: simplify path check

2016-03-31 Thread Stefan Beller
The calling shell code makes sure that `path` is non null and non empty. Side note: it cannot be null as just three lines before it is passed to safe_create_leading_directories_const which would crash as you feed it null. That means the `else` part is dead code, so remove it. To make the code futu

[PATCHv2 1/5] recursive submodules: test for relative paths

2016-03-31 Thread Stefan Beller
"git submodule update --init --recursive" uses full path to refer to the true location of the repository in the "gitdir:" pointer for nested submodules; the command used to use relative paths. This was reported by Norio Nomura in $gmane/290280. The root cause for that bug is in using recursive su

[PATCHv2 0/5] Fix relative path issues in recursive submodules.

2016-03-31 Thread Stefan Beller
Thanks Junio, Eric and Jacob for review! v2: * reworded commit message for test (Thanks Junio!) * instead of "simplifying" the path handling in patch 2, we are prepared for anything the user throws at us (i.e. instead of segfault we die(_("submodule--helper: unspecified or empty --path

[PATCHv2 4/5] submodule--helper, module_clone: always operate on absolute paths

2016-03-31 Thread Stefan Beller
When giving relative paths to `relative_path` to compute a relative path from one directory to another, this may fail in `relative_path`. Make sure both arguments to `relative_path` are always absolute. Signed-off-by: Stefan Beller --- Notes: Notice how the 2 relative path calls relati

[PATCHv2 3/5] submodule--helper clone: remove double path checking

2016-03-31 Thread Stefan Beller
We make sure that the parent directory of path exists (or create it otherwise) and then do the same for path + "/.git". That is equivalent to just making sure that the parent directory of path + "/.git" exists (or create it otherwise). Signed-off-by: Stefan Beller --- builtin/submodule--helper.

Re: [PATCH v2] clone: respect configured fetch respecs during initial fetch

2016-03-31 Thread SZEDER Gábor
Quoting Junio C Hamano : IOW, special casing -c remote.origin.fetch=spec is a bad idea. I completely agree :) But it's the other way around. 'remote.origin.fetch=spec' during clone is special _now_, because the initial fetch ignores it, no matter where it is set. My patch makes it non-speci

Re: [PATCH v11 2/4] parse-options.c: make OPTION_COUNTUP respect "unspecified" values

2016-03-31 Thread Junio C Hamano
Pranit Bauva writes: > Also, when such an idea for new feature comes up, it is better to > implement it because let's say some developer is stuck in future and > this new feature could help him but he doesn't have a clue that such a > discussion happened some time ago. Thus saving him time and fu

Re: [PATCH v11 2/4] parse-options.c: make OPTION_COUNTUP respect "unspecified" values

2016-03-31 Thread Pranit Bauva
On Fri, Apr 1, 2016 at 1:36 AM, Junio C Hamano wrote: > Pranit Bauva writes: > >> On Fri, Apr 1, 2016 at 12:11 AM, Junio C Hamano wrote: >>> >>> case OPTION_COUNTUP: >>> + if (*(int *)opt->value < 0) >>> + *(int *)opt->value = 0; >>> *(

Re: BUG in git diff-index

2016-03-31 Thread Junio C Hamano
Andy Lowry writes: > So I think now that the script should do "update-index --refresh" > followed by "diff-index --quiet HEAD". Sound correct? Yes. That has always been one of the kosher ways for any script to make sure that the files in the working tree that are tracked have not been modified

Re: [PATCH v4] git-send-pack: fix --all option when used with directory

2016-03-31 Thread Junio C Hamano
stanis...@assembla.com writes: > From: Stanislav Kolotinskiy > > When using git send-pack with --all option > and a target repository specification ([:]), > usage message is being displayed instead of performing > the actual transmission. > > The reason for this issue is that destination and refs

Re: RFC: New reference iteration paradigm

2016-03-31 Thread David Turner
On Thu, 2016-03-31 at 18:13 +0200, Michael Haggerty wrote: > Currently the way to iterate over references is via a family of > for_each_ref()-style functions. You pass some arguments plus a > callback > function and cb_data to the function, and your callback is called for > each reference that is s

Re: [PATCHv3 0/4] Some cleanups

2016-03-31 Thread Junio C Hamano
Jeff King writes: > Well, by polish up, I meant "write a commit message for". :) > > The patch itself looked fine to me. I'll throw it in my "leftover bits" list. After queuing 2/4, it now needs a trivial adjustment to the patch text, which would be a good spice for a new contributor who is loo

Re: RFC: New reference iteration paradigm

2016-03-31 Thread Junio C Hamano
Jeff King writes: > On Thu, Mar 31, 2016 at 11:01:44AM -0700, Junio C Hamano wrote: > >> Michael Haggerty writes: >> >> > the backend now has to implement >> > >> >> struct ref_iterator *ref_iterator_begin_fn(const char *submodule, >> >>const char *pr

Re: [PATCH v11 2/4] parse-options.c: make OPTION_COUNTUP respect "unspecified" values

2016-03-31 Thread Junio C Hamano
Pranit Bauva writes: > On Fri, Apr 1, 2016 at 12:11 AM, Junio C Hamano wrote: >> >> case OPTION_COUNTUP: >> + if (*(int *)opt->value < 0) >> + *(int *)opt->value = 0; >> *(int *)opt->value = unset ? 0 : *(int *)opt->value + 1; >> >> Tha

Re: [PATCHv3 0/4] Some cleanups

2016-03-31 Thread Jeff King
On Thu, Mar 31, 2016 at 12:31:34PM -0700, Junio C Hamano wrote: > Jeff King writes: > > > With the exception of the comments on patch 3, these all look good. I'll > > leave it to Junio to decide whether he wants to polish up his "get rid > > of strbuf_split" patch for patch 2. Certainly yours is

Re: [PATCH v11 2/4] parse-options.c: make OPTION_COUNTUP respect "unspecified" values

2016-03-31 Thread Pranit Bauva
On Fri, Apr 1, 2016 at 12:11 AM, Junio C Hamano wrote: > Pranit Bauva writes: > >> This change will not affect existing users of COUNTUP at all, as long as >> they use the initial value of 0 (or more). >> >> Force uses the "unspecified" value in conjunction with OPT__FORCE in >> builtin/clean.c i

Re: RFC: New reference iteration paradigm

2016-03-31 Thread Jeff King
On Thu, Mar 31, 2016 at 11:01:44AM -0700, Junio C Hamano wrote: > Michael Haggerty writes: > > > the backend now has to implement > > > >> struct ref_iterator *ref_iterator_begin_fn(const char *submodule, > >>const char *prefix, > >>

Re: [PATCHv3 0/4] Some cleanups

2016-03-31 Thread Junio C Hamano
Jeff King writes: > With the exception of the comments on patch 3, these all look good. I'll > leave it to Junio to decide whether he wants to polish up his "get rid > of strbuf_split" patch for patch 2. Certainly yours is a strict > improvement over what is there. I do not think there were anyt

Re: BUG in git diff-index

2016-03-31 Thread Andy Lowry
OK, great. I think the update-index command is what I need. If you'll indulge me, I'll describe my use-case in detail, and if you see anything screwy about it, I'd appreciate feedback. But don't feel obligated - you've been a great help already. This is all about publishing updates to a stati

Re: [PATCH v3][Outreachy] branch -D: allow - as abbreviation of @{-1}

2016-03-31 Thread Junio C Hamano
Elena Petrashen writes: > @@ -214,6 +221,9 @@ static int delete_branches(int argc, const char **argv, > int force, int kinds, > const char *target; > int flags = 0; > > + expand_dash_shortcut (argv, i); > + if(!strncmp(argv[i], "@{-", strlen(

Re: [PATCH 4/4] submodule--helper: use relative path if possible

2016-03-31 Thread Stefan Beller
On Thu, Mar 31, 2016 at 9:59 AM, Junio C Hamano wrote: > Stefan Beller writes: > >> As submodules have working directory and their git directory far apart >> relative_path(gitdir, work_dir) will not produce a relative path when >> git_dir is absolute. When the gitdir is absolute, we need to conve

Re: [PATCHv3 0/4] Some cleanups

2016-03-31 Thread Jeff King
On Thu, Mar 31, 2016 at 11:04:02AM -0700, Stefan Beller wrote: > v3: > Thanks Eric, Jeff, Junio for discussion! > * use git_config_get_value instead of git_config_get_string in patch 1 > * Improve commit message to explain why strbuf_list_free frees more memory > (hence is the right thing to do)

Re: [PATCHv3 3/4] bundle: don't leak an fd in case of early return

2016-03-31 Thread Jeff King
On Thu, Mar 31, 2016 at 11:04:05AM -0700, Stefan Beller wrote: > diff --git a/bundle.c b/bundle.c > index 506ac49..31ae1da 100644 > --- a/bundle.c > +++ b/bundle.c > @@ -435,12 +435,14 @@ int create_bundle(struct bundle_header *header, const > char *path, > > /* write prerequisites */ >

Re: [PATCHv2 3/4] bundle: don't leak an fd in case of early return

2016-03-31 Thread Philip Oakley
From: "Stefan Beller" In successful operation `write_pack_data` will close the `bundle_fd`, but when we exit early, we need to take care of the file descriptor as well as the lock file ourselves. The lock file may be deleted at the end of running the program, but we are in library code, so we sh

Re: Problem with Integrated Vim Editor on Win 10

2016-03-31 Thread Junio C Hamano
Zachary Turner writes: > I'm not terribly active in the Git community so I don't know what the > procedure is for things like this, but this seems like a fairly > serious regression. Suggestions on how to proceed? While the git-for-windows folks do read this list, git-for-windows specific issue

Re: [PATCH v2] clone: respect configured fetch respecs during initial fetch

2016-03-31 Thread Junio C Hamano
Junio C Hamano writes: > Is the expectation like this? > > git init > git config ... # set default configuration and origin remote > git config var val # update with what "-c var=val" told us > git fetch > git checkout # unless '--bare' is given > > or is it something else?

[PATCH] t6302: fix up expect files for tests 34-36

2016-03-31 Thread Ramsay Jones
Signed-off-by: Ramsay Jones --- Hi Karthik, If you need to re-roll the patches in your 'kn/ref-filter-branch-list' branch, could you please squash this into the relevant patch (which would be equivalent to commit 86cd4d32, "ref-filter: implement %(if), %(then), and %(else) atoms", 30-03-2016).

Re: Problem with Integrated Vim Editor on Win 10

2016-03-31 Thread Philip Oakley
From: "Zachary Turner" I dug into this some more, and as surprising as it is, I believe the release of Git 2.8.0 is just busted. I had an installer for 2.7.0 lying around, so after uninstalling 2.8.0 and re-installing 2.7.0, everything works fine. I'm not terribly active in the Git community s

Re: [PATCH v11 3/4] t7507-commit-verbose: improve test coverage by testing number of diffs

2016-03-31 Thread Pranit Bauva
On Thu, Mar 31, 2016 at 11:53 PM, Junio C Hamano wrote: > Pranit Bauva writes: > >> Make the fake "editor" store output of grep in a file so that we can >> see how many diffs were contained in the message and use them in >> individual tests where ever it is required. Also use write_script() >> to

Re: [PATCH v11 2/4] parse-options.c: make OPTION_COUNTUP respect "unspecified" values

2016-03-31 Thread Junio C Hamano
Pranit Bauva writes: > This change will not affect existing users of COUNTUP at all, as long as > they use the initial value of 0 (or more). > > Force uses the "unspecified" value in conjunction with OPT__FORCE in > builtin/clean.c in a different way to handle its config which > munges the "-1" i

Re: [PATCH v11 1/4] test-parse-options: print quiet as integer

2016-03-31 Thread Pranit Bauva
On Thu, Mar 31, 2016 at 11:49 PM, Junio C Hamano wrote: > Pranit Bauva writes: > >> Current implementation of parse-options.c treats OPT__QUIET() as integer >> and not boolean and thus it is more appropriate to print it as integer >> to avoid confusion. >> >> While at it, fix some style issues. >

Re: [PATCH v11 3/4] t7507-commit-verbose: improve test coverage by testing number of diffs

2016-03-31 Thread Junio C Hamano
Pranit Bauva writes: > Make the fake "editor" store output of grep in a file so that we can > see how many diffs were contained in the message and use them in > individual tests where ever it is required. Also use write_script() > to create the fake "editor". > > A subsequent commit will introduc

Re: [PATCH v11 1/4] test-parse-options: print quiet as integer

2016-03-31 Thread Junio C Hamano
Pranit Bauva writes: > Current implementation of parse-options.c treats OPT__QUIET() as integer > and not boolean and thus it is more appropriate to print it as integer > to avoid confusion. > > While at it, fix some style issues. I counted the changes in t0040 and you have _more_ style fixes th

[PATCHv3 0/4] Some cleanups

2016-03-31 Thread Stefan Beller
v3: Thanks Eric, Jeff, Junio for discussion! * use git_config_get_value instead of git_config_get_string in patch 1 * Improve commit message to explain why strbuf_list_free frees more memory (hence is the right thing to do) * the bundle code doesn't have a dedicated return variable, but the err

[PATCHv3 1/4] notes: don't leak memory in git_config_get_notes_strategy

2016-03-31 Thread Stefan Beller
`value` is just a temporary scratchpad, so we need to make sure it doesn't leak. It is xstrdup'd in `git_config_get_string_const` and `parse_notes_merge_strategy` just compares the string against predefined values, so no need to keep it around longer. Instead of using `git_config_get_string_const`,

[PATCHv3 2/4] abbrev_sha1_in_line: don't leak memory

2016-03-31 Thread Stefan Beller
`split` is of type `struct strbuf **`, and currently we are leaking split itself as well as each element in split[i]. We have a dedicated free function for `struct strbuf **`, which takes care of freeing all related memory. Helped-by: Eric Sunshine Signed-off-by: Stefan Beller --- Notes: Fe

[PATCHv3 4/4] credential-cache, send_request: close fd when done

2016-03-31 Thread Stefan Beller
No need to keep it open any further. Signed-off-by: Stefan Beller --- credential-cache.c | 1 + 1 file changed, 1 insertion(+) diff --git a/credential-cache.c b/credential-cache.c index f4afdc6..86e21de 100644 --- a/credential-cache.c +++ b/credential-cache.c @@ -32,6 +32,7 @@ static int send_r

[PATCHv3 3/4] bundle: don't leak an fd in case of early return

2016-03-31 Thread Stefan Beller
In successful operation `write_pack_data` will close the `bundle_fd`, but when we exit early, we need to take care of the file descriptor as well as the lock file ourselves. The lock file may be deleted at the end of running the program, but we are in library code, so we should not rely on that. H

Re: RFC: New reference iteration paradigm

2016-03-31 Thread Junio C Hamano
Michael Haggerty writes: > the backend now has to implement > >> struct ref_iterator *ref_iterator_begin_fn(const char *submodule, >>const char *prefix, >>unsigned int flags); > > The ref_iterator itself has t

Re: [PATCHv2 3/4] bundle: don't leak an fd in case of early return

2016-03-31 Thread Stefan Beller
On Wed, Mar 30, 2016 at 10:41 AM, Eric Sunshine wrote: >> - else if (ref_count < 0) >> - return -1; >> + else if (ref_count < 0) { >> + if (!bundle_to_stdout) >> + close(bundle_fd); > > Why is this close() here considering that it gets

Re: [PATCH v3 0/4] Add an option to git-format-patch to record base tree info

2016-03-31 Thread Junio C Hamano
Xiaolong Ye writes: > V3 mainly improves the implementation according to Junio's comments, > Changes vs v2 include: > > - Remove the unnecessary output line "** base-commit-info **". > > - Improve the traverse logic to handle not only linear topology, but more >general cases, it will star

Re: [PATCH v3 3/4] format-patch: introduce --base=auto option

2016-03-31 Thread Junio C Hamano
Xiaolong Ye writes: > Introduce --base=auto to record the base commit info automatically, the > base_commit > will be the merge base of tip commit of the upstream branch and revision-range > specified in cmdline. This line is probably a bit too long. > > Helped-by: Junio C Hamano > Helped-by:

Re: [PATCH v3 2/4] format-patch: add '--base' option to record base tree info

2016-03-31 Thread Junio C Hamano
Xiaolong Ye writes: > Maintainers or third party testers may want to know the exact base tree > the patch series applies to. Teach git format-patch a '--base' option to > record the base tree info and append this information at the end of the > _first_ message (either the cover letter or the firs

Re: [RFC PATCH] gpg: add support for gpgsm

2016-03-31 Thread Jeff King
On Thu, Mar 31, 2016 at 06:08:06PM +0200, Carlos Martín Nieto wrote: > > I notice that you had to add GPGSM_MESSAGE string constant; does the > > current code without any change really work correctly if you set > > 'gpg.program' to gpgsm and do nothing else? > > It does work for verify-commit whi

Re: Signed-off-by vs Reviewed-by

2016-03-31 Thread Junio C Hamano
Jeff King writes: > On Thu, Mar 31, 2016 at 09:28:44AM -0700, Junio C Hamano wrote: > >> As to the last step of "integration", we cannot use short-and-sweet >> single letter options like '-s' (for sign-off) for each and every >> custom trailer different projects use for their own purpose (as >> t

Re: Signed-off-by vs Reviewed-by

2016-03-31 Thread Jeff King
On Thu, Mar 31, 2016 at 09:28:44AM -0700, Junio C Hamano wrote: > As to the last step of "integration", we cannot use short-and-sweet > single letter options like '-s' (for sign-off) for each and every > custom trailer different projects use for their own purpose (as > there are only 26 of the low

Re: Problem with Integrated Vim Editor on Win 10

2016-03-31 Thread Zachary Turner
I dug into this some more, and as surprising as it is, I believe the release of Git 2.8.0 is just busted. I had an installer for 2.7.0 lying around, so after uninstalling 2.8.0 and re-installing 2.7.0, everything works fine. I'm not terribly active in the Git community so I don't know what the pr

Re: [PATCH 0/4] Fix relative path issues in recursive submodules.

2016-03-31 Thread Stefan Beller
On Thu, Mar 31, 2016 at 10:04 AM, Junio C Hamano wrote: > Stefan Beller writes: > >> It took me longer than expected to fix this bug. >> >> It comes with a test and minor refactoring and applies on top of >> origin/sb/submodule-helper, such that it can be merged into 2.7, 2.8 as well >> as master

Re: [PATCH 2/4] submodule--helper clone: simplify path check

2016-03-31 Thread Stefan Beller
On Thu, Mar 31, 2016 at 12:31 AM, Eric Sunshine wrote: > On Wed, Mar 30, 2016 at 8:17 PM, Stefan Beller wrote: >> The calling shell code makes sure that `path` is non null and non empty. >> (side note: it cannot be null as just three lines before it is passed >> to safe_create_leading_directories

gitk and hook script

2016-03-31 Thread Romaric Crailox
Hello I want to deploy a hook script to control format of commit message. For this I use the prepare-commit-msg script. I want to check if the commit message starts with a number of 3 digits. If this is the case, the script returns 0, otherwise 1. It works fine for an utilisation with the git comm

Re: [PATCH 2/4] submodule--helper clone: simplify path check

2016-03-31 Thread Eric Sunshine
On Thu, Mar 31, 2016 at 12:36 PM, Junio C Hamano wrote: > Stefan Beller writes: > >> The calling shell code makes sure that `path` is non null and non empty. >> (side note: it cannot be null as just three lines before it is passed >> to safe_create_leading_directories_const which would crash as y

Re: [PATCH 0/4] Fix relative path issues in recursive submodules.

2016-03-31 Thread Junio C Hamano
Stefan Beller writes: > It took me longer than expected to fix this bug. > > It comes with a test and minor refactoring and applies on top of > origin/sb/submodule-helper, such that it can be merged into 2.7, 2.8 as well > as master. > > Patch 1 is a test which fails; it has a similar layout as t

Re: [PATCH 4/4] submodule--helper: use relative path if possible

2016-03-31 Thread Junio C Hamano
Stefan Beller writes: > As submodules have working directory and their git directory far apart > relative_path(gitdir, work_dir) will not produce a relative path when > git_dir is absolute. When the gitdir is absolute, we need to convert > the workdir to an absolute path as well to compute the re

Re: [PATCH] Feature: custom guitool commands can now have custom keyboard shortcuts

2016-03-31 Thread David Aguilar
On Tue, Mar 29, 2016 at 11:29:41AM +, Harish K wrote: > --- > git-gui/lib/tools.tcl | 16 +--- > 1 file changed, 13 insertions(+), 3 deletions(-) I forgot to mention that git-gui has its own repository. The git project merges the upstream repo as a subtree into its git-gui direct

Re: [PATCH 1/4] recursive submodules: test for relative paths

2016-03-31 Thread Stefan Beller
On Thu, Mar 31, 2016 at 9:33 AM, Junio C Hamano wrote: > Stefan Beller writes: > >> This was reported as a regression at $gmane/290280. The root cause for >> that bug is in using recursive submodules as their relative path handling >> seems to be broken in ee8838d (2015-09-08, submodule: rewrite

Re: [PATCH 3/4] submodule--helper clone: remove double path checking

2016-03-31 Thread Junio C Hamano
Stefan Beller writes: > Just a few lines after the deleted code we call > > safe_create_leading_directories_const(path + "/.git") > > so the check is done twice without action in between. > Remove the first check. I am hesitant to call the call to this function a "check". If you do not yet ha

Re: [PATCH] Feature: custom guitool commands can now have custom keyboard shortcuts

2016-03-31 Thread David Aguilar
Hello, On Tue, Mar 29, 2016 at 11:38:10AM +, Harish K wrote: > --- > git-gui/lib/tools.tcl | 16 +--- > 1 file changed, 13 insertions(+), 3 deletions(-) > > diff --git a/git-gui/lib/tools.tcl b/git-gui/lib/tools.tcl > index 6ec9411..749bc67 100644 > --- a/git-gui/lib/tools.tcl >

Re: [PATCH 2/4] submodule--helper clone: simplify path check

2016-03-31 Thread Junio C Hamano
Stefan Beller writes: > The calling shell code makes sure that `path` is non null and non empty. > (side note: it cannot be null as just three lines before it is passed > to safe_create_leading_directories_const which would crash as you feed > it null). This is not Java so let's spell that thing

Re: [PATCH 1/4] recursive submodules: test for relative paths

2016-03-31 Thread Junio C Hamano
Stefan Beller writes: > This was reported as a regression at $gmane/290280. The root cause for > that bug is in using recursive submodules as their relative path handling > seems to be broken in ee8838d (2015-09-08, submodule: rewrite > `module_clone` shell function in C). I've reworded the abov

Re: [PATCH 1/2] ident: check for useConfigOnly before auto-detection of name/email

2016-03-31 Thread Jeff King
On Thu, Mar 31, 2016 at 06:01:09PM +0300, Marios Titas wrote: > On Thu, Mar 31, 2016 at 10:40:03AM -0400, Jeff King wrote: > >On Wed, Mar 30, 2016 at 10:29:42PM +0300, Marios Titas wrote: > > > >>If user.useConfigOnly is set, it does not make sense to try to > >>auto-detect the name and/or the ema

Re: Signed-off-by vs Reviewed-by

2016-03-31 Thread Junio C Hamano
Miklos Vajna writes: > Typing that line (including copy&pasting your name + email all the time) > is a bit boring. I think the last message from Christian in the thread points at the right direction in the future. The internal "parse the existing trailer block and manipulate it by adding, condi

Re: [PATCH 00/21] replacement for dt/refs-backend-lmdb v7 patch 04/33

2016-03-31 Thread Michael Haggerty
On 03/30/2016 10:05 PM, David Turner wrote: > On Wed, 2016-03-30 at 08:37 +0200, Michael Haggerty wrote: >> On 03/29/2016 10:12 PM, David Turner wrote: >>> On Sun, 2016-03-27 at 07:22 +0200, Michael Haggerty wrote: On 03/24/2016 07:47 AM, David Turner wrote: > [...] > I incorporated yo

  1   2   >