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 18:11 -0700, Junio C Hamano wrote: > Ah, I see.  My immediate reaction is that you can do worse things in > the reverse direction compared to this, but your scenario does sound > bad already. Are you saying that clients connecting to untrusted servers already face worse

Re: [PATCH v1 16/19] read-cache: unlink old sharedindex files

2016-10-28 Thread Duy Nguyen
On Thu, Oct 27, 2016 at 11:13 PM, Junio C Hamano wrote: >> git-gc just can't match this because while it's running, somebody else >> may be updating $GIT_DIR/index. Handling races would be a lot harder. > > It could attempt to take a lock on the primary index while it runs, >

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

2016-10-28 Thread Junio C Hamano
Linus Torvalds writes: > Apparently windows doesn't even support it, at least not mingw Assuming that the above was a misunderstanding, assuming that we can do O_CLOEXEC (but not FD_CLOEXEC) on Windows just fine, where stray file descriptors held open in the

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

2016-10-28 Thread Junio C Hamano
Jonathan Tan writes: > 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

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

2016-10-28 Thread Junio C Hamano
Matt McCutchen writes: > Then the server generates a commit X3 that lists Y2 as a parent, even > though it doesn't have Y2, and advances 'x' to X3. The victim fetches > 'x': > >victim server > > Y1---Y2

[PATCH 3/4] trailer: have function to describe trailer layout

2016-10-28 Thread Jonathan Tan
Create a function that, taking a string, describes the position of its trailer block (if available) and the contents thereof, and make trailer use it. This makes it easier for other Git components, in the future, to interpret trailer blocks in the same way as trailer. In a subsequent patch,

[PATCH 4/4] sequencer: use trailer's trailer layout

2016-10-28 Thread Jonathan Tan
Make sequencer use trailer.c's trailer layout definition, as opposed to parsing the footer by itself. This makes "commit -s", "cherry-pick -x", and "format-patch --signoff" consistent with trailer, allowing non-trailer lines and multiple-line trailers in trailer blocks under certain conditions,

[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

[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

[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

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

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

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

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

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: [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 @@

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 >>

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

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

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 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 >

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. >

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.

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

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

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),

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 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.

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

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

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.

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

[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: "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

[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

[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

[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

[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

[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

[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

[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

[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 ---

[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

[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

[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

[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

[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

[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,

[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

[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

[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 ---

[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

[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.

[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

[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

[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,

[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 @@

[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

[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

[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

[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 +-

[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

[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

[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

[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:

[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 +++

[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 +++

[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 +++

[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

[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 @@

[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

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

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??? > >

[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

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

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

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?

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

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

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

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

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

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

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

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

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

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

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 >> +++

[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

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

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.

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

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

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

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-*

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

[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 ---

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

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 @@

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

  1   2   >