Re: [PATCH 6/6] submodule: refactor logic to determine changed submodules

2017-04-28 Thread Stefan Beller
+ Heiko, who touched the pushing code end of last year. On Fri, Apr 28, 2017 at 4:54 PM, Brandon Williams wrote: > There are currently two instances (fetch and push) where we want to > determine if submodules have changed given some revision specification. > These two

Re: [PATCH 5/6] submodule: improve submodule_has_commits

2017-04-28 Thread Stefan Beller
On Fri, Apr 28, 2017 at 4:54 PM, Brandon Williams wrote: > Teach 'submodule_has_commits()' to ensure that if a commit exists in a > submodule, that it is also reachable from a ref. > > This is a prepritory step prior to merging the logic which checkes for

Re: [PATCH] t7400: add BSLASHPSPEC prerequisite to 'add with \\ in path'

2017-04-28 Thread Ramsay Jones
On 28/04/17 20:54, Johannes Sixt wrote: > Am 28.04.2017 um 05:09 schrieb Junio C Hamano: >> Ramsay Jones writes: >> >>> Commit cf9e55f494 ("submodule: prevent backslash expantion in submodule >>> names", 07-04-2017) added a test which creates a git repository with

[PATCH 1/6] submodule: rename add_sha1_to_array

2017-04-28 Thread Brandon Williams
Rename 'add_sha1_to_array()' to 'append_oid_to_array()' to more accuratly describe what the function does since it handles 'struct object_id' and not sha1 character arrays. Signed-off-by: Brandon Williams --- submodule.c | 9 + 1 file changed, 5 insertions(+), 4

[PATCH 6/6] submodule: refactor logic to determine changed submodules

2017-04-28 Thread Brandon Williams
There are currently two instances (fetch and push) where we want to determine if submodules have changed given some revision specification. These two instances don't use the same logic to generate a list of changed submodules and as a result there is a fair amount of code duplication. This patch

[PATCH 3/6] submodule: remove add_oid_to_argv

2017-04-28 Thread Brandon Williams
The function 'add_oid_to_argv()' provides the same functionality as 'append_oid_to_argv()'. Remove this duplicate function and instead use 'append_oid_to_argv()' where 'add_oid_to_argv()' was previously used. Signed-off-by: Brandon Williams --- submodule.c | 10 ++ 1

[PATCH 5/6] submodule: improve submodule_has_commits

2017-04-28 Thread Brandon Williams
Teach 'submodule_has_commits()' to ensure that if a commit exists in a submodule, that it is also reachable from a ref. This is a prepritory step prior to merging the logic which checkes for changed submodules when fetching or pushing. Signed-off-by: Brandon Williams ---

[PATCH 2/6] submodule: rename free_submodules_sha1s

2017-04-28 Thread Brandon Williams
Rename 'free_submodules_sha1s()' to 'free_submodules_oids()' since the function frees a 'struct string_list' which has a 'struct oid_array' stored in the 'util' field. Signed-off-by: Brandon Williams --- submodule.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)

[PATCH 0/6] changed submodules

2017-04-28 Thread Brandon Williams
A little bit ago I was looking for a function in our code base which would be able to give me a list of all the submodules which changed across a number of commits. I stumbled upon some of that logic in both our recurisve fetch and pull code paths. Problem is both of these code paths were

[PATCH 4/6] submodule: change string_list changed_submodule_paths

2017-04-28 Thread Brandon Williams
Eliminate a call to 'xstrdup()' by changing the string_list 'changed_submodule_paths' to duplicated strings added to it. Signed-off-by: Brandon Williams --- submodule.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/submodule.c b/submodule.c index

Bug Report: .gitignore behavior is not matching in git clean and git status

2017-04-28 Thread Chris Johnson
I am a mailing list noob so I’m sorry if this is the wrong format or the wrong please. Here’s the setup for the bug (I will call it a bug but I half expect somebody to tell me I’m an idiot): git init echo "/A/B/" > .gitignore git add .gitignore && git commit -m 'Add ignore' mkdir -p A/B touch

[PATCHv2 2/3] diff: have the diff-* builtins configure diff before initializing revisions

2017-04-28 Thread Marc Branchaud
This makes the commands respect diff configuration options, such as indentHeuristic, because init_revisions() calls diff_setup() which fills in the diff_options struct. Signed-off-by: Marc Branchaud --- builtin/diff-files.c | 2 +- builtin/diff-index.c | 2 +-

[PATCH 3/3] diff: enable indent heuristic by default

2017-04-28 Thread Marc Branchaud
From: Stefan Beller The feature was included in v2.11 (released 2016-11-29) and we got no negative feedback. Quite the opposite, all feedback we got was positive. Turn it on by default. Users who dislike the feature can turn it off by setting diff.compactionHeuristic (which

[PATCHv2 1/3] diff: make the indent heuristic part of diff's basic configuration

2017-04-28 Thread Marc Branchaud
This heuristic was originally introduced as an experimental feature, and therefore part of the UI configuration. But the user often sees diffs generated by plumbing commands like diff-tree. Moving the indent heuristic into diff's basic configuration prepares the way for diff plumbing commands to

[PATCHv2 0/3] Make diff plumbing commands respect the indentHeuristic.

2017-04-28 Thread Marc Branchaud
v2: Fixed up the commit messages and added tests. Marc Branchaud (2): diff: make the indent heuristic part of diff's basic configuration diff: have the diff-* builtins configure diff before initializing revisions Stefan Beller (1): diff: enable indent heuristic by default

Re: [PATCH 0/2] Make diff plumbing commands respect the indentHeuristic.

2017-04-28 Thread Stefan Beller
On Fri, Apr 28, 2017 at 3:04 PM, Jeff King wrote: > On Fri, Apr 28, 2017 at 10:34:15AM -0700, Stefan Beller wrote: > >> > So instead I chose to make the indentHeuristic option part of diff's basic >> > configuration, and in each of the diff plumbing commands I moved the call >> >

Re: [PATCH 0/2] Make diff plumbing commands respect the indentHeuristic.

2017-04-28 Thread Jeff King
On Fri, Apr 28, 2017 at 10:34:15AM -0700, Stefan Beller wrote: > > So instead I chose to make the indentHeuristic option part of diff's basic > > configuration, and in each of the diff plumbing commands I moved the call to > > git_config() before the call to init_revisions(). > [...] > > The

Re: [PATCH 1/5] add SWAP macro

2017-04-28 Thread Jeff King
On Fri, Apr 28, 2017 at 07:04:51PM +0200, René Scharfe wrote: > > What should: > > > >SWAP(foo[i], foo[j]); > > > > do when i == j? With this code, it ends up calling > > > >memcpy([i], [j], ...); > > > > which can cause valgrind to complain about overlapping memory. I suspect > > in

[PATCH v4 09/10] t3415: test fixup with wrapped oneline

2017-04-28 Thread Johannes Schindelin
The `git commit --fixup` command unwraps wrapped onelines when constructing the commit message, without wrapping the result. We need to make sure that `git rebase --autosquash` keeps handling such cases correctly, in particular since we are about to move the autosquash handling into the

[PATCH v4 10/10] rebase -i: rearrange fixup/squash lines using the rebase--helper

2017-04-28 Thread Johannes Schindelin
This operation has quadratic complexity, which is especially painful on Windows, where shell scripts are *already* slow (mainly due to the overhead of the POSIX emulation layer). Let's reimplement this with linear complexity (using a hash map to match the commits' subject lines) for the common

[PATCH v4 07/10] rebase -i: check for missing commits in the rebase--helper

2017-04-28 Thread Johannes Schindelin
In particular on Windows, where shell scripts are even more expensive than on MacOSX or Linux, it makes sense to move a loop that forks Git at least once for every line in the todo list into a builtin. Signed-off-by: Johannes Schindelin --- builtin/rebase--helper.c

[PATCH v4 08/10] rebase -i: skip unnecessary picks using the rebase--helper

2017-04-28 Thread Johannes Schindelin
In particular on Windows, where shell scripts are even more expensive than on MacOSX or Linux, it makes sense to move a loop that forks Git at least once for every line in the todo list into a builtin. Note: The original code did not try to skip unnecessary picks of root commits but punts instead

[PATCH v4 06/10] t3404: relax rebase.missingCommitsCheck tests

2017-04-28 Thread Johannes Schindelin
These tests were a bit anal about the *exact* warning/error message printed by git rebase. But those messages are intended for the *end user*, therefore it does not make sense to test so rigidly for the *exact* wording. In the following, we will reimplement the missing commits check in the

[PATCH v4 05/10] rebase -i: also expand/collapse the SHA-1s via the rebase--helper

2017-04-28 Thread Johannes Schindelin
This is crucial to improve performance on Windows, as the speed is now mostly dominated by the SHA-1 transformation (because it spawns a new rev-parse process for *every* line, and spawning processes is pretty slow from Git for Windows' MSYS2 Bash). Signed-off-by: Johannes Schindelin

[PATCH v4 03/10] rebase -i: remove useless indentation

2017-04-28 Thread Johannes Schindelin
The commands used to be indented, and it is nice to look at, but when we transform the SHA-1s, the indentation is removed. So let's do away with it. For the moment, at least: when we will use the upcoming rebase--helper to transform the SHA-1s, we *will* keep the indentation and can reintroduce

[PATCH v4 04/10] rebase -i: do not invent onelines when expanding/collapsing SHA-1s

2017-04-28 Thread Johannes Schindelin
To avoid problems with short SHA-1s that become non-unique during the rebase, we rewrite the todo script with short/long SHA-1s before and after letting the user edit the script. Since SHA-1s are not intuitive for humans, rebase -i also provides the onelines (commit message subjects) in the

[PATCH v4 01/10] t3415: verify that an empty instructionFormat is handled as before

2017-04-28 Thread Johannes Schindelin
An upcoming patch will move the todo list generation into the rebase--helper. An early version of that patch regressed on an empty rebase.instructionFormat value (the shell version could not discern between an empty one and a non-existing one, but the C version used the empty one as if that was

[PATCH v4 02/10] rebase -i: generate the script via rebase--helper

2017-04-28 Thread Johannes Schindelin
The first step of an interactive rebase is to generate the so-called "todo script", to be stored in the state directory as "git-rebase-todo" and to be edited by the user. Originally, we adjusted the output of `git log ` using a simple sed script. Over the course of the years, the code became more

[PATCH v4 00/10] The final building block for a faster rebase -i

2017-04-28 Thread Johannes Schindelin
This patch series reimplements the expensive pre- and post-processing of the todo script in C. And it concludes the work I did to accelerate rebase -i. Changes since v3: - removed the no-longer-used transform_todo_ids shell function - simplified transform_todo_ids()'s command parsing - fixed

Automating Coverity, was Re: [PATCH 00/26] Address a couple of issues identified by Coverity

2017-04-28 Thread Johannes Schindelin
Hi Stefan, On Fri, 28 Apr 2017, Stefan Beller wrote: > On Thu, Apr 27, 2017 at 3:50 PM, Johannes Schindelin > wrote: > > > I still have to find the time to figure out one more detail: how to > > download and extract the Coverity tool (the .zip archive has a > >

Re: [PATCH] t7400: add BSLASHPSPEC prerequisite to 'add with \\ in path'

2017-04-28 Thread Johannes Sixt
Am 28.04.2017 um 05:09 schrieb Junio C Hamano: Ramsay Jones writes: Commit cf9e55f494 ("submodule: prevent backslash expantion in submodule names", 07-04-2017) added a test which creates a git repository with some backslash characters in the name. This test cannot

Re: [PATCH v3 1/9] rebase -i: generate the script via rebase--helper

2017-04-28 Thread Johannes Schindelin
Hi Philip, On Fri, 28 Apr 2017, Phillip Wood wrote: > On 26/04/17 12:59, Johannes Schindelin wrote: > > > The first step of an interactive rebase is to generate the so-called > > "todo script", to be stored in the state directory as > > "git-rebase-todo" and to be edited by the user. > > > >

Re: git v2.13.0-rc0 test failures on cygwin

2017-04-28 Thread Devin Lehmacher
> > Test Summary Report > > --- > > t0301-credential-cache.sh(Wstat: 256 Tests: 29 > > Failed: 6) > > Failed tests: 12, 24-28 > > Non-zero exit status: 1 > > Confirmed I'm seeing this on v2.13.0-rc1, and this passed in v2.12.2. > `git bisect` tells me

Re: [PATCH v3 0/5] clone: --no-tags option

2017-04-28 Thread Stefan Beller
On Fri, Apr 28, 2017 at 12:11 PM, Ævar Arnfjörð Bjarmason wrote: > On Thu, Apr 27, 2017 at 1:12 AM, Ævar Arnfjörð Bjarmason > wrote: >> This is an expansion of the previously solo 02/05 "clone: add a >> --no-tags option to clone without tags" patch (see >>

Re: [PATCH v3 0/5] clone: --no-tags option

2017-04-28 Thread Ævar Arnfjörð Bjarmason
On Thu, Apr 27, 2017 at 1:12 AM, Ævar Arnfjörð Bjarmason wrote: > This is an expansion of the previously solo 02/05 "clone: add a > --no-tags option to clone without tags" patch (see > <20170418191553.15464-1-ava...@gmail.com>). > > This addresses the comments by Junio &

Re: [PATCH 00/26] Address a couple of issues identified by Coverity

2017-04-28 Thread Stefan Beller
Hi Johannes, thanks for the reply. On Thu, Apr 27, 2017 at 3:50 PM, Johannes Schindelin wrote: > I still have to find the time to figure out one more detail: how to > download and extract the Coverity tool (the .zip archive has a variable > name for the top-level

Re: [PATCH v3 3/5] tests: rename a test having to do with shallow submodules

2017-04-28 Thread Stefan Beller
On Fri, Apr 28, 2017 at 1:59 AM, Ævar Arnfjörð Bjarmason wrote: > On Fri, Apr 28, 2017 at 12:13 AM, Brandon Williams wrote: >> On 04/27, Stefan Beller wrote: >>> On Wed, Apr 26, 2017 at 4:12 PM, Ævar Arnfjörð Bjarmason >>> wrote: >>> >

Re: [PATCH 0/2] Make diff plumbing commands respect the indentHeuristic.

2017-04-28 Thread Stefan Beller
On Thu, Apr 27, 2017 at 1:50 PM, Marc Branchaud wrote: > So here's my attempt at fixing this. > > The thing I was missing is that init_revisions() calls diff_setup(), which > sets the xdl options. It's therefore necessary to have the > diff_indent_heuristic flag set before

Re: [PATCH 1/5] add SWAP macro

2017-04-28 Thread René Scharfe
Am 24.04.2017 um 13:29 schrieb Jeff King: On Sat, Jan 28, 2017 at 10:38:21PM +0100, René Scharfe wrote: diff --git a/git-compat-util.h b/git-compat-util.h index 87237b092b..66cd466eea 100644 --- a/git-compat-util.h +++ b/git-compat-util.h @@ -527,6 +527,16 @@ static inline int ends_with(const

Re: push fails with return code 22

2017-04-28 Thread Andrew Watson
You are the best Peff. It was indeed the hierarchy. So just had to change document root. Thanks a bunch. On Fri, Apr 28, 2017 at 11:34 AM, Jeff King wrote: > On Fri, Apr 28, 2017 at 11:28:14AM -0400, Andrew Watson wrote: > >> $ GIT_CURL_VERBOSE=1 git clone

Re: git with ssh won't pull submodule

2017-04-28 Thread Chris Packham
Hi Erik, On Fri, Apr 28, 2017 at 11:25 AM, Erik Haller wrote: > Getting the following error for a submodule when using git/ssh: > > $ git clone --recursive ssh://incense:/home/erik/git/nacl.git > Cloning into 'nacl'... > remote: Counting objects: 32, done. > remote:

Re: push fails with return code 22

2017-04-28 Thread Jeff King
On Fri, Apr 28, 2017 at 11:28:14AM -0400, Andrew Watson wrote: > $ GIT_CURL_VERBOSE=1 git clone http://git.site.domain.com/foo/gitrepo.git > Cloning into 'gitrepo'... > * Couldn't find host git.site.domain.com in the _netrc file; using defaults > * timeout on name lookup is not supported > *

Re: push fails with return code 22

2017-04-28 Thread Andrew Watson
Hi Peff, Thanks for the help. $ GIT_CURL_VERBOSE=1 git clone http://git.site.domain.com/foo/gitrepo.git Cloning into 'gitrepo'... * Couldn't find host git.site.domain.com in the _netrc file; using defaults * timeout on name lookup is not supported * Trying 192.168.16.138... * TCP_NODELAY set *

Re: push fails with return code 22

2017-04-28 Thread Jeff King
On Fri, Apr 28, 2017 at 11:09:55AM -0400, Andrew Watson wrote: > Thanks for pointing me to git help http-backend. I confirmed the > modules are loaded and the CGI environment variables. I've added > "AcceptPathInfo On" to my httpd.conf just to be safe. > > I'm not sure what /info/refs is

Re: [PATCH v3 4/9] rebase -i: also expand/collapse the SHA-1s via the rebase--helper

2017-04-28 Thread Johannes Schindelin
Hi Junio, On Thu, 27 Apr 2017, Junio C Hamano wrote: > Johannes Schindelin writes: > > >> > +out = fopen(todo_file, "w"); > >> > >> The usual "open lockfile, write to it and then rename" dance is not > >> necessary for the purpose of preventing other people

Re: [PATCH v3 1/9] rebase -i: generate the script via rebase--helper

2017-04-28 Thread Johannes Schindelin
Hi Junio, On Thu, 27 Apr 2017, Junio C Hamano wrote: > Johannes Schindelin writes: > > > On Wed, 26 Apr 2017, Junio C Hamano wrote: > > > >> Johannes Schindelin writes: > >> > >> > diff --git a/sequencer.c b/sequencer.c > >> > index

Re: [PATCH v3 6/9] rebase -i: check for missing commits in the rebase--helper

2017-04-28 Thread Johannes Schindelin
Hi Junio, On Wed, 26 Apr 2017, Junio C Hamano wrote: > Johannes Schindelin writes: > > > -check_todo_list > > +git rebase--helper --check-todo-list || { > > + ret=$? > > + checkout_onto > > + exit $ret > > +} > > I find this a better division of labor

Re: push fails with return code 22

2017-04-28 Thread Andrew Watson
Hi Peff, I agree that it does look like the client isn't using smart-http. I am using the Windows client from git-scm.com. Thanks for pointing me to git help http-backend. I confirmed the modules are loaded and the CGI environment variables. I've added "AcceptPathInfo On" to my httpd.conf just

Re: [PATCH v3 2/5] clone: add a --no-tags option to clone without tags

2017-04-28 Thread Ævar Arnfjörð Bjarmason
On Thu, Apr 27, 2017 at 7:54 PM, Stefan Beller wrote: > On Wed, Apr 26, 2017 at 4:12 PM, Ævar Arnfjörð Bjarmason > wrote: >> Add a --no-tags option to clone without fetching any tags. >> >> Without this change there's no easy way to clone a repository

[PATCH v2 21/25] add_reflog_for_walk: avoid memory leak

2017-04-28 Thread Johannes Schindelin
We free()d the `log` buffer when dwim_log() returned 1, but not when it returned a larger value (which meant that it still allocated the buffer but we simply ignored it). While in the vicinity, make sure that the `reflogs` structure as well as the `branch` variable are released properly, too.

[PATCH v2 25/25] submodule_uses_worktrees(): plug memory leak

2017-04-28 Thread Johannes Schindelin
There is really no reason why we would need to hold onto the allocated string longer than necessary. Reported by Coverity. Signed-off-by: Johannes Schindelin --- worktree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/worktree.c b/worktree.c

[PATCH v2 24/25] show_worktree(): plug memory leak

2017-04-28 Thread Johannes Schindelin
The buffer allocated by shorten_unambiguous_ref() needs to be released. Discovered by Coverity. Signed-off-by: Johannes Schindelin --- builtin/worktree.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/builtin/worktree.c

[PATCH v2 23/25] name-rev: avoid leaking memory in the `deref` case

2017-04-28 Thread Johannes Schindelin
When the `name_rev()` function is asked to dereference the tip name, it allocates memory. But when it turns out that another tip already described the commit better than the current one, we forgot to release the memory. Pointed out by Coverity. Signed-off-by: Johannes Schindelin

[PATCH v2 22/25] remote: plug memory leak in match_explicit()

2017-04-28 Thread Johannes Schindelin
The `guess_ref()` returns an allocated buffer of which `make_linked_ref()` does not take custody (`alloc_ref()` makes a copy), therefore we need to release the buffer afterwards. Noticed via Coverity. Signed-off-by: Johannes Schindelin --- remote.c | 5 +++-- 1 file

[PATCH v2 20/25] shallow: avoid memory leak

2017-04-28 Thread Johannes Schindelin
Reported by Coverity. Signed-off-by: Johannes Schindelin --- shallow.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/shallow.c b/shallow.c index 25b6db989bf..f9370961f99 100644 --- a/shallow.c +++ b/shallow.c @@ -473,11 +473,15 @@ static

[PATCH v2 18/25] receive-pack: plug memory leak in update()

2017-04-28 Thread Johannes Schindelin
Reported via Coverity. Signed-off-by: Johannes Schindelin --- builtin/receive-pack.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/builtin/receive-pack.c b/builtin/receive-pack.c index f96834f42c9..48c07ddb659 100644 ---

[PATCH v2 19/25] line-log: avoid memory leak

2017-04-28 Thread Johannes Schindelin
Discovered by Coverity. Signed-off-by: Johannes Schindelin --- line-log.c | 1 + 1 file changed, 1 insertion(+) diff --git a/line-log.c b/line-log.c index a23b910471b..b9087814b8c 100644 --- a/line-log.c +++ b/line-log.c @@ -1125,6 +1125,7 @@ static int

[PATCH v2 17/25] fast-export: avoid leaking memory in handle_tag()

2017-04-28 Thread Johannes Schindelin
Reported by, you guessed it, Coverity. Signed-off-by: Johannes Schindelin --- builtin/fast-export.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/builtin/fast-export.c b/builtin/fast-export.c index e0220630d00..64617ad8e36 100644 --- a/builtin/fast-export.c

[PATCH v2 16/25] mktree: plug memory leaks reported by Coverity

2017-04-28 Thread Johannes Schindelin
Signed-off-by: Johannes Schindelin --- builtin/mktree.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/builtin/mktree.c b/builtin/mktree.c index de9b40fc63b..f0354bc9718 100644 --- a/builtin/mktree.c +++ b/builtin/mktree.c @@ -72,7 +72,7 @@

[PATCH v2 12/25] split_commit_in_progress(): fix memory leak

2017-04-28 Thread Johannes Schindelin
Reported via Coverity. Signed-off-by: Johannes Schindelin --- wt-status.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/wt-status.c b/wt-status.c index 0a6e16dbe0f..1f3f6bcb980 100644 --- a/wt-status.c +++ b/wt-status.c @@ -1088,8 +1088,13

[PATCH v2 14/25] setup_discovered_git_dir(): help static analysis

2017-04-28 Thread Johannes Schindelin
Coverity reported a memory leak in this function. However, it can only be called once, as setup_git_directory() changes global state and hence is not reentrant. Mark the variable as static to indicate that this is a singleton. Signed-off-by: Johannes Schindelin ---

[PATCH v2 13/25] setup_bare_git_dir(): help static analysis

2017-04-28 Thread Johannes Schindelin
Coverity reported a memory leak in this function. However, it can only be called once, as setup_git_directory() changes global state and hence is not reentrant. Mark the variable as static to indicate that this is a singleton. Signed-off-by: Johannes Schindelin ---

[PATCH v2 15/25] pack-redundant: plug memory leak

2017-04-28 Thread Johannes Schindelin
Identified via Coverity. Signed-off-by: Johannes Schindelin --- builtin/pack-redundant.c | 1 + 1 file changed, 1 insertion(+) diff --git a/builtin/pack-redundant.c b/builtin/pack-redundant.c index 72c815844dd..cb1df1c7614 100644 --- a/builtin/pack-redundant.c +++

[PATCH v2 10/25] cat-file: fix memory leak

2017-04-28 Thread Johannes Schindelin
Discovered by Coverity. Signed-off-by: Johannes Schindelin --- builtin/cat-file.c | 1 + 1 file changed, 1 insertion(+) diff --git a/builtin/cat-file.c b/builtin/cat-file.c index 1890d7a6390..9af863e7915 100644 --- a/builtin/cat-file.c +++ b/builtin/cat-file.c @@

[PATCH v2 11/25] checkout: fix memory leak

2017-04-28 Thread Johannes Schindelin
This change addresses part of the NEEDSWORK comment above the code, therefore the comment needs to be adjusted, too. Discovered via Coverity. Signed-off-by: Johannes Schindelin --- builtin/checkout.c | 17 + 1 file changed, 9 insertions(+), 8

[PATCH v2 09/25] mailinfo & mailsplit: check for EOF while parsing

2017-04-28 Thread Johannes Schindelin
While POSIX states that it is okay to pass EOF to isspace() (and it seems to be implied that EOF should *not* be treated as whitespace), and also to pass EOF to ungetc() (which seems to be intended to fail without buffering the character), it is much better to handle these cases explicitly. Not

[PATCH v2 08/25] status: close file descriptor after reading git-rebase-todo

2017-04-28 Thread Johannes Schindelin
Reported via Coverity. Signed-off-by: Johannes Schindelin --- wt-status.c | 1 + 1 file changed, 1 insertion(+) diff --git a/wt-status.c b/wt-status.c index 03754849626..0a6e16dbe0f 100644 --- a/wt-status.c +++ b/wt-status.c @@ -1168,6 +1168,7 @@ static int

[PATCH v2 04/25] add_commit_patch_id(): avoid allocating memory unnecessarily

2017-04-28 Thread Johannes Schindelin
It would appear that we allocate (and forget to release) memory if the patch ID is not even defined. Reported by the Coverity tool. Signed-off-by: Johannes Schindelin --- patch-ids.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/patch-ids.c

[PATCH v2 05/25] git_config_rename_section_in_file(): avoid resource leak

2017-04-28 Thread Johannes Schindelin
In case of errors, we really want the file descriptor to be closed. Discovered by a Coverity scan. Signed-off-by: Johannes Schindelin --- config.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/config.c b/config.c index

[PATCH v2 06/25] get_mail_commit_oid(): avoid resource leak

2017-04-28 Thread Johannes Schindelin
When we fail to read, or parse, the file, we still want to close the file descriptor and release the strbuf. Reported via Coverity. Signed-off-by: Johannes Schindelin --- builtin/am.c | 15 ++- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git

[PATCH v2 07/25] difftool: address a couple of resource/memory leaks

2017-04-28 Thread Johannes Schindelin
This change plugs a couple of memory leaks and makes sure that the file descriptor is closed in run_dir_diff(). Spotted by Coverity. Signed-off-by: Johannes Schindelin --- builtin/difftool.c | 33 +++-- 1 file changed, 23 insertions(+),

[PATCH v2 03/25] winansi: avoid buffer overrun

2017-04-28 Thread Johannes Schindelin
When we could not convert the UTF-8 sequence into Unicode for writing to the Console, we should not try to write an insanely-long sequence of invalid wide characters (mistaking the negative return value for an unsigned length). Reported by Coverity. Signed-off-by: Johannes Schindelin

[PATCH v2 02/25] winansi: avoid use of uninitialized value

2017-04-28 Thread Johannes Schindelin
When stdout is not connected to a Win32 console, we incorrectly used an uninitialized value for the "plain" character attributes. Detected by Coverity. Signed-off-by: Johannes Schindelin --- compat/winansi.c | 2 ++ 1 file changed, 2 insertions(+) diff --git

[PATCH v2 00/25] Address a couple of issues identified by Coverity

2017-04-28 Thread Johannes Schindelin
I recently registered the git-for-windows fork with Coverity to ensure that even the Windows-specific patches get some static analysis love. While at it, I squashed a couple of obvious issues in the part that is not Windows-specific. Note: while this patch series squashes some of those issues,

[PATCH v2 01/25] mingw: avoid memory leak when splitting PATH

2017-04-28 Thread Johannes Schindelin
In the (admittedly, concocted) case that PATH consists only of colons, we would leak the duplicated string. Signed-off-by: Johannes Schindelin --- compat/mingw.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/compat/mingw.c b/compat/mingw.c

Re: [PATCH 10/26] Check for EOF while parsing mails

2017-04-28 Thread Jeff King
On Fri, Apr 28, 2017 at 03:33:41PM +0200, Johannes Schindelin wrote: > As usual, EOF is defined as -1 in Git for Windows' context, meaning that > we look at the last entry of the sane_ctype array, which returns 0 for any > sane_istest(x,mask) test for x >= 0x80: > > /* Nothing in the

Re: [PATCH 06/26] get_mail_commit_oid(): avoid resource leak

2017-04-28 Thread Johannes Schindelin
Hi Junio & Stefan, On Wed, 26 Apr 2017, Junio C Hamano wrote: > Stefan Beller writes: > > >> - if (get_oid_hex(x, commit_id) < 0) > >> - return -1; > >> + if (!ret && get_oid_hex(x, commit_id) < 0) > >> + ret = -1; > >> > > > > In

Re: [PATCH 10/26] Check for EOF while parsing mails

2017-04-28 Thread Johannes Schindelin
Hi Peff, On Fri, 28 Apr 2017, Jeff King wrote: > On Fri, Apr 28, 2017 at 12:44:52PM +0200, Johannes Schindelin wrote: > > > > Also, what is the behavior of ungetc when we pass it EOF? > > > > According to the documentation, it would cast EOF to an unsigned char and > > push that back.

Re: [PATCH 10/26] Check for EOF while parsing mails

2017-04-28 Thread Johannes Schindelin
Hi Peff, On Fri, 28 Apr 2017, Jeff King wrote: > On Fri, Apr 28, 2017 at 12:41:02PM +0200, Johannes Schindelin wrote: > > > But then, I guess I misunderstood what Coverity complained about: > > maybe the problem was not so much the isspace() call but that EOF is > > not being handled correctly.

RE: Git and Active directory ldap Authentication

2017-04-28 Thread Randall S. Becker
On April 28, 2017 5:31 AM Miguel Angel Soriano Morales wrote: > I would like use git in my Company. We use Active directory for everything, but I prefer install git in ? > centos7. I Would like authenticate all my user in Git through Active Directory. And Every Project had > ACL permissions .It

Hello Beautiful,

2017-04-28 Thread Jack
Good day dear, i hope this mail meets you well? my name is Jack, from the U.S. I know this may seem inappropriate so i ask for your forgiveness but i wish to get to know you better, if I may be so bold. I consider myself an easy-going man, adventurous, honest and fun loving person but I am

Re: git v2.13.0-rc0 test failures on cygwin

2017-04-28 Thread Adam Dinwoodie
On 23 April 2017 at 15:44, Ramsay Jones wrote: > [Adam, if you are no longer the git package maintainer for cygwin, then > please ignore this email and sorry for the noise!] I am still the Cygwin Git package maintainer; I've been quiet of late because of personal health issues, but I'm now

Re: [PATCH 00/26] Address a couple of issues identified by Coverity

2017-04-28 Thread Johannes Schindelin
Hi Hannes, On Thu, 27 Apr 2017, Johannes Sixt wrote: > Am 26.04.2017 um 22:19 schrieb Johannes Schindelin: > > I recently registered the git-for-windows fork with Coverity to ensure > > that even the Windows-specific patches get some static analysis love. > > > > While at it, I squashed a couple

Re: [PATCH 22/26] add_reflog_for_walk: avoid memory leak

2017-04-28 Thread Johannes Schindelin
Hi Hannes, On Thu, 27 Apr 2017, Johannes Sixt wrote: > Am 26.04.2017 um 22:21 schrieb Johannes Schindelin: > > We free()d the `log` buffer when dwim_log() returned 1, but not when it > > returned a larger value (which meant that it still allocated the buffer > > but we simply ignored it). > > >

Re: [PATCH 10/26] Check for EOF while parsing mails

2017-04-28 Thread Jeff King
On Fri, Apr 28, 2017 at 12:41:02PM +0200, Johannes Schindelin wrote: > > Why? isspace(EOF) is well-defined. > > So let's look at the man page on Linux: > > These functions check whether c, which must have the value of an > unsigned char or EOF, [...] > > That is the only

Re: [PATCH 10/26] Check for EOF while parsing mails

2017-04-28 Thread Jeff King
On Fri, Apr 28, 2017 at 12:44:52PM +0200, Johannes Schindelin wrote: > > Also, what is the behavior of ungetc when we pass it EOF? > > According to the documentation, it would cast EOF to an unsigned char and > push that back. Definitely incorrect. > > > It looks like POSIX does what we want

Re: [PATCH 20/26] line-log: avoid memory leak

2017-04-28 Thread Johannes Schindelin
Hi Hannes, On Thu, 27 Apr 2017, Johannes Sixt wrote: > Am 26.04.2017 um 22:21 schrieb Johannes Schindelin: > > Discovered by Coverity. > > > > Signed-off-by: Johannes Schindelin > > --- > > line-log.c | 1 + > > 1 file changed, 1 insertion(+) > > > > diff --git

Re: [PATCH 18/26] fast-export: avoid leaking memory in handle_tag()

2017-04-28 Thread Johannes Schindelin
Hi Hannes, On Thu, 27 Apr 2017, Johannes Sixt wrote: > Am 26.04.2017 um 22:21 schrieb Johannes Schindelin: > > Reported by, you guessed it, Coverity. > > > > Signed-off-by: Johannes Schindelin > > --- > > builtin/fast-export.c | 1 + > > 1 file changed, 1

Re: [PATCH 12/26] checkout: fix memory leak

2017-04-28 Thread Johannes Schindelin
Hi Junio, On Wed, 26 Apr 2017, Junio C Hamano wrote: > Johannes Schindelin writes: > > > Discovered via Coverity. > > > > Signed-off-by: Johannes Schindelin > > --- > > builtin/checkout.c | 1 + > > 1 file changed, 1 insertion(+) > > >

Re: [PATCH 10/26] Check for EOF while parsing mails

2017-04-28 Thread Johannes Schindelin
Hi Peff, On Thu, 27 Apr 2017, Jeff King wrote: > On Wed, Apr 26, 2017 at 10:20:16PM +0200, Johannes Schindelin wrote: > > > diff --git a/builtin/mailsplit.c b/builtin/mailsplit.c > > index 30681681c13..c0d88f97512 100644 > > --- a/builtin/mailsplit.c > > +++ b/builtin/mailsplit.c > > @@ -232,7

Re: [PATCH 10/26] Check for EOF while parsing mails

2017-04-28 Thread Johannes Schindelin
Hi Hannes, On Thu, 27 Apr 2017, Johannes Sixt wrote: > Am 26.04.2017 um 22:20 schrieb Johannes Schindelin: > > > diff --git a/builtin/mailsplit.c b/builtin/mailsplit.c > > index 30681681c13..c0d88f97512 100644 > > --- a/builtin/mailsplit.c > > +++ b/builtin/mailsplit.c > > @@ -232,7 +232,7 @@

Re: [PATCH v3 1/9] rebase -i: generate the script via rebase--helper

2017-04-28 Thread Phillip Wood
On 26/04/17 12:59, Johannes Schindelin wrote: > The first step of an interactive rebase is to generate the so-called "todo > script", to be stored in the state directory as "git-rebase-todo" and to > be edited by the user. > > Originally, we adjusted the output of `git log ` using a simple > sed

HELLO

2017-04-28 Thread Mr Faisal Samae
I am Mr. Faisal Samae Director of the company in Burkina Faso, I needed your assistant to do business with me and we shall aim a good profit at the end of the successful business, please i want you to put all your mind/ trust and effort to accomplish this deal, i belief Allah will help us all,

Re: [PATCH 06/26] get_mail_commit_oid(): avoid resource leak

2017-04-28 Thread Johannes Schindelin
Hi Hannes, On Thu, 27 Apr 2017, Johannes Sixt wrote: > Am 26.04.2017 um 22:19 schrieb Johannes Schindelin: > > > > diff --git a/builtin/am.c b/builtin/am.c > > index 805f56cec2f..01b700e5e74 100644 > > --- a/builtin/am.c > > +++ b/builtin/am.c > > @@ -1359,15 +1359,16 @@ static int

Re: [PATCH 11/26] cat-file: fix memory leak

2017-04-28 Thread Johannes Schindelin
Hi Junio, On Wed, 26 Apr 2017, Junio C Hamano wrote: > Johannes Schindelin writes: > > > Discovered by Coverity. > > > > Signed-off-by: Johannes Schindelin > > --- > > builtin/cat-file.c | 1 + > > 1 file changed, 1 insertion(+) > > > >

Re: [PATCH 10/26] Check for EOF while parsing mails

2017-04-28 Thread Johannes Schindelin
Hi Junio, On Wed, 26 Apr 2017, Junio C Hamano wrote: > Johannes Schindelin writes: > > > Reported via Coverity. > > > > Signed-off-by: Johannes Schindelin > > --- > > builtin/mailsplit.c | 2 +- > > mailinfo.c | 2 +- > > 2

Re: [PATCH 08/26] difftool: close file descriptors after reading

2017-04-28 Thread Johannes Schindelin
Hi Junio, On Wed, 26 Apr 2017, Junio C Hamano wrote: > Johannes Schindelin writes: > > diff --git a/builtin/difftool.c b/builtin/difftool.c > > index 1354d0e4625..a4f1d117ef6 100644 > > --- a/builtin/difftool.c > > +++ b/builtin/difftool.c > > @@ -497,6 +498,7 @@

Re: [PATCH 07/26] http-backend: avoid memory leaks

2017-04-28 Thread Johannes Schindelin
Hi Junio, On Wed, 26 Apr 2017, Junio C Hamano wrote: > Johannes Schindelin writes: > > > Reported via Coverity. > > > > Signed-off-by: Johannes Schindelin > > --- > > http-backend.c | 6 +- > > 1 file changed, 5 insertions(+), 1

Git and Active directory ldap Authentication

2017-04-28 Thread Miguel Angel Soriano Morales
Hi, Sorry for my English and Thanks for assisting me. I would like use git in my Company. We use Active directory for everything, but I prefer install git in centos7. I Would like authenticate all my user in Git through Active Directory. And Every Project had ACL permissions .It this posible? Can

Re: [PATCH v3 3/5] tests: rename a test having to do with shallow submodules

2017-04-28 Thread Ævar Arnfjörð Bjarmason
On Fri, Apr 28, 2017 at 12:13 AM, Brandon Williams wrote: > On 04/27, Stefan Beller wrote: >> On Wed, Apr 26, 2017 at 4:12 PM, Ævar Arnfjörð Bjarmason >> wrote: >> > Rename the t5614-clone-submodules.sh test to >> > t5614-clone-submodules-shallow.sh. It's not

  1   2   >