Re: [PATCH v6 0/4] Add --base option to git-format-patch to record base tree info

2016-04-27 Thread Ye Xiaolong
On Tue, Apr 26, 2016 at 11:58:39AM -0700, Junio C Hamano wrote: >Stefan Beller writes: > >>> So from where are you proposing Git to grab that information if you >>> do not tell it? "If the HEAD is detached, assume that the base is >>> where it was detached from" or something? >> >> That would als

Re: [PATCH] http: Support sending custom HTTP headers

2016-04-27 Thread Jeff King
On Wed, Apr 27, 2016 at 08:31:50AM +0200, Johannes Schindelin wrote: > > +test_expect_success 'custom http headers' ' > > + test_must_fail git fetch "$HTTPD_URL/smart_headers/repo.git" && > > + git -c http.extraheader="x-magic-one: abra" \ > > + -c http.extraheader="x-magic-two: cadabra"

Strangeness with git-add and nested repositories

2016-04-27 Thread Andrew J
I've noticed some strangeness with git-add and nested repos. This tar.gz has a reproduction script, parent repo, and nested repo that exhibits the issue: https://drive.google.com/uc?export=download&id=0Bwjufq6oAZMfcGVxZ2dlMElEVlE If you extract the archive and do the following (on linux please, I

using git-difftool -d when cherry-picking

2016-04-27 Thread Jan Smets
Hi Please consider following example #!/bin/bash rm -rf /tmp/gittest mkdir /tmp/gittest cd /tmp/gittest git init echo $RANDOM > testfile git add testfile git commit -m test -a git branch X git checkout X echo $RANDOM > testfile git add testfile git commit -m test -a git checkout master echo $

Re: [PATCH] Move test-* to t/helper/ subdirectory

2016-04-27 Thread Duy Nguyen
On Wed, Apr 27, 2016 at 07:52:41AM +0700, Duy Nguyen wrote: > > Can you (or somebody else) double check that the resulting Makefile > > gets the build dependencies and exec path right? > > > > I am seeing occasional failure from t0040 when checking out between > > master and pu, and between the bra

Re: [PATCH] http: Support sending custom HTTP headers

2016-04-27 Thread Johannes Schindelin
Hi Peff, On Wed, 27 Apr 2016, Jeff King wrote: > On Wed, Apr 27, 2016 at 08:31:50AM +0200, Johannes Schindelin wrote: > > > > +test_expect_success 'custom http headers' ' > > > + test_must_fail git fetch "$HTTPD_URL/smart_headers/repo.git" && > > > + git -c http.extraheader="x-magic-one: abra" \

Re: [PATCH 45/83] builtin/apply: move 'state' init into init_apply_state()

2016-04-27 Thread Christian Couder
On Mon, Apr 25, 2016 at 9:32 AM, Eric Sunshine wrote: > On Sun, Apr 24, 2016 at 9:33 AM, Christian Couder > wrote: >> Signed-off-by: Christian Couder >> --- >> diff --git a/builtin/apply.c b/builtin/apply.c >> @@ -4670,6 +4670,28 @@ static int option_parse_directory(const struct option >> *opt,

Re: [PATCH 22/83] builtin/apply: move 'unsafe_paths' global into 'struct apply_state'

2016-04-27 Thread Christian Couder
On Tue, Apr 26, 2016 at 10:27 PM, Junio C Hamano wrote: > Christian Couder writes: > >> Signed-off-by: Christian Couder >> --- >> builtin/apply.c | 9 + >> 1 file changed, 5 insertions(+), 4 deletions(-) >> >> diff --git a/builtin/apply.c b/builtin/apply.c >> index 506357c..c45e481 1006

[PATCH v4] http: support sending custom HTTP headers

2016-04-27 Thread Johannes Schindelin
We introduce a way to send custom HTTP headers with all requests. This allows us, for example, to send an extra token from build agents for temporary access to private repositories. (This is the use case that triggered this patch.) This feature can be used like this: git -c http.extrahea

Re: What's cooking in git.git (Apr 2016, #07; Mon, 25)

2016-04-27 Thread Johannes Schindelin
Hi Junio, On Mon, 25 Apr 2016, Junio C Hamano wrote: > * js/win32-mmap (2016-04-22) 3 commits > (merged to 'next' on 2016-04-22 at cd39c60) > + mmap(win32): avoid expensive fstat() call > + mmap(win32): avoid copy-on-write when it is unnecessary > + win32mmap: set errno appropriately > > m

Re: [PATCH 27/83] builtin/apply: move 'read_stdin' global into cmd_apply()

2016-04-27 Thread Christian Couder
On Tue, Apr 26, 2016 at 10:28 PM, Junio C Hamano wrote: > Christian Couder writes: > >> Signed-off-by: Christian Couder >> --- >> builtin/apply.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) > > Makes sense but do so immediately next to 06/83, "options" thing? Ok, in the next rerol

Re: [PATCH 39/83] builtin/apply: move 'ws_error_action' into 'struct apply_state'

2016-04-27 Thread Christian Couder
On Tue, Apr 26, 2016 at 10:36 PM, Junio C Hamano wrote: > Christian Couder writes: > >> +enum ws_error_action { >> + nowarn_ws_error, >> + warn_on_ws_error, >> + die_on_ws_error, >> + correct_ws_error >> +}; >> + >> struct apply_state { >> const char *prefix; >> int p

Re: [PATCH 05/83] builtin/apply: extract line_by_line_fuzzy_match() from match_fragment()

2016-04-27 Thread Christian Couder
On Tue, Apr 26, 2016 at 10:20 PM, Junio C Hamano wrote: > Christian Couder writes: > >>> It's not clear why we need to declare buf here? Oh wait it is. It's just >>> moved from the start of the function. But why do it in this patch? >>> It seems unrelated to the general intent of the patch. No ne

[RFC/PATCH] git-multimail: update to release 1.3.0-rc1

2016-04-27 Thread Matthieu Moy
The changes are described in CHANGES. Contributions-by: Matthieu Moy Contributions-by: Stefan Tatschner Contributions-by: Simon P Contributions-by: Leander Hasty Signed-off-by: Matthieu Moy --- Not for inclusion, but tests and reviews welcome. contrib/hooks/multimail/CHANGES

Re: [PATCH v6 0/4] Add --base option to git-format-patch to record base tree info

2016-04-27 Thread Junio C Hamano
Ye Xiaolong writes: > On Tue, Apr 26, 2016 at 11:58:39AM -0700, Junio C Hamano wrote: > >>Let's hear from folks at Intel ;-) Both of the above sounds like >>sensible enhancements to me. > > Shall I squash these enhancements in this series, or I need to make > another patch for them? The update b

Re: [PATCH/RFC 4/6] transport: add refspec list parameters to functions

2016-04-27 Thread Junio C Hamano
Jeff King writes: > If the plan is something like: > > 1. v2 exists, but client/server don't know when they should use it. > > 2. smart-http grows an extra parameter for the client to say "hey, I > know v2" > > 3. Other protocols get some manual v2 support (e.g., client asks for >

Re: [PATCH 2/2] merge: warn --no-commit merge when no new commit is created

2016-04-27 Thread Junio C Hamano
Johannes Schindelin writes: > I am not sure about this double negation "no_commit_impossible" (I only > understood what you meant because I had read the commit message first, > something I won't do when stumbling over this code later). > > Maybe something like `disallow_no_commit`? That would be

Re: [PATCH 1/2] merge: do not contaminate option_commit with --squash

2016-04-27 Thread Junio C Hamano
Johannes Schindelin writes: >> * Just a preliminary clean-up for the next one which is on topic. > > I think it would make for a nice cleanup anyways. There is a missing open-brace that causes a compilation error, though ;-) -- To unsubscribe from this list: send the line "unsubscribe git" in t

[PATCH] mingw: make isatty() recognize MSYS2's pseudo terminals (/dev/pty*)

2016-04-27 Thread Johannes Schindelin
From: Karsten Blees MSYS2 emulates pseudo terminals via named pipes, and isatty() returns 0 for such file descriptors. Therefore, some interactive functionality (such as launching a pager, asking if a failed unlink should be repeated etc.) doesn't work when run in a terminal emulator that uses MS

Re: [PATCH 1/2] merge: do not contaminate option_commit with --squash

2016-04-27 Thread Johannes Schindelin
Hi Junio, On Wed, 27 Apr 2016, Junio C Hamano wrote: > Johannes Schindelin writes: > > >> * Just a preliminary clean-up for the next one which is on topic. > > > > I think it would make for a nice cleanup anyways. > > There is a missing open-brace that causes a compilation error, > though ;-)

Re: [PATCH 22/83] builtin/apply: move 'unsafe_paths' global into 'struct apply_state'

2016-04-27 Thread Junio C Hamano
Christian Couder writes: > The reason I added some blank lines is that I moved comments that were > all in one block at the top. > I moved each comment near the related variables and sometimes a > comment is related to 2 variables, like in the extract below the > comment that starts with "For "di

Re: [PATCH 2/2] merge: warn --no-commit merge when no new commit is created

2016-04-27 Thread Johannes Schindelin
Hi Junio, On Wed, 27 Apr 2016, Junio C Hamano wrote: > Johannes Schindelin writes: > > > I am not sure about this double negation "no_commit_impossible" (I only > > understood what you meant because I had read the commit message first, > > something I won't do when stumbling over this code late

Re: [PATCH v6 0/4] Add --base option to git-format-patch to record base tree info

2016-04-27 Thread Stefan Beller
On Wed, Apr 27, 2016 at 8:04 AM, Junio C Hamano wrote: > Ye Xiaolong writes: > >> On Tue, Apr 26, 2016 at 11:58:39AM -0700, Junio C Hamano wrote: >> >>>Let's hear from folks at Intel ;-) Both of the above sounds like >>>sensible enhancements to me. >> >> Shall I squash these enhancements in this

Re: [PATCH 47/83] builtin/apply: move applying patches into apply_all_patches()

2016-04-27 Thread Christian Couder
On Tue, Apr 26, 2016 at 12:00 AM, Stefan Beller wrote: > On Sun, Apr 24, 2016 at 6:33 AM, Christian Couder > wrote: >> Signed-off-by: Christian Couder > > Up to this patch, have a > Reviewed-by: Stefan Beller > in case you want to split the series in here (as indicated in the > cover letter, th

Re: [PATCH 2/2] merge: warn --no-commit merge when no new commit is created

2016-04-27 Thread Junio C Hamano
Johannes Schindelin writes: >> > Maybe something like `disallow_no_commit`? >> >> That would be the best name once we start dying in there. It might >> be still better, even while we merely warn but let it pass, than the >> double negative. Or it may not. I dunno. > > Actually, I should admit

Re: Strangeness with git-add and nested repositories

2016-04-27 Thread Stefan Beller
On Wed, Apr 27, 2016 at 1:31 AM, Andrew J wrote: > I've noticed some strangeness with git-add and nested repos. > > This tar.gz has a reproduction script, parent repo, and nested repo > that exhibits the issue: > https://drive.google.com/uc?export=download&id=0Bwjufq6oAZMfcGVxZ2dlMElEVlE > > If yo

BUG on OSX `git p4 submit` can fail when the workspace root doesn't exist locally.

2016-04-27 Thread Jacob Smith
On OS X, if the local p4 workspace root doesn't exist, then git-p4 can fail on submit. The error message looks like this: Synchronizing p4 checkout... Git submit failed! shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory

Re: [PATCH] Move test-* to t/helper/ subdirectory

2016-04-27 Thread Junio C Hamano
Duy Nguyen writes: > This patch forces bin-wrappers regeneration every time a test program > is updated. A bit wasteful, but I don't see a better option (which is > also why I limit this to test programs only). In other words, when we update the location where the programs that would be eventual

Re: What's cooking in git.git (Apr 2016, #07; Mon, 25)

2016-04-27 Thread Junio C Hamano
Johannes Schindelin writes: > Hi Junio, > > On Mon, 25 Apr 2016, Junio C Hamano wrote: > >> * js/win32-mmap (2016-04-22) 3 commits >> (merged to 'next' on 2016-04-22 at cd39c60) >> + mmap(win32): avoid expensive fstat() call >> + mmap(win32): avoid copy-on-write when it is unnecessary >> + w

Re: [PATCH 03/83] builtin/apply: avoid parameter shadowing 'linenr' global

2016-04-27 Thread Junio C Hamano
Christian Couder writes: > Signed-off-by: Christian Couder > --- I think 02/83 that renamed the global-to-be-moved-to-state to state_p_value was brilliant, and this should follow suit; you would be moving linenr into the state eventually in later steps, right? > builtin/apply.c | 4 ++-- > 1

Re: BUG on OSX `git p4 submit` can fail when the workspace root doesn't exist locally.

2016-04-27 Thread Stefan Beller
On Wed, Apr 27, 2016 at 9:15 AM, Jacob Smith wrote: > On OS X, Do you use the Git as provided from OS X? In that case you better report the bug to Apple, as their version of Git is slightly different (not close on upstream, by both having additional patches as well as not following the upstream c

[PATCH 16/29] ref_transaction_commit(): correctly report close_ref() failure

2016-04-27 Thread Michael Haggerty
Signed-off-by: Michael Haggerty --- close() rarely fails, but it is possible. refs/files-backend.c | 1 + 1 file changed, 1 insertion(+) diff --git a/refs/files-backend.c b/refs/files-backend.c index 8fcbd7d..e86e3de 100644 --- a/refs/files-backend.c +++ b/refs/files-backend.c @@ -3144,6 +3144,

[PATCH 06/29] commit_ref_update(): write error message to *err, not stderr

2016-04-27 Thread Michael Haggerty
Signed-off-by: Michael Haggerty --- refs/files-backend.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/refs/files-backend.c b/refs/files-backend.c index 1f38076..de38517 100644 --- a/refs/files-backend.c +++ b/refs/files-backend.c @@ -2686,7 +2686,7 @@ static int commit_ref_

[PATCH 21/29] add_update(): initialize the whole ref_update

2016-04-27 Thread Michael Haggerty
Change add_update() to initialize all of the fields in the new ref_update object. Rename the function to ref_transaction_add_update(), and increase its visibility to all of the refs-related code. All of this makes the function more useful for other future callers. Signed-off-by: Michael Haggerty

[PATCH 18/29] refs: allow log-only updates

2016-04-27 Thread Michael Haggerty
From: David Turner The refs infrastructure learns about log-only ref updates, which only update the reflog. Later, we will use this to separate symbolic reference resolution from ref updating. Signed-off-by: David Turner Signed-off-by: Junio C Hamano Signed-off-by: Michael Haggerty --- refs

[PATCH 12/29] read_raw_ref(): improve docstring

2016-04-27 Thread Michael Haggerty
Among other things, document the (important!) requirement that input refname be checked for safety before calling this function. Signed-off-by: Michael Haggerty --- refs/files-backend.c | 41 - 1 file changed, 24 insertions(+), 17 deletions(-) diff --git

[PATCH 05/29] refname_is_safe(): insist that the refname already be normalized

2016-04-27 Thread Michael Haggerty
The reference name is going to be compared to other reference names, so it should be in its normalized form. Signed-off-by: Michael Haggerty --- Does anybody have a use case for allowing un-normalized reference names like "refs/foo/../bar///baz"? I'm pretty certain they would not be handled corre

[PATCH 13/29] lock_ref_sha1_basic(): remove unneeded local variable

2016-04-27 Thread Michael Haggerty
resolve_ref_unsafe() can cope with being called with NULL passed to its flags argument. So lock_ref_sha1_basic() can just hand its own type parameter through. Signed-off-by: Michael Haggerty --- refs/files-backend.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/ref

[PATCH 08/29] ref_transaction_commit(): remove local variable n

2016-04-27 Thread Michael Haggerty
This microoptimization doesn't make a significant difference in speed. And it causes problems if somebody ever wants to modify the function to add updates to a transaction as part of processing it, as will happen shortly. Make the same change in initial_ref_transaction_commit(). Signed-off-by: Mi

[PATCH 26/29] lock_ref_for_update(): don't re-read non-symbolic references

2016-04-27 Thread Michael Haggerty
Before the previous patch, our first read of the reference happened before the reference was locked, so we couldn't trust its value and had to read it again. But now that our first read of the reference happens after acquiring the lock, there is no need to read it a second time. So move the read_re

[PATCH 20/29] verify_refname_available(): adjust constness in declaration

2016-04-27 Thread Michael Haggerty
The two string_list arguments can be const. Signed-off-by: Michael Haggerty --- This is needed because I want to add a new caller that has const versions of these lists in hand. refs/files-backend.c | 4 ++-- refs/refs-internal.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff

[PATCH 03/29] refname_is_safe(): use skip_prefix()

2016-04-27 Thread Michael Haggerty
Signed-off-by: Michael Haggerty --- refs.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/refs.c b/refs.c index 87dc82f..5789152 100644 --- a/refs.c +++ b/refs.c @@ -120,17 +120,19 @@ int check_refname_format(const char *refname, int flags) int refname_is_safe(cons

[PATCH 23/29] unlock_ref(): move definition higher in the file

2016-04-27 Thread Michael Haggerty
This avoids the need for a forward declaration in the next patch. Signed-off-by: Michael Haggerty --- refs/files-backend.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/refs/files-backend.c b/refs/files-backend.c index 546656a..8f2a795 100644 --- a/re

[PATCH 29/29] lock_ref_sha1_basic(): only handle REF_NODEREF mode

2016-04-27 Thread Michael Haggerty
Now lock_ref_sha1_basic() is only called with flags==REF_NODEREF. So we don't have to handle other cases anymore. This enables several simplifications, the most interesting of which come from the fact that ref_lock::orig_ref_name is now always the same as ref_lock::ref_name: * Remove ref_lock::or

[PATCH 04/29] refname_is_safe(): don't allow the empty string

2016-04-27 Thread Michael Haggerty
Signed-off-by: Michael Haggerty --- This fixes a coding error from the original implementation. refs.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/refs.c b/refs.c index 5789152..ca0280f 100644 --- a/refs.c +++ b/refs.c @@ -136,11 +136,12 @@ int refname_is_safe(const

[PATCH 11/29] read_raw_ref(): rename symref argument to referent

2016-04-27 Thread Michael Haggerty
After all, it doesn't hold the symbolic reference, but rather the reference referred to. Signed-off-by: Michael Haggerty --- refs/files-backend.c | 21 +++-- refs/refs-internal.h | 2 +- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/refs/files-backend.c b/refs

[PATCH 02/29] remove_dir_recursively(): add docstring

2016-04-27 Thread Michael Haggerty
Add a docstring for the remove_dir_recursively() function and the REMOVE_DIR_* flags that can be passed to it. Signed-off-by: Michael Haggerty --- dir.h | 23 +++ 1 file changed, 23 insertions(+) diff --git a/dir.h b/dir.h index 301b737..5f19acc 100644 --- a/dir.h +++ b/dir.

[PATCH 15/29] ref_transaction_create(): disallow recursive pruning

2016-04-27 Thread Michael Haggerty
It is nonsensical (and a little bit dangerous) to use REF_ISPRUNING without REF_NODEREF. Forbid it explicitly. Change the one REF_ISPRUNING caller to pass REF_NODEREF too. Signed-off-by: Michael Haggerty --- This also makes later patches a bit clearer. refs.c | 3 +++ refs/files-b

[PATCH 01/29] safe_create_leading_directories(): improve docstring

2016-04-27 Thread Michael Haggerty
Document the difference between this function and safe_create_leading_directories_const(), and that the former restores path before returning. Signed-off-by: Michael Haggerty --- cache.h | 5 + 1 file changed, 5 insertions(+) diff --git a/cache.h b/cache.h index 2711048..4134f64 100644 ---

[PATCH 14/29] refs: make error messages more consistent

2016-04-27 Thread Michael Haggerty
* Always start error messages with a lower-case letter. * Always enclose reference names in single quotes. Signed-off-by: Michael Haggerty --- This change is not strictly needed, but I wanted to fix the old error messages before I started adding new ones (otherwise, should the new error messages

[PATCH 17/29] delete_branches(): use resolve_refdup()

2016-04-27 Thread Michael Haggerty
The return value of resolve_ref_unsafe() is not guaranteed to stay around as long as we need it, so use resolve_refdup() instead. Signed-off-by: Michael Haggerty --- builtin/branch.c | 19 +++ 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/builtin/branch.c b/built

[PATCH 28/29] commit_ref_update(): remove the flags parameter

2016-04-27 Thread Michael Haggerty
commit_ref_update() is now only called with flags=0. So remove the flags parameter entirely. Signed-off-by: Michael Haggerty --- refs/files-backend.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/refs/files-backend.c b/refs/files-backend.c index 40ed157..9388

[PATCH 25/29] refs: resolve symbolic refs first

2016-04-27 Thread Michael Haggerty
Before committing ref updates, split symbolic ref updates into two parts: an update to the underlying ref, and a log-only update to the symbolic ref. This ensures that both references are locked correctly during the transaction, including while their reflogs are updated. Similarly, if the referenc

[PATCH 19/29] refs: don't dereference on rename

2016-04-27 Thread Michael Haggerty
From: David Turner When renaming refs, don't dereference either the origin or the destination before renaming. The origin does not need to be dereferenced because it is presently forbidden to rename symbolic refs. Not dereferencing the destination fixes a bug where renaming on top of a broken s

[PATCH 07/29] rename_ref(): remove unneeded local variable

2016-04-27 Thread Michael Haggerty
Signed-off-by: Michael Haggerty --- refs/files-backend.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/refs/files-backend.c b/refs/files-backend.c index de38517..0ade681 100644 --- a/refs/files-backend.c +++ b/refs/files-backend.c @@ -2351,20 +2351,17 @@ int rename_

[PATCH 27/29] lock_ref_for_update(): don't resolve symrefs

2016-04-27 Thread Michael Haggerty
If a transaction includes a non-NODEREF update to a symbolic reference, we don't have to look it up in lock_ref_for_update(). The reference will be dereferenced anyway when the split-off update is processed. This change requires that we store a backpointer from the split-off update to its parent u

[PATCH 24/29] ref_transaction_update(): check refname_is_safe() at a minimum

2016-04-27 Thread Michael Haggerty
If the user has asked that a new value be set for a reference, we use check_refname_format() to verify that the reference name satisfies all of the rules. But in other cases, at least check that refname_is_safe(). Signed-off-by: Michael Haggerty --- There are remaining problems in this area of th

[PATCH 00/29] Yet more preparation for reference backends

2016-04-27 Thread Michael Haggerty
This started as a modest attempt to move the last couple of patches mentioned here [1] to before the vtable patches. I wanted to do that because having real changes mixed with the vtable refactoring was making rebasing and stuff awkward. But then it snowballed. A lot of what's new is pretty trivia

[PATCH 22/29] lock_ref_for_update(): new function

2016-04-27 Thread Michael Haggerty
Extract a new function, lock_ref_for_update(), from ref_transaction_commit(). Signed-off-by: Michael Haggerty --- refs/files-backend.c | 152 --- 1 file changed, 85 insertions(+), 67 deletions(-) diff --git a/refs/files-backend.c b/refs/files-back

[PATCH 10/29] read_raw_ref(): clear *type at start of function

2016-04-27 Thread Michael Haggerty
This is more convenient and less error-prone for callers. Signed-off-by: Michael Haggerty --- refs/files-backend.c | 1 + 1 file changed, 1 insertion(+) diff --git a/refs/files-backend.c b/refs/files-backend.c index 303c43b..f10c80f 100644 --- a/refs/files-backend.c +++ b/refs/files-backend.c @

[PATCH 09/29] read_raw_ref(): rename flags argument to type

2016-04-27 Thread Michael Haggerty
This will hopefully reduce confusion with the "flags" arguments that are used in many functions in this module as an input parameter to choose how the function should operate. Signed-off-by: Michael Haggerty --- refs/files-backend.c | 16 refs/refs-internal.h | 2 +- 2 files ch

Re: [PATCH 03/83] builtin/apply: avoid parameter shadowing 'linenr' global

2016-04-27 Thread Christian Couder
On Wed, Apr 27, 2016 at 6:27 PM, Junio C Hamano wrote: > > I think 02/83 that renamed the global-to-be-moved-to-state to > state_p_value was brilliant, and this should follow suit; you would > be moving linenr into the state eventually in later steps, right? Yeah, ok, I will do the same thing to

[PATCH] Makefile: remove dependency on git.spec

2016-04-27 Thread Dennis Kaarsemaker
ab21433 dropped support for rpmbuild using our own specfile by removing git.spec.in, but forgot to remove the dependency of dist on git.spec. Signed-off-by: Dennis Kaarsemaker --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 23182bc..8083

Re: [PATCH v14 3/6] t0040-parse-options: improve test coverage

2016-04-27 Thread Eric Sunshine
On Mon, Apr 25, 2016 at 2:40 PM, Pranit Bauva wrote: > On Wed, Apr 13, 2016 at 10:57 PM, Eric Sunshine > wrote: >> Each of these patches should have a single conceptual purpose. It >> seems, from the above explanation, that you're mixing and mismatching >> bits of such changes between patches. >

Re: [PATCH 05/29] refname_is_safe(): insist that the refname already be normalized

2016-04-27 Thread Junio C Hamano
Michael Haggerty writes: > Does anybody have a use case for allowing un-normalized reference > names like "refs/foo/../bar///baz"? I'm pretty certain they would not > be handled correctly anyway, especially if they are not stored as > loose references. I wondered what codepath this follows:

Re: [PATCH 01/15] string_list: add string_list_duplicate

2016-04-27 Thread Stefan Beller
On Tue, Apr 26, 2016 at 3:37 PM, Junio C Hamano wrote: > Stefan Beller writes: > >> The result of git_config_get_value_multi do not seem to be stable and >> may get overwritten. Have an easy way to preserve the results of that >> query. >> >> Signed-off-by: Stefan Beller >> --- > > This morning

Re: BUG on OSX `git p4 submit` can fail when the workspace root doesn't exist locally.

2016-04-27 Thread Jacob Smith
I debugged the issue using the script here: https://github.com/git/git/blob/master/git-p4.py I'm not sure how close to the main repo that is. On Wed, Apr 27, 2016 at 11:28 AM, Stefan Beller wrote: > On Wed, Apr 27, 2016 at 9:15 AM, Jacob Smith wrote: >> On OS X, > > Do you use the Git as pro

Re: [PATCH 53/83] builtin/apply: make find_header() return -1 instead of die()ing

2016-04-27 Thread Eric Sunshine
On Sun, Apr 24, 2016 at 9:33 AM, Christian Couder wrote: > To be compatible with the rest of the error handling in builtin/apply.c, > find_header() should return -1 instead of calling die(). > > Unfortunately find_header() already returns -1 when no header is found, > so let's make it return -2 in

Re: [PATCH 53/83] builtin/apply: make find_header() return -1 instead of die()ing

2016-04-27 Thread Eric Sunshine
On Mon, Apr 25, 2016 at 9:18 AM, Duy Nguyen wrote: > On Sun, Apr 24, 2016 at 8:33 PM, Christian Couder > wrote: >> To be compatible with the rest of the error handling in builtin/apply.c, >> find_header() should return -1 instead of calling die(). >> >> Unfortunately find_header() already returns

Re: [PATCH 08/29] ref_transaction_commit(): remove local variable n

2016-04-27 Thread Junio C Hamano
Michael Haggerty writes: > This microoptimization doesn't make a significant difference in speed. > And it causes problems if somebody ever wants to modify the function to > add updates to a transaction as part of processing it, as will happen > shortly. > > Make the same change in initial_ref_tr

Re: [PATCH v14 3/6] t0040-parse-options: improve test coverage

2016-04-27 Thread Pranit Bauva
On Wed, Apr 27, 2016 at 11:25 PM, Eric Sunshine wrote: > On Mon, Apr 25, 2016 at 2:40 PM, Pranit Bauva wrote: >> On Wed, Apr 13, 2016 at 10:57 PM, Eric Sunshine >> wrote: >>> Each of these patches should have a single conceptual purpose. It >>> seems, from the above explanation, that you're mix

Re: [PATCH 12/29] read_raw_ref(): improve docstring

2016-04-27 Thread Junio C Hamano
Michael Haggerty writes: > * Backend-specific flags might be set in type as well, regardless of > * outcome. > * > - * sb_path is workspace: the caller should allocate and free it. All made sense. A welcome bonus is the removal of this stale comment that 42a38cf7 (read_raw_ref(): manage o

Re: [PATCH 15/29] ref_transaction_create(): disallow recursive pruning

2016-04-27 Thread Junio C Hamano
Michael Haggerty writes: > It is nonsensical (and a little bit dangerous) to use REF_ISPRUNING > without REF_NODEREF. Forbid it explicitly. Change the one REF_ISPRUNING > caller to pass REF_NODEREF too. > > Signed-off-by: Michael Haggerty > --- > This also makes later patches a bit clearer. I w

Re: [PATCH 2/3] mmap(win32): avoid copy-on-write when it is unnecessary

2016-04-27 Thread Johannes Sixt
Am 27.04.2016 um 08:43 schrieb Johannes Schindelin: On Tue, 26 Apr 2016, Johannes Sixt wrote: Should we insert a check for MAP_PRIVATE to catch unexpected use-cases (think of the index-helper daemon effort)? I agree, we should have such a check. The line above the `die("Invalid usage ...")` th

Re: [PATCH 19/29] refs: don't dereference on rename

2016-04-27 Thread Junio C Hamano
Michael Haggerty writes: > @@ -2380,8 +2381,8 @@ int rename_ref(const char *oldrefname, const char > *newrefname, const char *logms > goto rollback; > } > > - if (!read_ref_full(newrefname, RESOLVE_REF_READING, sha1, NULL) && > - delete_ref(newrefname, sha1, REF

Re: [PATCH v4] http: support sending custom HTTP headers

2016-04-27 Thread Jeff King
On Wed, Apr 27, 2016 at 02:20:37PM +0200, Johannes Schindelin wrote: > The only change vs v3 is that I replaced my flimsical test by Peff's (with > *one* change: I realized that we need to group the Require statements in a > block when I tried to verify that the test fails when I > modify the fir

[PATCH] trailer: load config to handle core.commentChar

2016-04-27 Thread Rafal Klys
Add call to git_config(git_default_config, NULL) to update the comment_char_line from default '#' to possible different value set in core.commentChar. Signed-off-by: Rafal Klys --- trailer.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/trailer.c b/trailer.c index 8e48a5c..a3700b4 10064

[PATCH v6 07/19] index-helper: add --detach

2016-04-27 Thread David Turner
From: Nguyễn Thái Ngọc Duy We detach after creating and opening the socket, because otherwise we might return control to the shell before index-helper is ready to accept commands. This might lead to flaky tests. Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: David Turner --- Documentatio

[PATCH v6 03/19] index-helper: new daemon for caching index and related stuff

2016-04-27 Thread David Turner
From: Nguyễn Thái Ngọc Duy Instead of reading the index from disk and worrying about disk corruption, the index is cached in memory (memory bit-flips happen too, but hopefully less often). The result is faster read. Read time is reduced by 70%. The biggest gain is not having to verify the traili

[PATCH v6 14/19] index-helper: kill mode

2016-04-27 Thread David Turner
Add a new command (and command-line arg) to allow index-helpers to exit cleanly. This is mainly useful for tests. Signed-off-by: David Turner --- Documentation/git-index-helper.txt | 3 +++ index-helper.c | 31 ++- t/t7900-index-helper.sh

[PATCH v6 01/19] read-cache.c: fix constness of verify_hdr()

2016-04-27 Thread David Turner
From: Nguyễn Thái Ngọc Duy Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: David Turner --- read-cache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/read-cache.c b/read-cache.c index d9fb78b..16cc487 100644 --- a/read-cache.c +++ b/read-cache.c @@ -1345,7 +1345,7 @@

[PATCH v6 09/19] Add watchman support to reduce index refresh cost

2016-04-27 Thread David Turner
From: Nguyễn Thái Ngọc Duy The previous patch has the logic to clear bits in 'WAMA' bitmap. This patch has logic to set bits as told by watchman. The missing bit, _using_ these bits, are not here yet. A lot of this code is written by David Turner originally, mostly from [1]. I'm just copying and

[PATCH v6 04/19] index-helper: add --strict

2016-04-27 Thread David Turner
From: Nguyễn Thái Ngọc Duy There are "holes" in the index-helper approach because the shared memory is not verified again by git. If $USER is compromised, shared memory could be modified. But anyone who could do this could already modify $GIT_DIR/index. A more realistic risk is some bugs in index

[PATCH v6 12/19] unpack-trees: preserve index extensions

2016-04-27 Thread David Turner
Make git checkout (and other unpack_tree operations) preserve the untracked cache and watchman status. This is valuable for two reasons: 1. Often, an unpack_tree operation will not touch large parts of the working tree, and thus most of the untracked cache will continue to be valid. 2. Even if th

[PATCH v6 15/19] index-helper: don't run if already running

2016-04-27 Thread David Turner
Signed-off-by: David Turner --- index-helper.c | 7 +++ t/t7900-index-helper.sh | 9 + 2 files changed, 16 insertions(+) diff --git a/index-helper.c b/index-helper.c index 60a71f2..092c814 100644 --- a/index-helper.c +++ b/index-helper.c @@ -463,6 +463,13 @@ int main(int arg

[PATCH v6 16/19] index-helper: autorun mode

2016-04-27 Thread David Turner
Soon, we'll want to automatically start index-helper, so we need a mode that silently exits if it can't start up (either because it's not in a git dir, or because another one is already running). Signed-off-by: David Turner --- Documentation/git-index-helper.txt | 4 index-helper.c

[PATCH v6 10/19] index-helper: use watchman to avoid refreshing index with lstat()

2016-04-27 Thread David Turner
From: Nguyễn Thái Ngọc Duy Watchman is hidden behind index-helper. Before git tries to read the index from shm, it notifies index-helper through the socket and waits for index-helper to prepare a file for sharing memory (with MAP_SHARED). index-helper then contacts watchman, updates 'WAMA' extens

[PATCH v6 06/19] daemonize(): set a flag before exiting the main process

2016-04-27 Thread David Turner
From: Nguyễn Thái Ngọc Duy This allows signal handlers and atexit functions to realize this situation and not clean up. Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: David Turner --- builtin/gc.c | 2 +- cache.h | 2 +- daemon.c | 2 +- setup.c | 4 +++- 4 files changed, 6

[PATCH v6 13/19] watchman: add a config option to enable the extension

2016-04-27 Thread David Turner
For installations that have centrally-managed configuration, it's easier to set a config once than to run update-index on every repository. Signed-off-by: David Turner --- .gitignore| 1 + Documentation/config.txt | 4 Makefile | 1 + read-ca

[PATCH v6 17/19] index-helper: optionally automatically run

2016-04-27 Thread David Turner
Introduce a new config option, indexhelper.autorun, to automatically run git index-helper before starting up a builtin git command. This enables users to keep index-helper running without manual intervention. Signed-off-by: David Turner --- Documentation/config.txt | 4 read-cache.c

[PATCH v6 02/19] read-cache: allow to keep mmap'd memory after reading

2016-04-27 Thread David Turner
From: Nguyễn Thái Ngọc Duy Later, we will introduce git index-helper to share this memory with other git processes. We only unmap it when we discard the index (although the kernel may of course choose to page it out). Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: David Turner --- cache.

[PATCH v6 11/19] update-index: enable/disable watchman support

2016-04-27 Thread David Turner
From: Nguyễn Thái Ngọc Duy Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: David Turner --- Documentation/git-index-helper.txt | 3 +++ Documentation/git-update-index.txt | 6 ++ builtin/update-index.c | 16 3 files changed, 25 insertions(+) diff --git a/

[PATCH v6 00/19] index-helper/watchman

2016-04-27 Thread David Turner
What's new: 1. configs for automatically populating the untracked-cache and watchman extensions. 2. index-helper errors go to index-helper.log (index-helper redirects stdout, stderr) 3. Duy's "Add tracing to measure where most of the time is spent" 4. index-helper sends/receives watchman status

[PATCH v6 05/19] index-helper: log warnings

2016-04-27 Thread David Turner
Instead of writing warnings to stderr, write them to a log. Later, we'll probably be daemonized, so writing to stderr will be pointless. Signed-off-by: David Turner --- Documentation/git-index-helper.txt | 3 +++ index-helper.c | 29 ++--- 2 files ch

[PATCH v6 18/19] Add tracing to measure where most of the time is spent

2016-04-27 Thread David Turner
From: Nguyễn Thái Ngọc Duy All the known heavy code blocks are measured (except object database access). This should help identify if an optimization is effective or not. An unoptimized git-status would give something like below (92% of time is accounted). To sum up the effort of making git scale

[PATCH v6 19/19] untracked-cache: config option

2016-04-27 Thread David Turner
Add a config option to populate the untracked cache. For installations that have centrally-managed configuration, it's easier to set a config once than to run update-index on every repository. Signed-off-by: David Turner --- Documentation/config.txt | 4 read-cache.c | 7 ++

[PATCH v6 08/19] read-cache: add watchman 'WAMA' extension

2016-04-27 Thread David Turner
From: Nguyễn Thái Ngọc Duy The extension contains a bitmap, one bit for each entry in the index. If the n-th bit is zero, the n-th entry is considered unchanged, we can ce_mark_uptodate() it without refreshing. If the bit is non-zero and we found out the corresponding file is clean after refresh,

Re: [PATCH 05/29] refname_is_safe(): insist that the refname already be normalized

2016-04-27 Thread David Turner
On Wed, 2016-04-27 at 10:59 -0700, Junio C Hamano wrote: > There is another call to refname_is_safe() in resolve_ref_unsafe(), > which applies the sanity check to the string from a symref. We seem > to allow > > $ git symbolic-ref refs/heads/SSS refs/heads//master > > and we end up storing

Re: [PATCH] trailer: load config to handle core.commentChar

2016-04-27 Thread Christian Couder
On Wed, Apr 27, 2016 at 9:24 PM, Rafal Klys wrote: > Add call to git_config(git_default_config, NULL) to update the > comment_char_line from default '#' to possible different value set in > core.commentChar. It is "comment_line_char" not "comment_char_line", but otherwise you can add "Reviewed-by

Re: [PATCH 24/29] ref_transaction_update(): check refname_is_safe() at a minimum

2016-04-27 Thread Junio C Hamano
Michael Haggerty writes: > If the user has asked that a new value be set for a reference, we use > check_refname_format() to verify that the reference name satisfies all > of the rules. But in other cases, at least check that refname_is_safe(). It isn't clear to me what "in other cases" exactly

  1   2   >