Re: [PATCH v2 25/27] attr: store attribute stack in attr_check structure

2017-01-25 Thread Junio C Hamano
Brandon Williams writes: >> In my mind, the value of having a constant check_attr is primarily >> that it gives us a stable pointer to serve as a hashmap key, >> i.e. the identifier for each call site, in a later iteration. > > We didn't really discuss this notion of having

Re: [PATCH v2 25/27] attr: store attribute stack in attr_check structure

2017-01-25 Thread Stefan Beller
On Wed, Jan 25, 2017 at 11:57 AM, Brandon Williams wrote: > On 01/23, Junio C Hamano wrote: >> Brandon Williams writes: >> >> > ... It seems like breaking the question and answer up >> > doesn't buy you much in terms of reducing allocation churn and instead

Re: [PATCH 12/12] receive-pack: avoid duplicates between our refs and alternates

2017-01-25 Thread Jeff King
On Wed, Jan 25, 2017 at 12:02:30PM -0800, Junio C Hamano wrote: > > +extract_ref_advertisement () { > > + perl -lne ' > > + # \\ is there to skip capabilities after \0 > > + /push< ([^\\]+)/ or next; > > + exit 0 if $1 eq ""; > > + print $1; > > + '

Re: [PATCH 12/12] receive-pack: avoid duplicates between our refs and alternates

2017-01-25 Thread Junio C Hamano
Jeff King writes: > We de-duplicate ".have" refs among themselves, but never > check if they are duplicates of our local refs. It's not > unreasonable that they would be if we are a "--shared" or > "--reference" clone of a similar repository; we'd have all > the same tags. > > We

Re: [PATCH 11/12] receive-pack: treat namespace .have lines like alternates

2017-01-25 Thread Jeff King
On Wed, Jan 25, 2017 at 11:51:17AM -0800, Junio C Hamano wrote: > This is an unrelated tangent, but there may want to be a knob to > make the code return here without even showing, to make the > advertisement even smaller and also to stop miniscule information > leakage? If the namespaced

Re: [PATCH v2 25/27] attr: store attribute stack in attr_check structure

2017-01-25 Thread Brandon Williams
On 01/23, Junio C Hamano wrote: > Brandon Williams writes: > > > ... It seems like breaking the question and answer up > > doesn't buy you much in terms of reducing allocation churn and instead > > complicates the API with needing to keep track of two structures instead > > of

Re: [PATCH 09/12] receive-pack: use oidset to de-duplicate .have lines

2017-01-25 Thread Jeff King
On Wed, Jan 25, 2017 at 11:32:05AM -0800, Junio C Hamano wrote: > Jeff King writes: > > > If you have an alternate object store with a very large > > number of refs, the peak memory usage of the sha1_array can > > grow high, even if most of them are duplicates that end up > > not

Re: [PATCH 11/12] receive-pack: treat namespace .have lines like alternates

2017-01-25 Thread Junio C Hamano
Jeff King writes: > Namely, de-duplicate them. We use the same set as the > alternates, since we call them both ".have" (i.e., there is > no value in showing one versus the other). > > Signed-off-by: Jeff King > --- > builtin/receive-pack.c | 10 +++--- > 1

Re: [PATCH 07/12] fetch-pack: cache results of for_each_alternate_ref

2017-01-25 Thread Jeff King
On Wed, Jan 25, 2017 at 11:21:11AM -0800, Junio C Hamano wrote: > > diff --git a/object.h b/object.h > > index 614a00675..f52957dcb 100644 > > --- a/object.h > > +++ b/object.h > > @@ -29,7 +29,7 @@ struct object_array { > > /* > > * object flag allocation: > > * revision.h:

Re: [PATCH 06/12] clone: disable save_commit_buffer

2017-01-25 Thread Jeff King
On Wed, Jan 25, 2017 at 02:27:40PM -0500, Jeff King wrote: > > > For fetching operations like clone, we already disable > > > > s/clone/fetch/ you meant? > > Well, no, because this patch deals with clone. > > It's likely that builtin/fetch.c would want the same treatment. It > didn't come up

Re: [PATCH 09/12] receive-pack: use oidset to de-duplicate .have lines

2017-01-25 Thread Junio C Hamano
Jeff King writes: > If you have an alternate object store with a very large > number of refs, the peak memory usage of the sha1_array can > grow high, even if most of them are duplicates that end up > not being printed at all. > ... > Signed-off-by: Jeff King > ---

Re: [PATCH 06/12] clone: disable save_commit_buffer

2017-01-25 Thread Jeff King
On Wed, Jan 25, 2017 at 11:11:01AM -0800, Junio C Hamano wrote: > Jeff King writes: > > > Normally git caches the raw commit object contents in > > "struct commit". This makes it fast to run parse_commit() > > followed by a pretty-print operation. > > > > For commands which don't

Re: [PATCH 07/12] fetch-pack: cache results of for_each_alternate_ref

2017-01-25 Thread Junio C Hamano
Jeff King writes: > +struct alternate_object_cache { > + struct object **items; > + size_t nr, alloc; > +}; > + > +static void cache_one_alternate(const char *refname, > + const struct object_id *oid, > + void

Re: [PATCH 06/12] clone: disable save_commit_buffer

2017-01-25 Thread Junio C Hamano
Jeff King writes: > Normally git caches the raw commit object contents in > "struct commit". This makes it fast to run parse_commit() > followed by a pretty-print operation. > > For commands which don't actually pretty-print the commits, > the caching is wasteful (and may use

Re: [PATCH 05/12] for_each_alternate_ref: replace transport code with for-each-ref

2017-01-25 Thread Junio C Hamano
Jeff King writes: > ... > This patch omits the peeled information from > for_each_alternate_ref entirely, and leaves it up to the > caller whether they want to dig up the information. > > Signed-off-by: Jeff King > --- > I also tried adding "%(*objectname)" to

Re: [DEMO][PATCH v2 6/5] compat: add a qsort_s() implementation based on GNU's qsort_r(1)

2017-01-25 Thread Jeff King
On Wed, Jan 25, 2017 at 07:43:01PM +0100, René Scharfe wrote: > We could track processor time spent and memory allocated in QSORT_S and the > whole program and show a warning at the end if one of the two exceeded, say, > 5% of the total, asking nicely to send it to our mailing list. Would >

Re: [DEMO][PATCH v2 6/5] compat: add a qsort_s() implementation based on GNU's qsort_r(1)

2017-01-25 Thread René Scharfe
Am 24.01.2017 um 21:39 schrieb Jeff King: On Tue, Jan 24, 2017 at 07:00:03PM +0100, René Scharfe wrote: I do worry about having to support more implementations in the future that have different function signature for the comparison callbacks, which will make things ugly, but this addition

Re: [RFC] what content should go in https://git-scm.com/doc/ext

2017-01-25 Thread Jeff King
On Sun, Jan 22, 2017 at 08:13:53PM +0100, Christian Couder wrote: > > Basically, we maintain a list of links to outside documentation, as well > > as to books. Somebody has requested a link to their paid tutorial > > course. How should we handle it? > > I think it depends if you are ready and

Re: [PATCH 03/12] for_each_alternate_ref: use strbuf for path allocation

2017-01-25 Thread Jeff King
On Wed, Jan 25, 2017 at 10:29:05AM -0800, Junio C Hamano wrote: > Jeff King writes: > > > We have a string with ".../objects" pointing to the > > alternate object store, and overwrite bits of it to look at > > other paths in the (potential) git repository holding it. > > This

Re: What's cooking in git.git (Jan 2017, #04; Mon, 23)

2017-01-25 Thread Jeff King
On Wed, Jan 25, 2017 at 10:16:40AM -0800, Junio C Hamano wrote: > > But whatever the cause, I think the workaround I posted is > > easy enough to do. > > Or spelling it explicitly as "/bin/mv" (forgetting systems that does > not have it in /bin but as /usr/bin/mv) would also defeat alias if >

Re: What's cooking in git.git (Jan 2017, #04; Mon, 23)

2017-01-25 Thread Stefan Beller
On Mon, Jan 23, 2017 at 4:18 PM, Junio C Hamano wrote: > > * sb/unpack-trees-super-prefix (2017-01-12) 5 commits > - SQUASH > - unpack-trees: support super-prefix option > - t1001: modernize style > - t1000: modernize style > - read-tree: use OPT_BOOL instead of

Re: Fixing the warning about warning(""); was: Re: [PATCH] difftool.c: mark a file-local symbol with static

2017-01-25 Thread Jeff King
On Wed, Jan 25, 2017 at 11:36:50AM +0100, Johannes Schindelin wrote: > > Gross, but at least it's self documenting. :) > > > > I guess a less horrible version of that is: > > > > static inline warning_blank_line(void) > > { > > warning("%s", ""); > > } > > > > We'd potentially need a

Re: [PATCH 03/12] for_each_alternate_ref: use strbuf for path allocation

2017-01-25 Thread Junio C Hamano
Jeff King writes: > We have a string with ".../objects" pointing to the > alternate object store, and overwrite bits of it to look at > other paths in the (potential) git repository holding it. > This works because the only path we care about is "refs", > which is shorter than

Re: [PATCH 01/12] for_each_alternate_ref: handle failure from real_pathdup()

2017-01-25 Thread Junio C Hamano
Jeff King writes: > In older versions of git, if real_path() failed to resolve > the alternate object store path, we would die() with an > error. However, since 4ac9006f8 (real_path: have callers use > real_pathdup and strbuf_realpath, 2016-12-12) we use the > real_pathdup()

Re: What's cooking in git.git (Jan 2017, #04; Mon, 23)

2017-01-25 Thread Junio C Hamano
Jeff King writes: > On Wed, Jan 25, 2017 at 06:01:11PM +0100, Johannes Schindelin wrote: > >> > Looks like "mv" prompts and then fails to move the file (so we get the >> > dangling blob for the source blob, and fsck doesn't report failure >> > because we didn't actually corrupt

Re: [PATCH] tag: add tag.createReflog option

2017-01-25 Thread Junio C Hamano
Jeff King writes: > I made a lot of suppositions about your desires there, so maybe you > really do want just tag.createReflog. But "core.logallrefupdates = > always" sounds a lot more useful to me. Thanks for saving me from typing exactly the same thing ;-)

Re: [PATCH] tag: add tag.createReflog option

2017-01-25 Thread Jeff King
On Wed, Jan 25, 2017 at 01:19:06AM +0100, cornelius.w...@tngtech.com wrote: > From: Cornelius Weig > > Git does not create a history for tags, in contrast to common > expectation to simply version everything. This can be changed by using > the `--create-reflog` flag

Re: git clone problem

2017-01-25 Thread Santiago Torres
Hello, Jordi. Hmm, it should've cloned in the "whatever" directory. Can you post your git version/configs and maybe the output verbatim of the command when you run it? If you can reproduce in an empty dictionary that'd be better $ mkdir test && cd test $ git clone --recursive

Re: [PATCH 4/5] revision.c: refactor ref selection handler after --exclude

2017-01-25 Thread Jacob Keller
On Wed, Jan 25, 2017 at 4:50 AM, Nguyễn Thái Ngọc Duy wrote: > Behavior change: "--exclude --blah --remotes" will not exclude remote > branches any more. Only "--exclude --remotes" does. > > This is because --exclude is going to have a new friend --decorate-reflog > who haves

Re: What's cooking in git.git (Jan 2017, #04; Mon, 23)

2017-01-25 Thread Jeff King
On Wed, Jan 25, 2017 at 06:01:11PM +0100, Johannes Schindelin wrote: > > Looks like "mv" prompts and then fails to move the file (so we get the > > dangling blob for the source blob, and fsck doesn't report failure > > because we didn't actually corrupt the destination blob). > > IIRC I had

[ANNOUNCE] Git Rev News edition 23

2017-01-25 Thread Christian Couder
Hi everyone, The 23rd edition of Git Rev News is now published: https://git.github.io/rev_news/2017/01/25/edition-23/ Thanks a lot to all the contributors and helpers! Enjoy, Christian, Thomas, Jakub and Markus.

Re: What's cooking in git.git (Jan 2017, #04; Mon, 23)

2017-01-25 Thread Johannes Schindelin
Hi Peff, On Tue, 24 Jan 2017, Jeff King wrote: > On Tue, Jan 24, 2017 at 11:04:21AM +0100, Lars Schneider wrote: > > > "fsck: prepare dummy objects for --connectivity-check" seems to > > make t1450-fsck.sh fail on macOS with TravisCI: > > > > Initialized empty Git repository in

git clone problem

2017-01-25 Thread Jordi Durban
Hi all! Not sure if that will reach the goal, but let's it a try. I have a problem with the git clone command: when I try to clone a remote repository with the following: git clone --recursive https://github.com/whatever.git what I actually obtain is a copy of my own files in the current

[PATCH] Retire the `relink` command

2017-01-25 Thread Johannes Schindelin
Back in the olden days, when all objects were loose and rubber boots were made out of wood, it made sense to try to share (immutable) objects between repositories. Ever since the arrival of pack files, it is but an anachronism. Let's move the script to the contrib/examples/ directory and no

[PATCH] mingw: allow hooks to be .exe files

2017-01-25 Thread Johannes Schindelin
This change is necessary to allow the files in .git/hooks/ to optionally have the file extension `.exe` on Windows, as the file names are hardcoded otherwise. Signed-off-by: Johannes Schindelin --- Published-As: https://github.com/dscho/git/releases/tag/exe-as-hook-v1

Re: [PATCH v3 14/21] read-cache: touch shared index files when used

2017-01-25 Thread Christian Couder
On Mon, Jan 23, 2017 at 7:53 PM, Junio C Hamano wrote: > Christian Couder writes: > >> Also in general the split-index mode is useful when you often write >> new indexes, and in this case shared index files that are used will >> often be freshened,

Re: [PATCH v2 0/7] Macros for Asciidoctor support

2017-01-25 Thread Johannes Schindelin
Hi Brian, On Sun, 22 Jan 2017, brian m. carlson wrote: > There are two major processors of AsciiDoc: AsciiDoc itself, and > Asciidoctor. Both have advantages and disadvantages, but traditionally > the documentation has been built with AsciiDoc, leading to some > surprising breakage when

[PATCH] fixup! worktree move: new command

2017-01-25 Thread Johannes Schindelin
This is required for the test to pass on Windows, where $TRASH_DIRECTORY is a POSIX path, while Git works with Windows paths instead. Using `$(pwd)` is the common workaround: it reports a Windows path (while `$PWD` would report the POSIX equivalent which, however, would only be understood by shell

Re: [PATCH 1/3] Documentation/stash: remove mention of git reset --hard

2017-01-25 Thread Jakub Narębski
W dniu 24.01.2017 o 21:14, Jeff King pisze: > On Sat, Jan 21, 2017 at 08:08:02PM +, Thomas Gummerer wrote: > >> diff --git a/Documentation/git-stash.txt b/Documentation/git-stash.txt >> index 2e9cef06e6..0ad5335a3e 100644 >> --- a/Documentation/git-stash.txt >> +++

[PATCH 4/5] revision.c: refactor ref selection handler after --exclude

2017-01-25 Thread Nguyễn Thái Ngọc Duy
Behavior change: "--exclude --blah --remotes" will not exclude remote branches any more. Only "--exclude --remotes" does. This is because --exclude is going to have a new friend --decorate-reflog who haves the same way. When you allow a distant --remotes to complement a previous option, things

[PATCH 5/5] revision.c: add --decorate-reflog

2017-01-25 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- revision.c | 46 ++ 1 file changed, 46 insertions(+) diff --git a/revision.c b/revision.c index 45cffcab44..b77face513 100644 --- a/revision.c +++ b/revision.c @@ -2157,6 +2157,49 @@ static

[PATCH 0/5] Prep steps for --decorate-reflog

2017-01-25 Thread Nguyễn Thái Ngọc Duy
I'm still half way through implementing --decorate-reflog that can select what refs to decorate using --branches, --remotes, --tags... But I want to make sure I'm heading the right direction first since I'm not really sure if this is the right way (implementation wise). This series does not

[PATCH 1/5] rev-list-options.txt: delete an empty line

2017-01-25 Thread Nguyễn Thái Ngọc Duy
The convention has been option name is followed immediately by its description without a line break. Signed-off-by: Nguyễn Thái Ngọc Duy --- Documentation/rev-list-options.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/Documentation/rev-list-options.txt

[PATCH 3/5] revision.c: allow to change pseudo opt parsing function

2017-01-25 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- revision.c | 11 --- revision.h | 4 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/revision.c b/revision.c index 6ebd38d1c8..cda2606c66 100644 --- a/revision.c +++ b/revision.c @@ -2273,10 +2273,15 @@ int

[PATCH 2/5] revision.c: group ref selection options together

2017-01-25 Thread Nguyễn Thái Ngọc Duy
These options have on thing in common: when specified right after --exclude, they will de-select refs instead of selecting them by default. This change makes it possible to introduce new options that use these options in the same way as --exclude. Such an option would just implement something

Re: [PATCH] connect: handle putty/plink also in GIT_SSH_COMMAND

2017-01-25 Thread Johannes Schindelin
Hi Junio, On Mon, 9 Jan 2017, Junio C Hamano wrote: > IOW, "give an escape hatch to override auto-detected tortoiseplink and > plink variables" suggestion should be taken as an "in addition to" > suggestion (as opposed to an "instead of" suggestion). I was not clear > in my very first message,

Fixing the warning about warning(""); was: Re: [PATCH] difftool.c: mark a file-local symbol with static

2017-01-25 Thread Johannes Schindelin
Hi Peff, On Tue, 24 Jan 2017, Jeff King wrote: > On Tue, Jan 24, 2017 at 01:52:13PM -0800, Junio C Hamano wrote: > > > > I dunno. As ugly as the "%s" thing is in the source, at least it > > > doesn't change the output. Not that an extra space is the end of the > > > world, but it seems like

Re: [PATCH v2 4/4] urlmatch: allow globbing for the URL host part

2017-01-25 Thread Patrick Steinhardt
On Tue, Jan 24, 2017 at 05:52:39PM -, Philip Oakley wrote: > From: "Patrick Steinhardt" > > a quick comment on the documentation part .. > > > The URL matching function computes for two URLs whether they match not. > > The match is performed by splitting up the

[PATCH v3 3/4] urlmatch: split host and port fields in `struct url_info`

2017-01-25 Thread Patrick Steinhardt
The `url_info` structure contains information about a normalized URL with the URL's components being represented by different fields. The host and port part though are to be accessed by the same `host` field, so that getting the host and/or port separately becomes more involved than really

[PATCH v3 4/4] urlmatch: allow globbing for the URL host part

2017-01-25 Thread Patrick Steinhardt
The URL matching function computes for two URLs whether they match not. The match is performed by splitting up the URL into different parts and then doing an exact comparison with the to-be-matched URL. The main user of `urlmatch` is the configuration subsystem. It allows to set certain

[PATCH v3 1/4] mailmap: add Patrick Steinhardt's work address

2017-01-25 Thread Patrick Steinhardt
Signed-off-by: Patrick Steinhardt --- .mailmap | 1 + 1 file changed, 1 insertion(+) diff --git a/.mailmap b/.mailmap index 9c87a3840..ea59205b9 100644 --- a/.mailmap +++ b/.mailmap @@ -177,6 +177,7 @@ Paolo Bonzini

[PATCH v3 2/4] urlmatch: enable normalization of URLs with globs

2017-01-25 Thread Patrick Steinhardt
The `url_normalize` function is used to validate and normalize URLs. As such, it does not allow for some special characters to be part of the URLs that are to be normalized. As we want to allow using globs in some configuration keys making use of URLs, namely `http..`, but still normalize them, we

[PATCH v3 0/4] urlmatch: allow regexp-based matches

2017-01-25 Thread Patrick Steinhardt
Hi, This is version three of my patch series. The previous version can be found at [1]. The use case is to be able to configure an HTTP proxy for all subdomains of a domain where there are hundreds of subdomains. This version addresses a comment by Philip Oakley regarding the documentation. You

[PATCH v2] git-p4: Fix git-p4.mapUser on Windows

2017-01-25 Thread George Vanburgh
From: George Vanburgh When running git-p4 on Windows, with multiple git-p4.mapUser entries in git config - no user mappings are applied to the generated repository. Reproduction Steps: 1. Add multiple git-p4.mapUser entries to git config on a Windows machine 2.

<    1   2