Re: [PATCH v3 2/3] sha1_file: open window into packfiles with O_CLOEXEC

2016-10-28 Thread Jeff King
On Thu, Oct 27, 2016 at 03:38:59PM -0700, Linus Torvalds wrote: > On Thu, Oct 27, 2016 at 3:24 AM, Jeff King wrote: > > > > +cc Linus as the original author of 144bde78e9 in case there is > > something subtle I'm missing, but this really just seems like it's > > an outdated optimization. > > I'd

Re: Expanding Includes in .gitignore

2016-10-28 Thread Jeff King
On Fri, Oct 28, 2016 at 11:17:26AM +1300, Aaron Pelly wrote: > On 28/10/16 10:55, Aaron Pelly wrote: > > 2) I fetch a repo with a hostile ignore file. It includes files from > > $GIT_DIR/test-data/ssl/private or some such. Change. Don't pay > > attention. Commit. Push. Problems if my test data com

Re: feature request

2016-10-28 Thread Johannes Schindelin
Hi, On Thu, 27 Oct 2016, David Lang wrote: > On Thu, 27 Oct 2016, John Rood wrote: > > > Thanks, I think changing the default for windows is a good idea. > > notepad doesn't work well with unix line endings, wordpad handles the files > much more cleanly. That is why we have a `notepad` helper

Re: [PATCH] valgrind: support test helpers

2016-10-28 Thread Johannes Schindelin
Hi, On Fri, 28 Oct 2016, René Scharfe wrote: > Tests run with --valgrind call git commands through a wrapper script > that invokes valgrind on them. This script (valgrind.sh) is in turn > invoked through symlinks created for each command in t/valgrind/bin/. > > Since e6e7530d (test helpers: mov

Re: [PATCH] attr: convert to new threadsafe API

2016-10-28 Thread Johannes Schindelin
Hi Stefan, On Thu, 27 Oct 2016, Stefan Beller wrote: > * use attr_start on Windows to dynamically initialize the Single Big Attr > Mutex I would have preferred that call in common-main.c, but whatevs... Thanks you for fixing the bug, Dscho

Re: Expanding Includes in .gitignore

2016-10-28 Thread Aaron Pelly
On 28/10/16 15:54, Junio C Hamano wrote: > Jeff King writes: > >> However, as I said elsewhere, I'm not convinced this feature is all that >> helpful for in-repository .gitignore files, and I think it does >> introduce compatibility complications. People with older git will not >> respect your .g

[PATCH] Documenation: fmt-merge-msg: fix markup in example

2016-10-28 Thread Stefan Christ
The example was not rendered as verbatim text. Fix it. Signed-off-by: Stefan Christ --- Documentation/git-fmt-merge-msg.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/git-fmt-merge-msg.txt b/Documentation/git-fmt-merge-msg.txt index 6526b17..44892c4 10

Re: [PATCH] Documenation: fmt-merge-msg: fix markup in example

2016-10-28 Thread Robert P. J. Day
"Documenation"? rday -- Robert P. J. Day Ottawa, Ontario, CANADA http://crashcourse.ca Twitter: http://twitter.com/rpjday Li

Re: [PATCH] Documenation: fmt-merge-msg: fix markup in example

2016-10-28 Thread Jeff King
On Fri, Oct 28, 2016 at 12:01:26PM +0200, Stefan Christ wrote: > diff --git a/Documentation/git-fmt-merge-msg.txt > b/Documentation/git-fmt-merge-msg.txt > index 6526b17..44892c4 100644 > --- a/Documentation/git-fmt-merge-msg.txt > +++ b/Documentation/git-fmt-merge-msg.txt > @@ -60,10 +60,10 @@ m

Re: [PATCH v3 2/3] sha1_file: open window into packfiles with O_CLOEXEC

2016-10-28 Thread Johannes Schindelin
Hi, On Thu, 27 Oct 2016, Junio C Hamano wrote: > Junio C Hamano writes: > > > Linus Torvalds writes: > > > >> On Thu, Oct 27, 2016 at 4:36 PM, Junio C Hamano wrote: > >>> > >>> Would the best endgame shape for this function be to open with > >>> O_NOATIME (and retry without), and then add CLO

[PATCH] Fix typo in 2.11.0 RelNotes

2016-10-28 Thread Henrik Ahlgren
Signed-off-by: Henrik Ahlgren --- Documentation/RelNotes/2.11.0.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/RelNotes/2.11.0.txt b/Documentation/RelNotes/2.11.0.txt index 3590620..1d3a07d 100644 --- a/Documentation/RelNotes/2.11.0.txt +++ b/Documentation/

Re: [PATCH] compat: Allow static initializer for pthreads on Windows

2016-10-28 Thread Johannes Schindelin
Hi Jake, On Thu, 27 Oct 2016, Jacob Keller wrote: > I agree with Stefan that there isn't really a great place to put a > dynamic initialization. Ummm. Wait. What??? https://github.com/git/git/blob/v2.10.1/common-main.c#L25-L41 Ciao, Johannes

Re: [PATCH] valgrind: support test helpers

2016-10-28 Thread Junio C Hamano
René Scharfe writes: > Tests run with --valgrind call git commands through a wrapper script > that invokes valgrind on them. This script (valgrind.sh) is in turn > invoked through symlinks created for each command in t/valgrind/bin/. > > Since e6e7530d (test helpers: move test-* to t/helper/ sub

Re: [PATCH] Fix typo in 2.11.0 RelNotes

2016-10-28 Thread Junio C Hamano
Henrik Ahlgren writes: > Signed-off-by: Henrik Ahlgren > --- > Documentation/RelNotes/2.11.0.txt | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/Documentation/RelNotes/2.11.0.txt > b/Documentation/RelNotes/2.11.0.txt > index 3590620..1d3a07d 100644 > --- a/Documentatio

Re: [PATCH v3 2/3] sha1_file: open window into packfiles with O_CLOEXEC

2016-10-28 Thread Junio C Hamano
Junio C Hamano writes: > Hmph. This may not fly well in practice, though. We can flip the order around, and then it becomes simpler to later drop atime support. The first step goes like this. -- >8 -- From: Junio C Hamano Date: Fri, 28 Oct 2016 06:23:07 -0700 Subject: [PATCH] git_open(): u

Re: [PATCH v3 2/3] sha1_file: open window into packfiles with O_CLOEXEC

2016-10-28 Thread Junio C Hamano
Junio C Hamano writes: > Junio C Hamano writes: > >> Hmph. This may not fly well in practice, though. > > We can flip the order around, and then it becomes simpler to later > drop atime support. The first step goes like this. And the second step would be like this. -- >8 -- Subject: [PATCH

Git crash course for SVN users - which of the 2?

2016-10-28 Thread Stefan Monov
I googled and found these two official-looking results: https://git.wiki.kernel.org/index.php/GitSvnCrashCourse https://git-scm.com/course/svn.html Which of the two should I use? And I'd ask for the other one to be deleted so there's no such further confusion for other user.

Is the entire working copy “at one branch”?

2016-10-28 Thread Stefan Monov
This is a very basic question but maybe I just don't know how to phrase my query well enough to find an answer. Let me begin with a SVN example. SVN doesn't have a "current branch" as a property of a working copy, so I'll give the example with revisions instead. Consider a working copy with the di

[PATCH v2] Documentation: fmt-merge-msg: fix markup in example

2016-10-28 Thread Stefan Christ
The example was not rendered as verbatim text. Fix it. Signed-off-by: Stefan Christ --- v2: fix misspelling in subject Hi, thanks to rday for spotting the typo in the subject line (I missed to autoenable the spell checking in vim) and thanks to Peff for the asciidoc explanation. Kind regards,

Re: [PATCH] Documenation: fmt-merge-msg: fix markup in example

2016-10-28 Thread Junio C Hamano
Jeff King writes: > On Fri, Oct 28, 2016 at 12:01:26PM +0200, Stefan Christ wrote: > >> diff --git a/Documentation/git-fmt-merge-msg.txt >> b/Documentation/git-fmt-merge-msg.txt >> index 6526b17..44892c4 100644 >> --- a/Documentation/git-fmt-merge-msg.txt >> +++ b/Documentation/git-fmt-merge-msg

Re: [PATCH] Fix typo in 2.11.0 RelNotes

2016-10-28 Thread Henrik Ahlgren
On Fri, 2016-10-28 at 06:03 -0700, Junio C Hamano wrote: > If the original text were like the following, would it have been > clear enough that prevented you from sending your patch? > > * An empty string used as a pathspec element has always meant >'everything matches', but it is too easy t

Re: [PATCH v3 2/3] sha1_file: open window into packfiles with O_CLOEXEC

2016-10-28 Thread Linus Torvalds
On Fri, Oct 28, 2016 at 4:11 AM, Johannes Schindelin wrote: > > You guys. I mean: You guys! You sure make my life hard. A brief look at > mingw.h could have answered your implicit question: So here's what you guys should do: - leave O_NOATIME damn well alone. It works. It has worked for 10+ yea

Re: feature request

2016-10-28 Thread Philip Oakley
From: "David Lang" On Thu, 27 Oct 2016, John Rood wrote: Thanks, I think changing the default for windows is a good idea. notepad doesn't work well with unix line endings, wordpad handles the files much more cleanly. David Lang Notepad++ does work well, but isn't a standard part of Win

Re: [PATCH] compat: Allow static initializer for pthreads on Windows

2016-10-28 Thread Philip Oakley
From: "Johannes Sixt" One point is that the DCLP idiom must be implemented correctly. There are solutions, of course, and when the initialization is over, we have a miniscule overhead at each pthread_mutex_lock call. I had to look up DCLP ( = Double Checked Locking Patterns), and found a

Re: [RFC PATCH 0/5] recursively grep across submodules

2016-10-28 Thread Philip Oakley
From: "Junio C Hamano" I hate it when people become overly defensive and start making excuses when given harmless observations. Hi Junio, It can sometimes be difficult for readers to appreciate which way comments are meant to be interpreted, especially as one cannot usually 'see' the issu

Re: [PATCH v3 2/3] sha1_file: open window into packfiles with O_CLOEXEC

2016-10-28 Thread Junio C Hamano
Linus Torvalds writes: > On Fri, Oct 28, 2016 at 4:11 AM, Johannes Schindelin > wrote: >> >> You guys. I mean: You guys! You sure make my life hard. A brief look at >> mingw.h could have answered your implicit question: > > So here's what you guys should do: > > - leave O_NOATIME damn well alon

Re: [RFC PATCH 0/5] recursively grep across submodules

2016-10-28 Thread Brandon Williams
On 10/27, Junio C Hamano wrote: > Brandon Williams writes: > > > As for the rest of the series, it should be ready for review or comments. > > Just a few brief comments, before reading the patches carefully. > > * It is somewhat surprising that [1/5] is even needed (in other >words, I woul

Re: [PATCH] attr: convert to new threadsafe API

2016-10-28 Thread Junio C Hamano
Stefan Beller writes: > +* Prepare a `struct git_attr_check` using `git_attr_check_initl()` >function, enumerating the names of attributes whose values you are >interested in, terminated with a NULL pointer. Alternatively, an > - empty `struct git_attr_check` can be prepared by calling

Re: [RFC PATCH 0/5] recursively grep across submodules

2016-10-28 Thread Junio C Hamano
Brandon Williams writes: >> Just a few brief comments, before reading the patches carefully. >> >> * It is somewhat surprising that [1/5] is even needed (in other >>words, I would have expected something like this to be already >>there, and my knee-jerk reaction was "Heh, how does 'git

Re: [PATCH] attr: convert to new threadsafe API

2016-10-28 Thread Junio C Hamano
Junio C Hamano writes: >> +if (check) >> +return; /* already done */ >> check = git_attr_check_alloc(); >> while (*argv) { >> struct git_attr *attr = git_attr(*argv); >> git_attr_check_append(check, attr); I thought you made git_attr() construc

Re: [PATCH v3 2/3] sha1_file: open window into packfiles with O_CLOEXEC

2016-10-28 Thread Linus Torvalds
On Fri, Oct 28, 2016 at 9:48 AM, Junio C Hamano wrote: > > Excuse me, but care to elaborate a bit more? It just seems entirely pointless to change the games with O_xyz. > Setting FD_CLOEXEC with fcntl(2) may be racy, but in what way > it is broken to open(2) with O_CLOEXEC? Apparently windows d

Re: [PATCH v3 2/3] sha1_file: open window into packfiles with O_CLOEXEC

2016-10-28 Thread Junio C Hamano
Linus Torvalds writes: > On Fri, Oct 28, 2016 at 9:48 AM, Junio C Hamano wrote: >> >> Setting FD_CLOEXEC with fcntl(2) may be racy, but in what way >> it is broken to open(2) with O_CLOEXEC? > > Apparently windows doesn't even support it, at least not mingw. So > you'll have to have some supprt

Re: [PATCH] attr: convert to new threadsafe API

2016-10-28 Thread Johannes Sixt
Am 28.10.2016 um 00:15 schrieb Stefan Beller: * use attr_start on Windows to dynamically initialize the Single Big Attr Mutex I'm sorry, I didn't find time to test the patch on Windows. I won't be back at my Windows box before Wednesday. -- Hannes

[PATCH] pre-receive.sample: Mark executable

2016-10-28 Thread Anders Kaseorg
For consistency with other hooks, allow the hook to be activated by renaming pre-receive.sample to pre-receive without a separate step to mark it executable. Signed-off-by: Anders Kaseorg --- templates/hooks--pre-receive.sample | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 10

Re: [PATCH] compat: Allow static initializer for pthreads on Windows

2016-10-28 Thread Jacob Keller
On Fri, Oct 28, 2016 at 4:58 AM, Johannes Schindelin wrote: > Hi Jake, > > On Thu, 27 Oct 2016, Jacob Keller wrote: > >> I agree with Stefan that there isn't really a great place to put a >> dynamic initialization. > > Ummm. Wait. What??? > > https://github.com/git/git/blob/v2.10.1/common-main.c#L

Re: [PATCH] compat: Allow static initializer for pthreads on Windows

2016-10-28 Thread Jacob Keller
On Fri, Oct 28, 2016 at 6:01 AM, Philip Oakley wrote: > From: "Johannes Sixt" >> >> >> One point is that the DCLP idiom must be implemented correctly. There are >> solutions, of course, and when the initialization is over, we have a >> miniscule overhead at each pthread_mutex_lock call. >> > > I

[PATCHv2 00/36] Revamp the attr subsystem!

2016-10-28 Thread Stefan Beller
previous discussion at https://public-inbox.org/git/20161022233225.8883-1-sbel...@google.com This implements the discarded series': jc/attr jc/attr-more sb/pathspec-label sb/submodule-default-paths This includes * The fixes for windows * Junios latest suggestion to use git_attr_check_initv inste

[PATCHv2 03/36] attr.c: update a stale comment on "struct match_attr"

2016-10-28 Thread Stefan Beller
From: Junio C Hamano When 82dce998 (attr: more matching optimizations from .gitignore, 2012-10-15) changed a pointer to a string "*pattern" into an embedded "struct pattern" in struct match_attr, it forgot to update the comment that describes the structure. Signed-off-by: Junio C Hamano Signed-

[PATCHv2 05/36] attr.c: complete a sentence in a comment

2016-10-28 Thread Stefan Beller
From: Junio C Hamano Signed-off-by: Junio C Hamano Signed-off-by: Stefan Beller --- attr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/attr.c b/attr.c index 6b55a57ef7..9bdf87a6fe 100644 --- a/attr.c +++ b/attr.c @@ -300,7 +300,7 @@ static struct match_attr *parse_attr_

[PATCHv2 06/36] attr.c: mark where #if DEBUG ends more clearly

2016-10-28 Thread Stefan Beller
From: Junio C Hamano Signed-off-by: Junio C Hamano Signed-off-by: Stefan Beller --- attr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/attr.c b/attr.c index 9bdf87a6fe..17297fffee 100644 --- a/attr.c +++ b/attr.c @@ -469,7 +469,7 @@ static void debug_set(const char *wha

[PATCHv2 02/36] attr.c: use strchrnul() to scan for one line

2016-10-28 Thread Stefan Beller
From: Junio C Hamano Signed-off-by: Junio C Hamano Signed-off-by: Stefan Beller --- attr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/attr.c b/attr.c index 1fcf042b87..04d24334e8 100644 --- a/attr.c +++ b/attr.c @@ -402,8 +402,8 @@ static struct attr_stack *read_at

[PATCHv2 01/36] commit.c: use strchrnul() to scan for one line

2016-10-28 Thread Stefan Beller
From: Junio C Hamano Signed-off-by: Junio C Hamano Signed-off-by: Stefan Beller --- commit.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/commit.c b/commit.c index 856fd4aeef..41b2fdd335 100644 --- a/commit.c +++ b/commit.c @@ -415,8 +415,7 @@ int find_commit_subject(c

[PATCHv2 04/36] attr.c: explain the lack of attr-name syntax check in parse_attr()

2016-10-28 Thread Stefan Beller
From: Junio C Hamano Signed-off-by: Junio C Hamano Signed-off-by: Stefan Beller --- attr.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/attr.c b/attr.c index 007f1a2995..6b55a57ef7 100644 --- a/attr.c +++ b/attr.c @@ -183,6 +183,12 @@ static const char *parse_attr(const char *src,

[PATCHv2 23/36] attr.c: introduce empty_attr_check_elems()

2016-10-28 Thread Stefan Beller
From: Junio C Hamano One codepath needs to just empty the git_attr_check_elem array in the git_attr_check structure, without releasing the entire resource. Introduce a helper to do so and rewrite git_attr_check_clear() using it. Signed-off-by: Junio C Hamano Signed-off-by: Stefan Beller --- a

[PATCHv2 20/36] attr.c: pass struct git_attr_check down the callchain

2016-10-28 Thread Stefan Beller
From: Junio C Hamano The callchain that starts from git_check_attrs() down to collect_some_attrs() used to take an array of git_attr_check_elem as their parameters. Pass the enclosing git_attr_check instance instead, so that they will have access to new fields we will add to the data structure.

[PATCHv2 08/36] attr.c: tighten constness around "git_attr" structure

2016-10-28 Thread Stefan Beller
From: Junio C Hamano It holds an interned string, and git_attr_name() is a way to peek into it. Make sure the involved pointer types are pointer-to-const. Signed-off-by: Junio C Hamano Signed-off-by: Stefan Beller --- attr.c | 2 +- attr.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deleti

[PATCHv2 32/36] pathspec: allow querying for attributes

2016-10-28 Thread Stefan Beller
The pathspec mechanism is extended via the new ":(attr:eol=input)pattern/to/match" syntax to filter paths so that it requires paths to not just match the given pattern but also have the specified attrs attached for them to be chosen. Signed-off-by: Stefan Beller Signed-off-by: Junio C Hamano ---

[PATCHv2 10/36] attr: rename function and struct related to checking attributes

2016-10-28 Thread Stefan Beller
From: Junio C Hamano The traditional API to check attributes is to prepare an N-element array of "struct git_attr_check" and pass N and the array to the function "git_check_attr()" as arguments. In preparation to revamp the API to pass a single structure, in which these N elements are held, rena

[PATCHv2 16/36] attr: add counted string version of git_attr()

2016-10-28 Thread Stefan Beller
From: Junio C Hamano Often a potential caller has pair that represents the name it wants to create an attribute out of. When name[namelen] is not NUL, the caller has to xmemdupz() only to call git_attr(). Add git_attr_counted() that takes such a counted string instead of "const char *name". S

[PATCHv2 21/36] attr.c: rename a local variable check

2016-10-28 Thread Stefan Beller
From: Junio C Hamano Throughout this series, we are trying to use "check" to name an instance of "git_attr_check" structure; let's rename a "check" that refers to an array whose elements are git_attr_check_elem to avoid confusion. Signed-off-by: Junio C Hamano Signed-off-by: Stefan Beller ---

[PATCHv2 19/36] attr.c: add push_stack() helper

2016-10-28 Thread Stefan Beller
From: Junio C Hamano There are too many repetitious "I have this new attr_stack element; push it at the top of the stack" sequence. The new helper function push_stack() gives us a way to express what is going on at these places, and as a side effect, halves the number of times we mention the att

[PATCHv2 33/36] pathspec: allow escaped query values

2016-10-28 Thread Stefan Beller
In our own .gitattributes file we have attributes such as: *.[ch] whitespace=indent,trail,space When querying for attributes we want to be able to ask for the exact value, i.e. git ls-files :(attr:whitespace=indent,trail,space) should work, but the commas are used in the attr magic to i

[PATCHv2 27/36] attr: convert to new threadsafe API

2016-10-28 Thread Stefan Beller
This revamps the API of the attr subsystem to be thread safe. Before we had the question and its results in one struct type. The typical usage of the API was static struct git_attr_check *check; if (!check) check = git_attr_check_initl("text", NULL); git_check_attr(path, chec

[PATCHv2 26/36] attr: make git_check_attr_counted static

2016-10-28 Thread Stefan Beller
It's not used outside the attr code, so let's keep it private. Signed-off-by: Stefan Beller --- attr.c | 4 ++-- attr.h | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/attr.c b/attr.c index 10f2042fbb..9f2da42e5f 100644 --- a/attr.c +++ b/attr.c @@ -896,8 +896,8 @@ void git

[PATCHv2 30/36] pathspec: move long magic parsing out of prefix_pathspec

2016-10-28 Thread Stefan Beller
`prefix_pathspec` is quite a lengthy function and we plan on adding more. Split it up for better readability. As we want to add code into the inner loop of the long magic parsing, we also benefit from lower indentation. Signed-off-by: Stefan Beller Signed-off-by: Junio C Hamano --- pathspec.c |

[PATCHv2 36/36] completion: clone can initialize specific submodules

2016-10-28 Thread Stefan Beller
Signed-off-by: Stefan Beller --- contrib/completion/git-completion.bash | 1 + 1 file changed, 1 insertion(+) diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index 21016bf8df..90eb772652 100644 --- a/contrib/completion/git-completion.bash +++ b/contr

[PATCHv2 31/36] pathspec: move prefix check out of the inner loop

2016-10-28 Thread Stefan Beller
The prefix check is not related the check of pathspec magic; also there is no code that is relevant after we'd break the loop on a match for "prefix:". So move the check before the loop and shortcircuit the outer loop. Signed-off-by: Stefan Beller Signed-off-by: Junio C Hamano --- pathspec.c |

[PATCHv2 17/36] attr: expose validity check for attribute names

2016-10-28 Thread Stefan Beller
From: Junio C Hamano Export attr_name_valid() function, and a helper function that returns the message to be given when a given pair is not a good name for an attribute. We could later update the message to exactly spell out what the rules for a good attribute name are, etc. Signed-off-by: Jun

[PATCHv2 09/36] attr.c: plug small leak in parse_attr_line()

2016-10-28 Thread Stefan Beller
From: Junio C Hamano If any error is noticed after the match_attr structure is allocated, we shouldn't just return NULL from this function. Add a fail_return label that frees the allocated structure and returns NULL, and consistently jump there when we want to return NULL after cleaning up. Sig

[PATCHv2 25/36] attr.c: outline the future plans by heavily commenting

2016-10-28 Thread Stefan Beller
From: Junio C Hamano Signed-off-by: Junio C Hamano Signed-off-by: Stefan Beller --- attr.c | 40 +++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/attr.c b/attr.c index 92b3130f1e..10f2042fbb 100644 --- a/attr.c +++ b/attr.c @@ -30,6 +30,11

[PATCHv2 15/36] attr: add counted string version of git_check_attr()

2016-10-28 Thread Stefan Beller
From: Junio C Hamano Often a potential caller has pair that represents the path it wants to ask attributes for; when path[pathlen] is not NUL, the caller has to xmemdupz() only to call git_check_attr(). Add git_check_attr_counted() that takes such a counted string instead of "const char *path".

[PATCHv2 24/36] attr.c: always pass check[] to collect_some_attrs()

2016-10-28 Thread Stefan Beller
From: Junio C Hamano This function used to be called with check=NULL to signal it to collect all attributes in the global check_all_attr[] array. Because the longer term plan is to allocate check_all_attr[] and attr_stack data structures per git_attr_check instance (i.e. "check" here) to make th

[PATCHv2 18/36] attr: support quoting pathname patterns in C style

2016-10-28 Thread Stefan Beller
From: Nguyễn Thái Ngọc Duy Full pattern must be quoted. So 'pat"t"ern attr' will give exactly 'pat"t"ern', not 'pattern'. Also clarify that leading whitespaces are not part of the pattern and document comment syntax. Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano Signed-off-

[PATCHv2 14/36] attr: retire git_check_attrs() API

2016-10-28 Thread Stefan Beller
From: Junio C Hamano Since nobody uses the old API, make it file-scope static, and update the documentation to describe the new API. Signed-off-by: Junio C Hamano Signed-off-by: Stefan Beller --- Documentation/technical/api-gitattributes.txt | 82 ++- attr.c

[PATCHv2 28/36] attr: keep attr stack for each check

2016-10-28 Thread Stefan Beller
Instead of having a global attr stack, attach the stack to each check. This allows to use the attr in a multithreaded way. Signed-off-by: Stefan Beller --- attr.c| 101 +++--- attr.h| 4 ++- hashmap.h | 2 ++ 3 files changed,

[PATCHv2 34/36] submodule update: add `--init-default-path` switch

2016-10-28 Thread Stefan Beller
The new switch `--init-default-path` initializes the submodules which are configured in `submodule.defaultUpdatePath` instead of those given as command line arguments before updating. In the first implementation this is made incompatible with further command line arguments as it is unclear what the

[PATCHv2 07/36] attr.c: simplify macroexpand_one()

2016-10-28 Thread Stefan Beller
From: Junio C Hamano The double-loop wants to do an early return immediately when one matching macro is found. Eliminate the extra variable 'a' used for that purpose and rewrite the "assign the found item to 'a' to make it non-NULL and force the loop(s) to terminate" with a direct return from th

[PATCHv2 29/36] Documentation: fix a typo

2016-10-28 Thread Stefan Beller
Signed-off-by: Stefan Beller Signed-off-by: Junio C Hamano --- Documentation/gitattributes.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/gitattributes.txt b/Documentation/gitattributes.txt index 8a061af0cc..5b317971c0 100644 --- a/Documentation/gitattribut

[PATCHv2 13/36] attr: convert git_check_attrs() callers to use the new API

2016-10-28 Thread Stefan Beller
From: Junio C Hamano The remaining callers are all simple "I have N attributes I am interested in. I'll ask about them with various paths one by one". After this step, no caller to git_check_attrs() remains. After removing it, we can extend "struct git_attr_check" struct with data that can be

[PATCHv2 35/36] clone: add --init-submodule= switch

2016-10-28 Thread Stefan Beller
The new switch passes the pathspec to `git submodule update --init` which is called after the actual clone is done. Additionally this configures the submodule.defaultUpdatePath to be the given pathspec, such that any future invocation of `git submodule update --init-default-paths` will keep up wit

[PATCHv2 22/36] attr.c: correct ugly hack for git_all_attrs()

2016-10-28 Thread Stefan Beller
From: Junio C Hamano The collect_some_attrs() function has an ugly hack since 06a604e6 (attr: avoid heavy work when we know the specified attr is not defined, 2014-12-28) added an optimization that relies on the fact that the caller knows what attributes it is interested in, so that we can leave

[PATCHv2 11/36] attr: (re)introduce git_check_attr() and struct git_attr_check

2016-10-28 Thread Stefan Beller
From: Junio C Hamano A common pattern to check N attributes for many paths is to (1) prepare an array A of N git_attr_check_elem items; (2) call git_attr() to intern the N attribute names and fill A; (3) repeatedly call git_check_attrs() for path with N and A; A look-up for these N attribute

[PATCHv2 12/36] attr: convert git_all_attrs() to use "struct git_attr_check"

2016-10-28 Thread Stefan Beller
From: Junio C Hamano This updates the other two ways the attribute check is done via an array of "struct git_attr_check_elem" elements. These two niches appear only in "git check-attr". * The caller does not know offhand what attributes it wants to ask about and cannot use git_attr_check_in

Re: "git push" says "src refspec XYZ matches more than one" even without explicit XYZ argument.

2016-10-28 Thread Junio C Hamano
Kannan Goundan writes: > 1. My repo has a branch named 'v1' that is tracking 'origin/v1'. > 2. My repo has a tag named 'v1'. > 3. I have "push.default" set to "upstream". > > I made a commit on branch 'v1' and tried doing a push: > > # git push > error: src refspec v1 matches more than on

[PATCH] push: do not use potentially ambiguous default refspec

2016-10-28 Thread Junio C Hamano
When the user does the lazy "git push" with no parameters with push.default set to either "upstream", "simple" or "current", we internally generated a refspec that has the current branch name on the source side and used it to push. However, the branch name (say "test") may be an ambiguous refname

Re: [PATCH 5/5] grep: enable recurse-submodules to work on objects

2016-10-28 Thread Brandon Williams
On 10/27, Brandon Williams wrote: > diff --git a/tree-walk.c b/tree-walk.c > index 828f4356b..b3f996174 100644 > --- a/tree-walk.c > +++ b/tree-walk.c > @@ -999,10 +999,11 @@ static enum interesting do_match(const struct > name_entry *entry, > return entry_int

Re: [PATCH] compat: Allow static initializer for pthreads on Windows

2016-10-28 Thread Johannes Sixt
Am 28.10.2016 um 20:48 schrieb Jacob Keller: On Fri, Oct 28, 2016 at 4:58 AM, Johannes Schindelin wrote: Hi Jake, On Thu, 27 Oct 2016, Jacob Keller wrote: I agree with Stefan that there isn't really a great place to put a dynamic initialization. Ummm. Wait. What??? https://github.com/git/

Re: [PATCH] compat: Allow static initializer for pthreads on Windows

2016-10-28 Thread Junio C Hamano
Johannes Sixt writes: > Another problem with the proposed patch is that there is no > declaration for attr_start() before the call in compat/mingw.c. We > would have to move the declaration of attr_start() to cache.h (for > example), because #including attr.h in compat/mingw.c is plainly > wrong.

Re: [PATCH] compat: Allow static initializer for pthreads on Windows

2016-10-28 Thread Stefan Beller
On Fri, Oct 28, 2016 at 1:29 PM, Junio C Hamano wrote: > Johannes Sixt writes: > >> Another problem with the proposed patch is that there is no >> declaration for attr_start() before the call in compat/mingw.c. We >> would have to move the declaration of attr_start() to cache.h (for >> example),

Re: [PATCH] compat: Allow static initializer for pthreads on Windows

2016-10-28 Thread Junio C Hamano
Stefan Beller writes: > On Fri, Oct 28, 2016 at 1:29 PM, Junio C Hamano wrote: >> Johannes Sixt writes: >> >>> Another problem with the proposed patch is that there is no >>> declaration for attr_start() before the call in compat/mingw.c. We >>> would have to move the declaration of attr_start(

Can't get git to stop outputting to StdErr

2016-10-28 Thread Scott R. Chamberlain
I am working on some build scripts that get run on TFS. During the build process I need to check in the changes that where done during the build process (A set of binaries other projects depend on). I would really like to leave the option "Fail on Standard Error" enabled for the script in TFS,

Re: [PATCH] compat: Allow static initializer for pthreads on Windows

2016-10-28 Thread Johannes Sixt
Am 28.10.2016 um 22:29 schrieb Junio C Hamano: Johannes Sixt writes: Another problem with the proposed patch is that there is no declaration for attr_start() before the call in compat/mingw.c. We would have to move the declaration of attr_start() to cache.h (for example), because #including at

Re: [PATCH] compat: Allow static initializer for pthreads on Windows

2016-10-28 Thread Junio C Hamano
Johannes Sixt writes: > Am 28.10.2016 um 22:29 schrieb Junio C Hamano: >> Johannes Sixt writes: >> >>> Another problem with the proposed patch is that there is no >>> declaration for attr_start() before the call in compat/mingw.c. We >>> would have to move the declaration of attr_start() to cach

Re: Can't get git to stop outputting to StdErr

2016-10-28 Thread Junio C Hamano
"Scott R. Chamberlain" writes: > The line I do is: > > git push -q binaryRepo HEAD:"$Env:BUILD_SOURCEBRANCH" This would (1) squelch the output from the sending side (i.e. local), and (2) ask "quiet" to the receiving side (i.e. remote), if they know how to be quiet. > But I get the

RE: Can't get git to stop outputting to StdErr

2016-10-28 Thread Scott R. Chamberlain
This is talking to a visualstudio.com git repo. I will file a bug with them. Scott Chamberlain Software Engineer ImproMed, LLC (800) 925-7171 www.impromed.com -Original Message- From: Junio C Hamano [mailto:gits...@pobox.com] Sent: Friday, October 28, 2016 4:07 PM To: Scott R. Chamberl

Re: [PATCH] pre-receive.sample: Mark executable

2016-10-28 Thread Junio C Hamano
Anders Kaseorg writes: > For consistency with other hooks, allow the hook to be activated by > renaming pre-receive.sample to pre-receive without a separate step to > mark it executable. > > Signed-off-by: Anders Kaseorg > --- Makes sense. Thanks. > templates/hooks--pre-receive.sample | 0 >

Re: [PATCHv2 28/36] attr: keep attr stack for each check

2016-10-28 Thread Junio C Hamano
Stefan Beller writes: > Instead of having a global attr stack, attach the stack to each check. > This allows to use the attr in a multithreaded way. > > > > Signed-off-by: Stefan Beller > --- > attr.c| 101 > +++--- > attr.h| 4

Fetch/push lets a malicious server steal the targets of "have" lines

2016-10-28 Thread Matt McCutchen
I was studying the fetch protocol and I realized that in a scenario in which a client regularly fetches a set of refs from a server and pushes them back without careful scrutiny, the server can steal the targets of unrelated refs from the client repository by fabricating its own refs to the "have"

Re: [PATCHv2 00/36] Revamp the attr subsystem!

2016-10-28 Thread Junio C Hamano
Stefan Beller writes: > previous discussion at > https://public-inbox.org/git/20161022233225.8883-1-sbel...@google.com > > This implements the discarded series': > jc/attr > jc/attr-more > sb/pathspec-label > sb/submodule-default-paths > > This includes > * The fixes for windows > * Junios lates

Re: Fetch/push lets a malicious server steal the targets of "have" lines

2016-10-28 Thread Junio C Hamano
Matt McCutchen writes: > I was studying the fetch protocol and I realized that in a scenario in > which a client regularly fetches a set of refs from a server and pushes > them back without careful scrutiny, the server can steal the targets of > unrelated refs from the client repository by fabric

Re: [PATCHv2 00/36] Revamp the attr subsystem!

2016-10-28 Thread Stefan Beller
On Fri, Oct 28, 2016 at 2:43 PM, Junio C Hamano wrote: > Stefan Beller writes: > >> previous discussion at >> https://public-inbox.org/git/20161022233225.8883-1-sbel...@google.com >> >> This implements the discarded series': >> jc/attr >> jc/attr-more >> sb/pathspec-label >> sb/submodule-default

Re: [PATCHv2 27/36] attr: convert to new threadsafe API

2016-10-28 Thread Junio C Hamano
Probably this needs to be squashed in, now the MinGW discussion has settled. attr.c | 2 +- common-main.c | 2 ++ compat/mingw.c | 4 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/attr.c b/attr.c index 082b5ed343..961218a0d5 100644 --- a/attr.c +++ b/attr.c @@ -50,7

Re: [PATCHv2 27/36] attr: convert to new threadsafe API

2016-10-28 Thread Stefan Beller
On Fri, Oct 28, 2016 at 3:06 PM, Junio C Hamano wrote: > Probably this needs to be squashed in, now the MinGW discussion has > settled. I was about to propose this (and resend it non-rebased). So I do not resend, but rather ask you to squash this patch? Thanks, Stefan

Re: Fetch/push lets a malicious server steal the targets of "have" lines

2016-10-28 Thread Matt McCutchen
On Fri, 2016-10-28 at 15:00 -0700, Junio C Hamano wrote: > Let me see if I understood your scenario correctly. > > Suppose we start from this history where 'O' are common, your victim > has a 'Y' branch with two commits that are private to it, as well as > a 'X' branch on which it has X1 that it p

Re: [PATCHv2 27/36] attr: convert to new threadsafe API

2016-10-28 Thread Junio C Hamano
Stefan Beller writes: > On Fri, Oct 28, 2016 at 3:06 PM, Junio C Hamano wrote: >> Probably this needs to be squashed in, now the MinGW discussion has >> settled. > > I was about to propose this (and resend it non-rebased). > > So I do not resend, but rather ask you to squash this patch? That's

Re: [PATCH] Documenation: fmt-merge-msg: fix markup in example

2016-10-28 Thread Stefan Christ
Hi, On Fri, Oct 28, 2016 at 08:15:57AM -0700, Junio C Hamano wrote: > Jeff King writes: > > > On Fri, Oct 28, 2016 at 12:01:26PM +0200, Stefan Christ wrote: > > > >> diff --git a/Documentation/git-fmt-merge-msg.txt > >> b/Documentation/git-fmt-merge-msg.txt > >> index 6526b17..44892c4 100644 >

Re: [PATCHv2 00/36] Revamp the attr subsystem!

2016-10-28 Thread Ramsay Jones
On 28/10/16 19:54, Stefan Beller wrote: > previous discussion at > https://public-inbox.org/git/20161022233225.8883-1-sbel...@google.com > > This implements the discarded series': > jc/attr > jc/attr-more > sb/pathspec-label > sb/submodule-default-paths > > This includes > * The fixes for wind

[PATCH 1/4] commit: make ignore_non_trailer take buf/len

2016-10-28 Thread Jonathan Tan
Make ignore_non_trailer take a buf/len pair instead of struct strbuf. Signed-off-by: Jonathan Tan --- builtin/commit.c | 2 +- commit.c | 22 +++--- commit.h | 2 +- trailer.c| 2 +- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/built

[PATCH 2/4] trailer: avoid unnecessary splitting on lines

2016-10-28 Thread Jonathan Tan
trailer.c currently splits lines while processing a buffer (and also rejoins lines when needing to invoke ignore_non_trailer). Avoid such line splitting, except when generating the strings corresponding to trailers (for ease of use by clients - a subsequent patch will allow other components to obt

[PATCH 0/4] Make other git commands use trailer layout

2016-10-28 Thread Jonathan Tan
This is built off jt/trailer-with-cruft (commit 60ef86a). This patch set makes "commit -s", "cherry-pick -x", and "format-patch --signoff" use the new trailer definition implemented in jt/trailer-with-cruft, with some refactoring along the way. With this patch set, the aforementioned commands woul

  1   2   >