Re: [PATCH v2 13/21] packed_ref_cache: keep the `packed-refs` file mmapped if possible

2017-09-23 Thread Junio C Hamano
Michael Haggerty writes: >> +struct stat st; >> +size_t size, bytes_read; > > Coverity helpfully pointed out that `bytes_read` has to be signed: > `ssize_t`. I'll fix that in the next round after waiting for other comments. Thanks. The macOS build at Travis also was also upset about i

Re: [PATCH v8 01/12] bswap: add 64 bit endianness helper get_be64

2017-09-23 Thread Junio C Hamano
Ben Peart writes: >> @@ -183,8 +183,8 @@ static inline uint32_t get_be32(const void *ptr) static >> inline uint64_t get_be64(const void *ptr) { >> const unsigned char *p = ptr; >> -return (uint64_t)get_be32(p[0]) << 32 | >> -(uint64_t)get_be32(p[4]) << 0; >> +return

Re: [PATCH v8 08/12] fsmonitor: add a test tool to dump the index extension

2017-09-23 Thread Junio C Hamano
Ben Peart writes: >> You forget to add the new binary to .gitignore. (In patch 12/12, you >> introduce >> test-drop-caches, which you _do_ add to .gitignore.) >> > > Oops. Thanks! Hopefully Junio can squash this in... OK, will do.

Re: [PATCH v8 01/12] bswap: add 64 bit endianness helper get_be64

2017-09-23 Thread Jeff King
On Sat, Sep 23, 2017 at 11:31:50PM +, Ben Peart wrote: > > diff --git a/compat/bswap.h b/compat/bswap.h index 6b22c4621..9dc79bdf5 > > 100644 > > --- a/compat/bswap.h > > +++ b/compat/bswap.h > > @@ -183,8 +183,8 @@ static inline uint32_t get_be32(const void *ptr) static > > inline uint64_t g

Re: [PATCH 1/3] refs: make sha1 output parameter of refs_resolve_ref_unsafe() optional

2017-09-23 Thread Junio C Hamano
René Scharfe writes: > Allow callers of refs_resolve_ref_unsafe() to pass NULL if they don't > need the resolved hash value. We already allow the same for the flags > parameter. This new leniency is inherited by the various wrappers like > resolve_ref_unsafe(). > > Signed-off-by: Rene Scharfe

Re: [PATCH] userdiff: fix HTML hunk header regexp

2017-09-23 Thread Junio C Hamano
Ilya Kantor writes: > Current HTML header regexp doesn't match headers without attributes. > > So it fails to match ..., while ... matches. > The fix makes attributes optional. > The regexp is still far from perfect, but now it at least handles the > common case. > > Signed-off-by: Ilya Kantor >

Re: [PATCH v4] connect: in ref advertisement, shallows are last

2017-09-23 Thread Junio C Hamano
Jonathan Tan writes: > Currently, get_remote_heads() parses the ref advertisement in one loop, > allowing refs and shallow lines to intersperse, despite this not being > allowed by the specification. Refactor get_remote_heads() to use two > loops instead, enforcing that refs come first, and then

Re: Behaviour of 'git stash show' when a stash has untracked files

2017-09-23 Thread Junio C Hamano
Jeff King writes: > I think it would mostly Just Work for your case. git-apply should ignore > the subject cruft at the top of the patch. And if you didn't create a > stash with "-u" or with bits in the index, then those would be absent > from the diff. > > And if you _did_ create such a stash, I

Re: [PATCH v2] doc: camelCase the config variables to improve readability

2017-09-23 Thread Junio C Hamano
Kaartic Sivaraam writes: > A few configuration variable names of Git are composite words. References > to such variables in manpages are hard to read because they use all-lowercase > names, without indicating where each word ends and begins. > > Improve its readability by using camelCase instead.

Re: is there a "symlink" option for cloning a repo in a separate filesystem?

2017-09-23 Thread Junio C Hamano
"Robert P. J. Day" writes: > reading "man git-clone", and i understand the mechanics of the local > protocol, so that if i run: > > $ git clone /path/to/repo > > then "files under .git/objects/ directory are hardlinked to save space > when possible." > > but if the repo is in a separate fil

Re: [PATCHv2] Documentation/config: clarify the meaning of submodule..update

2017-09-23 Thread Junio C Hamano
Jonathan Nieder writes: > Stefan Beller wrote: > >> Reported-by: Lars Schneider >> Signed-off-by: Stefan Beller >> --- >> Documentation/config.txt | 12 >> 1 file changed, 8 insertions(+), 4 deletions(-) >> >> Jonathan writes: > >>> You'll want to update Documentation/gitmodules.t

Re: [PATCH 3/4] merge: --no-verify to bypass pre-merge hook

2017-09-23 Thread Junio C Hamano
Michael J Gruber writes: > From: Michael J Gruber > > Analogous to commit, introduce a '--no-verify' option which bypasses the > pre-merge hook. The shorthand '-n' is taken by the (non-existing) > '--no-stat' already. > > Signed-off-by: Michael J Gruber > --- It appears that some of the pieces

RE: [PATCH v8 08/12] fsmonitor: add a test tool to dump the index extension

2017-09-23 Thread Ben Peart
> -Original Message- > From: Martin Ågren [mailto:martin.ag...@gmail.com] > Sent: Friday, September 22, 2017 7:37 PM > To: Ben Peart > Cc: David Turner ; Ævar Arnfjörð Bjarmason > ; Christian Couder ; > git@vger.kernel.org; Junio C Hamano ; Johannes > Schindelin ; Nguyễn Thái Ngọc Duy > ;

RE: [PATCH v8 01/12] bswap: add 64 bit endianness helper get_be64

2017-09-23 Thread Ben Peart
Thanks, Ben > -Original Message- > From: Martin Ågren [mailto:martin.ag...@gmail.com] > Sent: Friday, September 22, 2017 7:37 PM > To: Ben Peart > Cc: David Turner ; Ævar Arnfjörð Bjarmason > ; Christian Couder ; > git@vger.kernel.org; Junio C Hamano ; Johannes > Schindelin ; Nguyễn Th

[PATCH v2 3/9] perf/run: add GIT_PERF_DIRS_OR_REVS

2017-09-23 Thread Christian Couder
This environment variable can be set to some revisions or directories whose Git versions should be tested, in addition to the revisions or directories passed as arguments to the 'run' script. This enables a "perf.dirsOrRevs" configuration variable to be used to set revisions or directories whose G

[PATCH v2 6/9] perf/run: update get_var_from_env_or_config() for subsections

2017-09-23 Thread Christian Couder
As we will set some config options in subsections, let's teach get_var_from_env_or_config() to get the config options from the subsections if they are set there. Signed-off-by: Christian Couder --- t/perf/run | 32 1 file changed, 20 insertions(+), 12 deletions(-

[PATCH v2 7/9] perf/run: add run_subsection()

2017-09-23 Thread Christian Couder
Let's actually use the subsections we find in the config file to run the perf tests separately for each subsection. Signed-off-by: Christian Couder --- t/perf/run | 47 +++ 1 file changed, 35 insertions(+), 12 deletions(-) diff --git a/t/perf/run b/t/

[PATCH v2 8/9] perf/run: show name of rev being built

2017-09-23 Thread Christian Couder
It is nice for the user to not just show the sha1 of the current revision being built but also the actual name of this revision. Signed-off-by: Christian Couder --- t/perf/run | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/t/perf/run b/t/perf/run index cb8687bfcf98d..43

[PATCH v2 9/9] perf: store subsection results in "test-results/$GIT_PERF_SUBSECTION/"

2017-09-23 Thread Christian Couder
When tests are run for a subsection defined in a config file, it is better if the results for the current subsection are not overwritting the results of a previous subsection. So let's store the results for a subsection in a subdirectory of "test-results/" with the subsection name. The aggregate.

[PATCH v2 2/9] perf/run: add get_var_from_env_or_config()

2017-09-23 Thread Christian Couder
Add get_var_from_env_or_config() to easily set variables from a config file if they are defined there and not already set. This can also set them to a default value if one is provided. As an example, use this function to set GIT_PERF_REPEAT_COUNT from the perf.repeatCount config option or from th

[PATCH v2 4/9] perf/run: add calls to get_var_from_env_or_config()

2017-09-23 Thread Christian Couder
These calls make it possible to have the make command or the make options in a config file, instead of in environment variables. Signed-off-by: Christian Couder --- t/perf/run | 3 +++ 1 file changed, 3 insertions(+) diff --git a/t/perf/run b/t/perf/run index ad442fe64a828..6bd15e701756b 100755

[PATCH v2 5/9] perf/run: add get_subsections()

2017-09-23 Thread Christian Couder
This function makes it possible to find subsections, so that we will be able to run different tests for different subsections in a later commit. Signed-off-by: Christian Couder --- t/perf/run | 7 +++ 1 file changed, 7 insertions(+) diff --git a/t/perf/run b/t/perf/run index 6bd15e701756b..

[PATCH v2 1/9] perf/run: add '--config' option to the 'run' script

2017-09-23 Thread Christian Couder
It is error prone and tiring to use many long environment variables to give parameters to the 'run' script. Let's make it easy to store some parameters in a config file and to pass them to the run script. The GIT_PERF_CONFIG_FILE variable will be set to the argument of the '--config' option. This

[PATCH v2 0/9] Teach 'run' perf script to read config files

2017-09-23 Thread Christian Couder
(It looks like smtp.gmail.com isn't working anymore for me, so I am trying to send this using Gmail for the cover letter and Submitgit for the patches.) Goal Using many long environment variables to give parameters to the 'run' script is error prone and tiring. We want to make it possible t

Re: is there a "symlink" option for cloning a repo in a separate filesystem?

2017-09-23 Thread brian m. carlson
On Sat, Sep 23, 2017 at 04:22:32AM -0400, Robert P. J. Day wrote: > > reading "man git-clone", and i understand the mechanics of the local > protocol, so that if i run: > > $ git clone /path/to/repo > > then "files under .git/objects/ directory are hardlinked to save space > when possible."

Re: [PATCH] mailinfo: don't decode invalid =XY quoted-printable sequences

2017-09-23 Thread René Scharfe
Am 23.09.2017 um 20:04 schrieb René Scharfe: > Decode =XY in quoted-printable segments only if X and Y are hexadecimal > digits, otherwise just copy them. That's at least better than > interpreting negative results from hexval() as a character. Forgot to add: Reported-by: Jeff King René

[PATCH] mailinfo: don't decode invalid =XY quoted-printable sequences

2017-09-23 Thread René Scharfe
Decode =XY in quoted-printable segments only if X and Y are hexadecimal digits, otherwise just copy them. That's at least better than interpreting negative results from hexval() as a character. Signed-off-by: Rene Scharfe --- mailinfo.c | 11 --- 1 file changed, 8 insertions(+), 3 delet

Re: [PATCH v2 0/6] reroll ma/plugleaks; more `object_array`-fixes

2017-09-23 Thread Jeff King
On Sat, Sep 23, 2017 at 12:13:16PM -0400, Jeff King wrote: > In theory you should be able to just add "log_path=/tmp/lsan/output" to > that, which should put all the logs in a convenient place (and stop the > extra output from confusing any tests which capture stderr). But I can't > seem to get lo

Re: [PATCH v2 0/6] reroll ma/plugleaks; more `object_array`-fixes

2017-09-23 Thread Jeff King
On Sat, Sep 23, 2017 at 11:54:31AM +0200, Martin Ågren wrote: > Unfortunately, I have not figured out how to get LSan to simply report > the leaks and continue. Its default behavior is to abort if there are > leaks. That's useful for finding the first leaking test, but not much > else. (Later test

Re: [PATCH v2 5/6] object_array: add and use `object_array_pop()`

2017-09-23 Thread Jeff King
On Sat, Sep 23, 2017 at 11:49:16AM +0200, Martin Ågren wrote: > >> void add_object_array_with_path(struct object *obj, const char *name, > >> struct object_array *array, unsigned mode, const char *path); > >> +/* > >> + * Returns NULL if the array is empty. Otherwise, returns the last object > >

Re: [RFC PATCH 3/5] branch: cleanup branch name validation

2017-09-23 Thread Kaartic Sivaraam
On Thursday 21 September 2017 07:07 AM, Junio C Hamano wrote: Kaartic Sivaraam writes: Thanks for giving a better alternative. Sounds catchy. How about `validate_branch_creation`? I do not know what you meant by "catchy", I was intending that 'ok_to_create_branch' was a "nice alternative" w

Re: [RFC PATCH 1/5] builtin/checkout: avoid usage of '!!'

2017-09-23 Thread Kaartic Sivaraam
On Thursday 21 September 2017 07:01 AM, Junio C Hamano wrote: What does "with arithmetic constructs" mean? Would it refer to things like !!i != !!(j + 3) that unnecessarily obfuscates what is going on? Thanks that clears the confusion because I haven't seen constructs like this before

Re: is there a "symlink" option for cloning a repo in a separate filesystem?

2017-09-23 Thread Torsten Bögershausen
On 2017-09-23 10:22, Robert P. J. Day wrote: > > reading "man git-clone", and i understand the mechanics of the local > protocol, so that if i run: > > $ git clone /path/to/repo > > then "files under .git/objects/ directory are hardlinked to save space > when possible." > > but if the rep

Re: [RFC PATCH 5/5] builtin/branch: give more useful error messages when renaming

2017-09-23 Thread Kaartic Sivaraam
On Thursday 21 September 2017 02:27 AM, Stefan Beller wrote: It's conventional to report that 'tset' doesn't exist rather than reporting that 'master' exists, the same way the 'mv' command does. $ git branch -m tset master This is not the 'mv' command as promised? So this is just to demo

Re: [PATCH v2 0/6] reroll ma/plugleaks; more `object_array`-fixes

2017-09-23 Thread Martin Ågren
On 23 September 2017 at 06:37, Jeff King wrote: > On Sat, Sep 23, 2017 at 01:34:48AM +0200, Martin Ågren wrote: > >> Martin Ågren (6): >> builtin/commit: fix memory leak in `prepare_index()` >> commit: fix memory leak in `reduce_heads()` >> leak_pending: use `object_array_clear()`, not `free

Re: [PATCH v2 5/6] object_array: add and use `object_array_pop()`

2017-09-23 Thread Martin Ågren
On 23 September 2017 at 06:27, Jeff King wrote: > On Sat, Sep 23, 2017 at 01:34:53AM +0200, Martin Ågren wrote: > >> Introduce and use `object_array_pop()` instead. Release memory in the >> new function. Document that popping an object leaves the associated >> elements in limbo. > > The interface

[PATCH 2/3] refs: pass NULL to refs_resolve_ref_unsafe() if hash is not needed

2017-09-23 Thread René Scharfe
This allows us to get rid of two write-only variables, one of them being a SHA1 buffer. Signed-off-by: Rene Scharfe --- refs/files-backend.c | 3 +-- worktree.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/refs/files-backend.c b/refs/files-backend.c index 326

[PATCH 3/3] refs: pass NULL to resolve_ref_unsafe() if hash is not needed

2017-09-23 Thread René Scharfe
This allows us to get rid of some write-only variables, among them seven SHA1 buffers. Signed-off-by: Rene Scharfe --- branch.c| 3 +-- builtin/commit.c| 3 +-- builtin/log.c | 3 +-- builtin/receive-pack.c | 3 +-- builtin/remote.c

[PATCH 1/3] refs: make sha1 output parameter of refs_resolve_ref_unsafe() optional

2017-09-23 Thread René Scharfe
Allow callers of refs_resolve_ref_unsafe() to pass NULL if they don't need the resolved hash value. We already allow the same for the flags parameter. This new leniency is inherited by the various wrappers like resolve_ref_unsafe(). Signed-off-by: Rene Scharfe --- refs.c | 3 +++ refs.h | 9 ++

Re: [PATCH v2 4/6] object_array: use `object_array_clear()`, not `free()`

2017-09-23 Thread Martin Ågren
On 23 September 2017 at 06:04, Jeff King wrote: > On Sat, Sep 23, 2017 at 01:34:52AM +0200, Martin Ågren wrote: > >> The way we handle `study` in builting/reflog.c still looks like it might >> leak. That will be addressed in the next commit. > > This confused me for a minute, since the leak is not

is there a "symlink" option for cloning a repo in a separate filesystem?

2017-09-23 Thread Robert P. J. Day
reading "man git-clone", and i understand the mechanics of the local protocol, so that if i run: $ git clone /path/to/repo then "files under .git/objects/ directory are hardlinked to save space when possible." but if the repo is in a separate filesystem, or on an NFS mount, hardlinks clea

[PATCH] userdiff: fix HTML hunk header regexp

2017-09-23 Thread Ilya Kantor
Current HTML header regexp doesn't match headers without attributes. So it fails to match ..., while ... matches. The fix makes attributes optional. The regexp is still far from perfect, but now it at least handles the common case. Signed-off-by: Ilya Kantor --- userdiff.c | 2 +- 1 file change

Re: Behaviour of 'git stash show' when a stash has untracked files

2017-09-23 Thread Kaartic Sivaraam
On Wed, 2017-09-20 at 23:31 -0400, Jeff King wrote: > But I have always been bothered how the saved state > is a bit hidden from the user. It seems like a recipe for user confusion > when they save something with "git stash" but then "stash show" doesn't > even mention it. > Yeah, I feel the same

Re: Behaviour of 'git stash show' when a stash has untracked files

2017-09-23 Thread Kaartic Sivaraam
On Wed, 2017-09-20 at 15:36 -0400, Jeff King wrote: > > Or sometimes people are just really behind in reading the mailing list. ;) > > This seemed familiar, and indeed there was some discussion a few months > ago: > > > https://public-inbox.org/git/CAOtcWM3mrQEqDnjMipzea7Kp+VueBFsZDL2zcJ=y0wg