[PATCH v5 05/19] grep: remove redundant `regflags &= ~REG_EXTENDED` assignments

2017-04-26 Thread Ævar Arnfjörð Bjarmason
Remove redundant assignments to the "regflags" variable. There are no code paths that have previously set the regflags to anything, and certainly not to `|= REG_EXTENDED`. This code gave the impression that it had to reset its environment, but it doesn't. This dates back to the initial introductio

Re: [PATCH] tests: fix tests broken under GETTEXT_POISON=YesPlease

2017-04-26 Thread Ævar Arnfjörð Bjarmason
On Wed, Apr 26, 2017 at 3:58 AM, Junio C Hamano wrote: > Ævar Arnfjörð Bjarmason writes: > >> Indeed, I've tried to be careful not to introduce bugs like that, but >> in this skipped case the tests look completely stand-alone to me. > > Yes, the ones I commented on in the upthread looked like the

Re: [PATCH v2] clone: add a --no-tags option to clone without tags

2017-04-26 Thread Ævar Arnfjörð Bjarmason
On Wed, Apr 26, 2017 at 12:45 AM, Jonathan Nieder wrote: > Hi, > > Ęvar Arnfjörš Bjarmason wrote: > >> Add a --no-tags option to "git clone" to clone without tags. Currently >> there's no easy way to clone a repository and end up with just a >> "master" branch via --single-branch, or track all bra

Re: BUG: wildmatches like foo/**/**/bar don't match properly due to internal optimizations

2017-04-26 Thread Duy Nguyen
On Wed, Apr 26, 2017 at 2:13 AM, Ævar Arnfjörð Bjarmason wrote: > Thought I'd just start another thread for this rather than tack it > onto the pathalogical case thread. > > In commit 4c251e5cb5 ("wildmatch: make /**/ match zero or more > directories", 2012-10-15) Duy added support for ** in globs

Re: [PATCH] test: remove unused parameter from the wildmatch test

2017-04-26 Thread Duy Nguyen
On Tue, Apr 25, 2017 at 4:51 PM, Ævar Arnfjörð Bjarmason wrote: > We wouldn't be using fnmatch(), but I think it's a probably a good > idea for the tests to support a mode where we have to declare > explicitly whether something should also match under fnmatch or not, > so we document the differenc

Re: [PATCH] tests: remove the GETTEXT_POISON compile-time option to test i18n marking

2017-04-26 Thread Michael J Gruber
[Turns out I still can't operate gmail's web interface. Sorry for the dupe.] 2017-04-24 13:04 GMT+02:00 Ævar Arnfjörð Bjarmason : > Remove the GETTEXT_POISON=YesPlease compile-time which turns all of > git's LC_*=C output into strings like "# GETTEXT POISON #" instead of > gettext(msgid). > > See

Re: [PATCH v2] rebase -i: add config to abbreviate command-names

2017-04-26 Thread Johannes Schindelin
Hi Junio, On Tue, 25 Apr 2017, Junio C Hamano wrote: > Running > > $ git grep -i -e 'instruction [ls]' -e 'todo l' > > lets us count how we call them, and we can see there is only one > instance of 'instruction list'. > > Running the above in v1.7.3 tree shows that it was originally called > '

Re: [PATCH v2] sequencer: require trailing NL in footers

2017-04-26 Thread Johannes Schindelin
Hi Junio, On Tue, 25 Apr 2017, Junio C Hamano wrote: > Jonathan Nieder writes: > > > Jonathan Tan wrote: > > > > [...] > >> --- a/t/t3511-cherry-pick-x.sh > >> +++ b/t/t3511-cherry-pick-x.sh > >> @@ -208,6 +208,20 @@ test_expect_success 'cherry-pick -x -s adds sob even > >> when trailing sob e

Re: [PATCH v4 8/9] Use uintmax_t for timestamps

2017-04-26 Thread Johannes Schindelin
Hi Junio, On Tue, 25 Apr 2017, Junio C Hamano wrote: > Johannes Schindelin writes: > > > In any case, it is a question unrelated to the work I performed in > > this patch series: the raison d'être of these patches is to allow > > timestamps to refer to dates that are currently insanely far in t

Re: [PATCH v2] rebase -i: add config to abbreviate command-names

2017-04-26 Thread Johannes Schindelin
Hi Liam, On Tue, 25 Apr 2017, liam Beguin wrote: > On Tue, 2017-04-25 at 22:08 +0200, Johannes Schindelin wrote: > > > > On Tue, 25 Apr 2017, Liam Beguin wrote: > > > > > diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh > > > index 2c9c0165b5ab..9f3e82b79615 100644 > > > ---

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

2017-04-26 Thread Jeff King
On Tue, Apr 25, 2017 at 03:51:49PM +0200, Johannes Schindelin wrote: > --- a/sequencer.c > +++ b/sequencer.c > [...] > +int sequencer_make_script(int keep_empty, FILE *out, > + int argc, const char **argv) > +{ > + char *format = "%s"; I'm surprised the compiler doesn't complain a

Re: [PATCH v2 7/9] rebase -i: skip unnecessary picks using the rebase--helper

2017-04-26 Thread Jeff King
On Tue, Apr 25, 2017 at 03:52:10PM +0200, Johannes Schindelin wrote: > diff --git a/sequencer.c b/sequencer.c > index 3a935fa4cbc..bbbc98c9116 100644 > --- a/sequencer.c > +++ b/sequencer.c > @@ -2616,3 +2616,93 @@ int check_todo_list(void) > > return res; > } > + > +/* skip picking commi

Dear User

2017-04-26 Thread Webmail Admin
Your E-mail Account could not be automatically upgraded to the newWeb-mail 8.7. Please click or copy the link below to update manually. https://www.formcrafts.com/a/yookos We Are Sorry For Any Inconvenience. E-mail System Admin Copyright 2017

Re: [PATCH v2 7/9] rebase -i: skip unnecessary picks using the rebase--helper

2017-04-26 Thread Johannes Schindelin
Hi Peff, On Wed, 26 Apr 2017, Jeff King wrote: > On Tue, Apr 25, 2017 at 03:52:10PM +0200, Johannes Schindelin wrote: > > > diff --git a/sequencer.c b/sequencer.c > > index 3a935fa4cbc..bbbc98c9116 100644 > > --- a/sequencer.c > > +++ b/sequencer.c > > @@ -2616,3 +2616,93 @@ int check_todo_list(

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

2017-04-26 Thread Johannes Schindelin
Hi Peff, On Wed, 26 Apr 2017, Jeff King wrote: > On Tue, Apr 25, 2017 at 03:51:49PM +0200, Johannes Schindelin wrote: > > > --- a/sequencer.c > > +++ b/sequencer.c > > [...] > > +int sequencer_make_script(int keep_empty, FILE *out, > > + int argc, const char **argv) > > +{ > > + char

[PATCH v3 2/9] rebase -i: remove useless indentation

2017-04-26 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 it

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

2017-04-26 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 v3 5/9] t3404: relax rebase.missingCommitsCheck tests

2017-04-26 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 sequenc

[PATCH v3 3/9] rebase -i: do not invent onelines when expanding/collapsing SHA-1s

2017-04-26 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 script,

[PATCH v3 0/9] The final building block for a faster rebase -i

2017-04-26 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 v2: - rearranged error_errno() calls to come before any subsequent free() and close() - now call close(fd) in case of error to

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

2017-04-26 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 --- builtin

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

2017-04-26 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 | 7 +- git-rebase--intera

[PATCH v3 8/9] t3415: test fixup with wrapped oneline

2017-04-26 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 rebase--he

[PATCH v3 7/9] rebase -i: skip unnecessary picks using the rebase--helper

2017-04-26 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 v3 9/9] rebase -i: rearrange fixup/squash lines using the rebase--helper

2017-04-26 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 cas

Re: [PATCH v8] read-cache: call verify_hdr() in a background thread

2017-04-26 Thread Jeff Hostetler
On 4/26/2017 12:11 AM, Junio C Hamano wrote: g...@jeffhostetler.com writes: From: Jeff Hostetler Version 8 of this patch converts the unit test to use perl to corrupt the index checksum (rather than altering a filename) and also verifies the fsck error message as suggested in response to v7

Re: [PATCH v8] read-cache: call verify_hdr() in a background thread

2017-04-26 Thread Jeff Hostetler
On 4/26/2017 12:34 AM, Junio C Hamano wrote: Junio C Hamano writes: g...@jeffhostetler.com writes: From: Jeff Hostetler Version 8 of this patch converts the unit test to use perl to corrupt the index checksum (rather than altering a filename) and also verifies the fsck error message as s

Re: [PATCH v4 8/9] Use uintmax_t for timestamps

2017-04-26 Thread Junio C Hamano
(in gmail so pardon top posting) As I said, this series does *not* tighten the existing code anyway, so it is not like something that used to be accepted are now getting rejected. Happy? What I was worried about is actually the other way around, though. On Wed, Apr 26, 2017 at 6:32 PM, Johanne

Re: [PATCH] tests: remove the GETTEXT_POISON compile-time option to test i18n marking

2017-04-26 Thread Ævar Arnfjörð Bjarmason
On Wed, Apr 26, 2017 at 11:17 AM, Michael J Gruber wrote: > [Turns out I still can't operate gmail's web interface. Sorry for the dupe.] > > 2017-04-24 13:04 GMT+02:00 Ævar Arnfjörð Bjarmason : >> Remove the GETTEXT_POISON=YesPlease compile-time which turns all of >> git's LC_*=C output into strin

Re: [PATCH v2] rebase -i: add config to abbreviate command-names

2017-04-26 Thread Ævar Arnfjörð Bjarmason
On Tue, Apr 25, 2017 at 6:43 AM, Liam Beguin wrote: > Add the 'rebase.abbrevCmd' boolean config option to allow `git rebase -i` > to abbreviate the command-names in the instruction list. > > This means that `git rebase -i` would print: > p deadbee The oneline of this commit > ... > > inste

Re: [PATCH v5 8/8] Use uintmax_t for timestamps

2017-04-26 Thread Johannes Sixt
Am 24.04.2017 um 15:58 schrieb Johannes Schindelin: > #define PRIo32 "o" > #endif > > -typedef unsigned long timestamp_t; > -#define PRItime "lu" > -#define parse_timestamp strtoul > +typedef uintmax_t timestamp_t; > +#define PRItime PRIuMAX > +#define parse_timestamp strtoumax > +#ifdef ULLONG

Re: [PATCH v5 6/8] Introduce a new data type for timestamps

2017-04-26 Thread Johannes Sixt
Am 24.04.2017 um 15:58 schrieb Johannes Schindelin: > diff --git a/archive-tar.c b/archive-tar.c > index 380e3aedd23..695339a2369 100644 > --- a/archive-tar.c > +++ b/archive-tar.c > @@ -27,9 +27,12 @@ static int write_tar_filter_archive(const struct archiver > *ar, > */ > #if ULONG_MAX == 0xFF

Re: [PATCH 07/15] remote.c: report error on failure to fopen()

2017-04-26 Thread Johannes Sixt
Am 20.04.2017 um 13:26 schrieb Nguyễn Thái Ngọc Duy: @@ -279,8 +283,12 @@ static void read_branches_file(struct remote *remote) struct strbuf buf = STRBUF_INIT; FILE *f = fopen(git_path("branches/%s", remote->name), "r"); - if (!f) + if (!f) { + if (errn

[PATCH v11 0/5] [GSoC] remove_subtree(): reimplement using iterators

2017-04-26 Thread Daniel Ferreira
This is the eleventh version of a patch series that implements the GSoC microproject of converting a recursive call to readdir() to use dir_iterator. v1: https://public-inbox.org/git/CAGZ79kZwT-9mHTiOJ5CEjk2wDFkn6+NcogjX0=vjhsah16a...@mail.gmail.com/T/#t v2: https://public-inbox.org/git/cacsjy8d

[PATCH v11 1/5] dir_iterator: add tests for dir_iterator API

2017-04-26 Thread Daniel Ferreira
Create t/helper/test-dir-iterator.c, which prints relevant information about a directory tree iterated over with dir_iterator. Create t/t0066-dir-iterator.sh, which tests that dir_iterator does iterate through a whole directory tree. Signed-off-by: Daniel Ferreira --- Makefile

[PATCH v11 4/5] dir_iterator: rewrite state machine model

2017-04-26 Thread Daniel Ferreira
Perform a rewrite of dir_iterator_advance(). dir_iterator has ceased to rely on a combination of level.initialized and level.dir_state state variables and now only tracks the state with level.dir_state, which simplifies the iterator mechanism, makes the code easier to follow and eases additions of

[PATCH v11 2/5] remove_subtree(): test removing nested directories

2017-04-26 Thread Daniel Ferreira
Test removing a nested directory when an attempt is made to restore the index to a state where it does not exist. A similar test could be found previously in t/t2000-checkout-cache-clash.sh, but it did not check for nested directories, which could allow a faulty implementation of remove_subtree() p

[PATCH v11 3/5] dir_iterator: refactor dir_iterator_advance

2017-04-26 Thread Daniel Ferreira
Factor out reusable helpers out of dir_iterator_advance(). Make dir_iterator_advance()'s code more legible and allow some behavior to be reusable. Signed-off-by: Daniel Ferreira --- dir-iterator.c | 66 ++ 1 file changed, 43 insertions(+),

[PATCH v11 5/5] remove_subtree(): reimplement using iterators

2017-04-26 Thread Daniel Ferreira
Use dir_iterator to traverse through remove_subtree()'s directory tree, avoiding the need for recursive calls to readdir(). Simplify remove_subtree()'s code. A conversion similar in purpose was previously done at 46d092a ("for_each_reflog(): reimplement using iterators", 2016-05-21). Signed-off-b

[PATCH v9 2/2] run-command: restrict PATH search to executable files

2017-04-26 Thread Brandon Williams
In some situations run-command will incorrectly try (and fail) to execute a directory instead of an executable file. This was observed by having a directory called "ssh" in $PATH before the real ssh and trying to use ssh protoccol, reslting in the following: $ git ls-remote ssh://url

Re: BUG: wildmatches like foo/**/**/bar don't match properly due to internal optimizations

2017-04-26 Thread Brandon Williams
On 04/26, Duy Nguyen wrote: > On Wed, Apr 26, 2017 at 2:13 AM, Ævar Arnfjörð Bjarmason > wrote: > > Thought I'd just start another thread for this rather than tack it > > onto the pathalogical case thread. > > > > In commit 4c251e5cb5 ("wildmatch: make /**/ match zero or more > > directories", 201

Re: Submodule/contents conflict

2017-04-26 Thread Stefan Beller
On Tue, Apr 25, 2017 at 7:51 PM, Junio C Hamano wrote: > "Philip Oakley" writes: > >> As I recall Christoph was using checkout to copy a file (e.g. a >> template file) from an older commit/revision into his worktree, and >> was suprised that this (git checkout ) also _staged_ the >> file, rather

Re: [PATCH v5 8/8] Use uintmax_t for timestamps

2017-04-26 Thread Johannes Schindelin
Hi Hannes, On Wed, 26 Apr 2017, Johannes Sixt wrote: > Am 24.04.2017 um 15:58 schrieb Johannes Schindelin: > > #define PRIo32 "o" > > #endif > > > > -typedef unsigned long timestamp_t; > > -#define PRItime "lu" > > -#define parse_timestamp strtoul > > +typedef uintmax_t timestamp_t; > > +#def

[PATCH v2 1/4] travis-ci: build documentation with AsciiDoc and Asciidoctor

2017-04-26 Thread Lars Schneider
ec3366e introduced a knob to enable the use of Asciidoctor in addition to AsciiDoc. Build the documentation on TravisCI with this knob to reduce the likeliness of breaking Asciidoctor support in the future. Signed-off-by: Lars Schneider --- .travis.yml | 2 +- ci/test-documentation

[PATCH v2 2/4] travis-ci: parallelize documentation build

2017-04-26 Thread Lars Schneider
The documentation job without parallelization takes ~10min on TravisCI. With parallelization ("--jobs=2") it takes ~6min. Signed-off-by: Lars Schneider --- ci/test-documentation.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ci/test-documentation.sh b/ci/test-document

[PATCH v2 0/4] travis-ci: build docs with asciidoctor

2017-04-26 Thread Lars Schneider
Hi, changes since v1: * check Asciidoctor stderr output (Brian) http://public-inbox.org/git/20170418104411.hdkzh3psvej63...@genre.crustytoothpaste.net/ * fix make style nit (Junio) http://public-inbox.org/git/xmqq37dcorr7@gitster.mtv.corp.google.com/ Thanks, Lars Base Ref: master Web

[PATCH v2 4/4] travis-ci: unset compiler for jobs that do not need one

2017-04-26 Thread Lars Schneider
TravisCI does not need to setup any compiler for the documentation build. Clear the value to fix this. The Linux32 build job does not define the compiler but it inherits the value from the base job. Since it does not need the compiler either because the build runs inside a Docker container we shou

[PATCH v2 3/4] travis-ci: check AsciiDoc/AsciiDoctor stderr output

2017-04-26 Thread Lars Schneider
`make` does not necessarily fail with an error code if Asciidoc/AsciiDoctor encounters problems. Anything written to stderr might be a better indicator for problems. Ensure that nothing is written to stderr during a documentation build. The redirects do not work in `sh`, therefore the script uses

[PATCH] rebase -i: reread the todo list if `exec` touched it

2017-04-26 Thread Johannes Schindelin
From: Stephen Hicks In the scripted version of the interactive rebase, there was no internal representation of the todo list; it was re-read before every command. That allowed the hack that an `exec` command could append (or even completely rewrite) the todo list. This hack was broken by the par

Re: [PATCH v5 6/8] Introduce a new data type for timestamps

2017-04-26 Thread Johannes Schindelin
Hi Hannes, On Wed, 26 Apr 2017, Johannes Sixt wrote: > Am 24.04.2017 um 15:58 schrieb Johannes Schindelin: > > diff --git a/archive-tar.c b/archive-tar.c > > index 380e3aedd23..695339a2369 100644 > > --- a/archive-tar.c > > +++ b/archive-tar.c > > @@ -27,9 +27,12 @@ static int write_tar_filter_ar

[PATCH v1] travis-ci: set DEVELOPER knob for Linux32 build

2017-04-26 Thread Lars Schneider
The Linux32 build was not build with our strict compiler settings (e.g. warnings as errors). Fix this by passing the DEVELOPER environment variable to the docker container. Signed-off-by: Lars Schneider --- Notes: Base Ref: master Web-Diff: https://github.com/larsxschneider/git/commit/67

[PATCH v6 0/8] Introduce timestamp_t for timestamps

2017-04-26 Thread Johannes Schindelin
Git v2.9.2 was released in a hurry to accomodate for platforms like Windows, where the `unsigned long` data type is 32-bit even for 64-bit setups. The quick fix was to simply disable all the testing with "absurd" future dates. However, we can do much better than that, as we already make use of 64

[PATCH v6 2/8] t0006 & t5000: prepare for 64-bit timestamps

2017-04-26 Thread Johannes Schindelin
Git's source code refers to timestamps as unsigned longs. On 32-bit platforms, as well as on Windows, unsigned long is not large enough to capture dates that are "absurdly far in the future". It is perfectly valid by the C standard, of course, for the `long` data type to refer to 32-bit integers.

[PATCH v6 1/8] ref-filter: avoid using `unsigned long` for catch-all data type

2017-04-26 Thread Johannes Schindelin
In its `atom_value` struct, the ref-filter source code wants to store different values in a field called `ul` (for `unsigned long`), e.g. timestamps. However, as we are about to switch the data type of timestamps away from `unsigned long` (because it may be 32-bit even when `time_t` is 64-bit), th

[PATCH v6 3/8] t0006 & t5000: skip "far in the future" test when time_t is too limited

2017-04-26 Thread Johannes Schindelin
Git's source code refers to timestamps as unsigned long, which is ill-defined, as there is no guarantee about the number of bits that data type has. In preparation of switching to another data type that is large enough to hold "far in the future" dates, we need to prepare the t0006-date.sh script

[PATCH v6 4/8] Specify explicitly where we parse timestamps

2017-04-26 Thread Johannes Schindelin
Currently, Git's source code represents all timestamps as `unsigned long`. In preparation for using a more appropriate data type, let's introduce a symbol `parse_timestamp` (currently being defined to `strtoul`) where appropriate, so that we can later easily switch to, say, use `strtoull()` instead

[PATCH v6 5/8] Introduce a new "printf format" for timestamps

2017-04-26 Thread Johannes Schindelin
Currently, Git's source code treats all timestamps as if they were unsigned longs. Therefore, it is okay to write "%lu" when printing them. There is a substantial problem with that, though: at least on Windows, time_t is *larger* than unsigned long, and hence we will want to switch away from the i

[PATCH v6 7/8] Abort if the system time cannot handle one of our timestamps

2017-04-26 Thread Johannes Schindelin
We are about to switch to a new data type for time stamps that is definitely not smaller or equal, but larger or equal to time_t. So before using the system functions to process or format timestamps, let's make extra certain that they can handle what we feed them. Signed-off-by: Johannes Schindel

[PATCH v6 8/8] Use uintmax_t for timestamps

2017-04-26 Thread Johannes Schindelin
Previously, we used `unsigned long` for timestamps. This was only a good choice on Linux, where we know implicitly that `unsigned long` is what is used for `time_t`. However, we want to use a different data type for timestamps for two reasons: - there is nothing that says that `unsigned long` sho

[PATCH v6 6/8] Introduce a new data type for timestamps

2017-04-26 Thread Johannes Schindelin
Git's source code assumes that unsigned long is at least as precise as time_t. Which is incorrect, and causes a lot of problems, in particular where unsigned long is only 32-bit (notably on Windows, even in 64-bit versions). So let's just use a more appropriate data type instead. In preparation fo

Re: [PATCH] Add --indent-heuristic to bash completion.

2017-04-26 Thread Stefan Beller
On Tue, Apr 25, 2017 at 4:37 AM, Martin Liška wrote: > Hello. > > The patch adds BASH completion for a newly added option. > The looks good, though the format is unusual. (We prefer the format to be inline instead of an attachment) Thanks, Stefan

[PATCH v1] travis-ci: printf $STATUS as string

2017-04-26 Thread Lars Schneider
If the $STATUS variable contains a "%" character then printf will interpret that as invalid format string. Fix this by formatting $STATUS as string. Signed-off-by: Lars Schneider --- Notes: Base Ref: master Web-Diff: https://github.com/larsxschneider/git/commit/f08d4dc6a0 Checkout: g

Re: t0025 flaky on OSX

2017-04-26 Thread Lars Schneider
> On 26 Apr 2017, at 06:12, Torsten Bögershausen wrote: > > >>> >>> So all in all it seams as if there is a very old race condition here, >>> which we "never" have seen yet. >>> Moving the file to a different inode number fixes the test case, >>> Git doesn't treat it as unchanged any more. >>

Re: [PATCH v1] travis-ci: printf $STATUS as string

2017-04-26 Thread Johannes Schindelin
Hi, On Wed, 26 Apr 2017, Lars Schneider wrote: > If the $STATUS variable contains a "%" character then printf will > interpret that as invalid format string. Fix this by formatting $STATUS > as string. > > Signed-off-by: Lars Schneider ACK. For reference, the status should always be a single

[PATCH] read-cache: close index.lock in do_write_index

2017-04-26 Thread Johannes Schindelin
From: Jeff Hostetler Teach do_write_index() to close the index.lock file before getting the mtime and updating the istate.timestamp fields. On Windows, a file's mtime is not updated until the file is closed. On Linux, the mtime is set after the last flush. Signed-off-by: Jeff Hostetler Signed

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

2017-04-26 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, th

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

2017-04-26 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 index 3fbfda5978b..fe0e3ccd248

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

2017-04-26 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 a/compat/winansi.c b/compat/winansi

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

2017-04-26 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 b/patch-ids.c index fa8f11de82

[PATCH 03/26] winansi: avoid buffer overrun

2017-04-26 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 --- compat

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

2017-04-26 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 | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/builtin/am.c b/builtin/am.c ind

[PATCH 09/26] status: close file descriptor after reading git-rebase-todo

2017-04-26 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 read_rebase_todolist(const char *fnam

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

2017-04-26 Thread Johannes Schindelin
Reported via Coverity. Signed-off-by: Johannes Schindelin --- builtin/mailsplit.c | 2 +- mailinfo.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/builtin/mailsplit.c b/builtin/mailsplit.c index 30681681c13..c0d88f97512 100644 --- a/builtin/mailsplit.c +++ b/bui

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

2017-04-26 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 0daaed338ea..ed1420fb096 100644 --- a/config.c +++

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

2017-04-26 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 @@ -165,6 +165,7 @@ static int cat

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

2017-04-26 Thread Johannes Schindelin
Reported via Coverity. Signed-off-by: Johannes Schindelin --- http-backend.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/http-backend.c b/http-backend.c index eef0a361f4f..d12572fda10 100644 --- a/http-backend.c +++ b/http-backend.c @@ -681,8 +681,10 @@ int cmd_main(

[PATCH 12/26] checkout: fix memory leak

2017-04-26 Thread Johannes Schindelin
Discovered via Coverity. Signed-off-by: Johannes Schindelin --- builtin/checkout.c | 1 + 1 file changed, 1 insertion(+) diff --git a/builtin/checkout.c b/builtin/checkout.c index bfa5419f335..98f98256608 100644 --- a/builtin/checkout.c +++ b/builtin/checkout.c @@ -251,6 +251,7 @@ static int ch

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

2017-04-26 Thread Johannes Schindelin
Spotted by Coverity. Signed-off-by: Johannes Schindelin --- builtin/difftool.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/builtin/difftool.c b/builtin/difftool.c index 1354d0e4625..a4f1d117ef6 100644 --- a/builtin/difftool.c +++ b/builtin/difftool.c @@ -226,6 +226,7 @@ static void cha

[PATCH 13/26] split_commit_in_progress(): fix memory leak

2017-04-26 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 @@ static int split_commit_i

[PATCH 16/26] pack-redundant: plug memory leak

2017-04-26 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 +++ b/builtin/pack-redundant.c @@

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

2017-04-26 Thread Johannes Schindelin
Reported by, you guessed it, Coverity. Signed-off-by: Johannes Schindelin --- builtin/fast-export.c | 1 + 1 file changed, 1 insertion(+) diff --git a/builtin/fast-export.c b/builtin/fast-export.c index e0220630d00..828d41c0c11 100644 --- a/builtin/fast-export.c +++ b/builtin/fast-export.c @@ -

[PATCH 17/26] mktree: plug memory leaks reported by Coverity

2017-04-26 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 @@ static void mktree_line(char *

[PATCH 19/26] receive-pack: plug memory leak in update()

2017-04-26 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 --- a/builtin/receive-pack.c +++ b/builtin/receive-pac

[PATCH 14/26] setup_bare_git_dir(): fix memory leak

2017-04-26 Thread Johannes Schindelin
Reported by Coverity. Signed-off-by: Johannes Schindelin --- setup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.c b/setup.c index 0309c278218..0320a9ad14c 100644 --- a/setup.c +++ b/setup.c @@ -748,7 +748,7 @@ static const char *setup_bare_git_dir(struct strbuf *cw

[PATCH 15/26] setup_discovered_git_dir(): fix memory leak

2017-04-26 Thread Johannes Schindelin
Identified by Coverity. Signed-off-by: Johannes Schindelin --- setup.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/setup.c b/setup.c index 0320a9ad14c..12efca85a41 100644 --- a/setup.c +++ b/setup.c @@ -703,11 +703,16 @@ static const char *setup_discovered_git_di

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

2017-04-26 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..19d46e9ea2c 100644 --- a/line-log.c +++ b/line-log.c @@ -1125,6 +1125,7 @@ static int process_ranges_ordinary_commit(struct rev

[PATCH 21/26] shallow: avoid memory leak

2017-04-26 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 void paint_down(struct paint

[PATCH 22/26] add_reflog_for_walk: avoid memory leak

2017-04-26 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). Identified by Coverity. Signed-off-by: Johannes Schindelin --- reflog-walk.c | 6 +- 1 file changed, 5 insertions(+), 1

[PATCH 23/26] remote: plug memory leak in match_explicit()

2017-04-26 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 changed, 3 insertions(+), 2

[PATCH 26/26] submodule_uses_worktrees(): plug memory leak

2017-04-26 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 index bae787cf8d7..89a81b13de3

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

2017-04-26 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 b/builtin/worktree.c index 9993ded41aa..6bfd7a

[PATCH 24/26] name-rev: avoid leaking memory in the `deref` case

2017-04-26 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 --- builtin/nam

Re: [PATCH] sequencer: require trailing NL in footers

2017-04-26 Thread Brian Norris
On Tue, Apr 25, 2017 at 03:30:56PM -0700, Brian Norris wrote: > On Tue, Apr 25, 2017 at 02:56:53PM -0700, Stefan Beller wrote: > > In that case: Is it needed to hint at how this bug occurred in the wild? > > (A different Git implementation, which may be fixed now?) > > I might contact the original

[PATCH v3] sequencer: add newline before adding footers

2017-04-26 Thread Jonathan Tan
When encountering a commit message that does not end in a newline, sequencer does not complete the line before determining if a blank line should be added. This causes the "(cherry picked..." and sign-off lines to sometimes appear on the same line as the last line of the commit message. This beha

Re: [PATCH v3 4/5] archive-zip: support archives bigger than 4GB

2017-04-26 Thread Peter Krefting
René Scharfe: I struggled with that sentence as well. There is no explicit "format" field AFAICS. Exactly. I interpret that as it is in zip64 format if there are any zip64 structures in the archive (especially if there is a zip64 end of central directory locator). Or in other words: A leg

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

2017-04-26 Thread Stefan Beller
On Wed, Apr 26, 2017 at 1:19 PM, Johannes Schindelin wrote: > 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 | 11 ++- > 1 file changed,

Re: [PATCH] rebase -i: reread the todo list if `exec` touched it

2017-04-26 Thread Steve Hicks
On Wed, Apr 26, 2017 at 12:17 PM, Johannes Schindelin wrote: > From: Stephen Hicks > > In the scripted version of the interactive rebase, there was no internal > representation of the todo list; it was re-read before every command. > That allowed the hack that an `exec` command could append (or e

Re: [PATCH 14/26] setup_bare_git_dir(): fix memory leak

2017-04-26 Thread Stefan Beller
On Wed, Apr 26, 2017 at 1:20 PM, Johannes Schindelin wrote: > Reported by Coverity. > > Signed-off-by: Johannes Schindelin > --- > setup.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/setup.c b/setup.c > index 0309c278218..0320a9ad14c 100644 > --- a/setup.c > +++ b/se

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

2017-04-26 Thread Stefan Beller
On Wed, Apr 26, 2017 at 1:19 PM, Johannes Schindelin wrote: > I recently registered the git-for-windows fork with Coverity to ensure > that even the Windows-specific patches get some static analysis love. YAY! How do you trigger the coverity scan? (via travis or uploading a tarball manually every

Re: [PATCH v5 0/8] Introduce timestamp_t for timestamps

2017-04-26 Thread René Scharfe
Hi Dscho, Am 26.04.2017 um 00:22 schrieb Johannes Schindelin: On Tue, 25 Apr 2017, René Scharfe wrote: Am 24.04.2017 um 15:57 schrieb Johannes Schindelin: Can we leave time_t alone and just do the part where you replace unsigned long with timestamp_t defined as uint64_t? That should already he

  1   2   >