Re: [PATCH][GSOC] Selection of the verbose message is replaced with generated message in install_branch_config()

2014-03-24 Thread Aleksey Mokhovikov
On 03/22/2014 04:13 AM, Michael Haggerty wrote: My expectation when I invented that microproject was that converting the code to be table-driven would be judged *not* to be an improvement. I was hoping that a student would say the 'if' statement is OK, but let's delete this ridiculous

[PATCH 3/3] test-lib: '--run' to run only specific tests

2014-03-24 Thread Ilya Bobyr
Allow better control of the set of tests that will be executed for a single test suite. Mostly useful while debugging or developing as it allows to focus on a specific test. Signed-off-by: Ilya Bobyr ilya.bo...@gmail.com --- t/README | 65 ++- t/t-basic.sh | 233

[RFC/PATCH] Better control of the tests run by a test suite

2014-03-24 Thread Ilya Bobyr
Hello, This is a second attempt on a functionality I proposed in [PATCH 2/2] test-lib: GIT_TEST_ONLY to run only specific tests http://www.mail-archive.com/git%40vger.kernel.org/msg44828.html except that the implementation is quite different now. I hope that I have accounted for the

[PATCH 1/3] test-lib: Document short options in t/README

2014-03-24 Thread Ilya Bobyr
Most arguments that could be provided to a test have short forms. Unless documented the only way to learn then is to read the code. Signed-off-by: Ilya Bobyr ilya.bo...@gmail.com --- t/README | 10 +- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/t/README b/t/README

[PATCH 2/3] test-lib: tests skipped by GIT_SKIP_TESTS say so

2014-03-24 Thread Ilya Bobyr
We used to show (missing ) next to tests skipped because they are specified in GIT_SKIP_TESTS. Use (GIT_SKIP_TESTS) instead. Plus tests that check basic GIT_SKIP_TESTS functions. Signed-off-by: Ilya Bobyr ilya.bo...@gmail.com --- t/t-basic.sh | 63

Re: git log omits deleting merges

2014-03-24 Thread Ephrim Khong
Am 20.03.14 20:54, schrieb Jeff King: On Thu, Feb 20, 2014 at 08:35:33AM +0100, Ephrim Khong wrote: Hi, git log seems to omit merge commits that delete a file if --follow or --diff-filter=D is given. Below is a testcase. I'm not sure if it is desired behaviour for --diff-filter=D, but it's

Re: [PATCH 1/3] test-lib: Document short options in t/README

2014-03-24 Thread Ramsay Jones
On 24/03/14 08:49, Ilya Bobyr wrote: Most arguments that could be provided to a test have short forms. Unless documented the only way to learn then is to read the code. Signed-off-by: Ilya Bobyr ilya.bo...@gmail.com --- t/README | 10 +- 1 files changed, 5 insertions(+), 5

[PATCH v3 1/2] fsck.c: modify fsck_ident() and fsck_commit()

2014-03-24 Thread Ashwin Jha
In fsck_ident(): Replace argument char **ident with const char **ident In fsck_commit(): Replace char *buffer with const char *buffer In both the cases, referenced memory addresses are not modified. So, it will be a good practice, to declare them as const. Signed-off-by: Ashwin Jha

[PATCH v3 2/2] fsck.c:fsck_commit replace memcmp by skip_prefix

2014-03-24 Thread Ashwin Jha
Replace memcmp by skip_prefix as it serves the dual purpose of checking the string for a prefix as well as skipping that prefix. Signed-off-by: Ashwin Jha ajha@gmail.com --- fsck_commit(): After the first patch in this series, it is now safe to replace memcmp() with skip_prefix(). Previous

Re: [PATCH][GSOC] Selection of the verbose message is replaced with generated message in install_branch_config()

2014-03-24 Thread Michael Haggerty
On 03/24/2014 08:28 AM, Aleksey Mokhovikov wrote: On 03/22/2014 04:13 AM, Michael Haggerty wrote: My expectation when I invented that microproject was that converting the code to be table-driven would be judged *not* to be an improvement. I was hoping that a student would say the 'if'

Re: git log omits deleting merges

2014-03-24 Thread Jeff King
On Mon, Mar 24, 2014 at 11:25:32AM +0100, Ephrim Khong wrote: Thank you for the explanation, I now understand why this is happening from a technical point of view. From a usability perspective, it is a bit confusing that a flag that should intuitively increase the number of shown commits

Re: [PATCH v3 18/25] setup.c: support multi-checkout repo setup

2014-03-24 Thread Torsten Bögershausen
On 02/18/2014 02:40 PM, Nguyễn Thái Ngọc Duy wrote: The repo setup procedure is updated to detect $GIT_DIR/commondir and set $GIT_COMMON_DIR properly. The core.worktree is ignored when $GIT_DIR/commondir presents. This is because commondir repos are intended for separate/linked checkouts and

Re: [PATCH] git-remote-hg : Enable use of, $GIT_DIR/hg/origin/clone/.hg/hgrc

2014-03-24 Thread Delcypher
ping. On 21 February 2014 15:17, Daniel Liew delcyp...@gmail.com wrote: git-remote-hg : Enable use of, $GIT_DIR/hg/origin/clone/.hg/hgrc Use the hgrc configuration file in the internal mercurial repository in addition to the other system wide hgrc files. This is done by using the 'ui' object

[PATCH 000/144] Use the $( ... ) construct for command substitution instead of using the back-quotes

2014-03-24 Thread Elia Pinto
This patch series changes everywhere the back-quotes construct for command substitution with the $( ... ). The Git CodingGuidelines prefer the $( ... ) construct for command substitution instead of using the back-quotes , or grave accents (`..`). The backquoted form is the historical method

Re: [PATCH 1/3] test-lib: Document short options in t/README

2014-03-24 Thread Ilya Bobyr
On 3/24/2014 4:39 AM, Ramsay Jones wrote: On 24/03/14 08:49, Ilya Bobyr wrote: Most arguments that could be provided to a test have short forms. Unless documented the only way to learn then is to read the code. Signed-off-by: Ilya Bobyr ilya.bo...@gmail.com --- t/README | 10 +-

[PATCH 2/3] update-index: teach --cacheinfo a new syntax mode,sha1,path

2014-03-24 Thread Junio C Hamano
The --cacheinfo option is unusual in that it takes three option parameters. An option with an optional parameter is bad enough. An option with multiple parameters is simply insane. Introduce a new syntax that takes these three things concatenated together with a comma, which makes the command

[PATCH 3/3] parse-options: make sure argh string does not have SP or _

2014-03-24 Thread Junio C Hamano
We encourage to spell an argument hint that consists of multiple words as a single-token separated with dashes. In order to help catching violations added by new callers of parse-options, make sure argh does not contain SP or _ when the code validates the option definitions. Signed-off-by: Junio

[PATCH v2 04/27] t1400: Add some more tests involving quoted arguments

2014-03-24 Thread Michael Haggerty
Previously there were no good tests of C-quoted arguments. Signed-off-by: Michael Haggerty mhag...@alum.mit.edu --- t/t1400-update-ref.sh | 26 +- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/t/t1400-update-ref.sh b/t/t1400-update-ref.sh index

[PATCH v2 03/27] parse_arg(): Really test that argument is properly terminated

2014-03-24 Thread Michael Haggerty
Test that the argument is properly terminated by either whitespace or a NUL character, even if it is quoted, to be consistent with the non-quoted case. Adjust the tests to expect the new error message. Add a docstring to the function, incorporating the comments that were formerly within the

[PATCH v2 02/27] t1400: Provide more usual input to the command

2014-03-24 Thread Michael Haggerty
The old version was passing (among other things) update SP refs/heads/c NUL NUL 0{40} NUL to git update-ref -z --stdin to test whether the old-value check for c is working. But the newvalue is empty, which is a bit off the beaten track. So, to be sure that we are testing what we want to

[PATCH v2 06/27] update_refs(): Fix constness

2014-03-24 Thread Michael Haggerty
Since full const correctness is beyond the ability of C's type system, just put the const where it doesn't do any harm. A (struct ref_update **) can be passed to a (struct ref_update * const *) argument, but not to a (const struct ref_update **) argument. Signed-off-by: Michael Haggerty

[PATCH v2 05/27] refs.h: Rename the action_on_err constants

2014-03-24 Thread Michael Haggerty
Given that these constants are only being used when updating references, it is inappropriate to give them such generic names as DIE_ON_ERR. So prefix their names with UPDATE_REFS_. Signed-off-by: Michael Haggerty mhag...@alum.mit.edu --- builtin/checkout.c | 2 +-

[PATCH v2 27/27] ref_transaction_commit(): Work with transaction-updates in place

2014-03-24 Thread Michael Haggerty
Now that we free the transaction when we are done, there is no need to make a copy of transaction-updates before working with it. Signed-off-by: Michael Haggerty mhag...@alum.mit.edu --- refs.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/refs.c b/refs.c index

[PATCH v2 25/27] struct ref_update: Add a lock member

2014-03-24 Thread Michael Haggerty
Now that we manage ref_update objects internally, we can use them to hold some of the scratch space we need when actually carrying out the updates. Store the (struct ref_lock *) there. Signed-off-by: Michael Haggerty mhag...@alum.mit.edu --- refs.c | 36 +++- 1

[PATCH v2 11/27] update-ref --stdin: Make error messages more consistent

2014-03-24 Thread Michael Haggerty
The old error messages emitted for invalid input sometimes said oldvalue/newvalue and sometimes said old value/new value. Convert them all to the former. Update the tests accordingly. Signed-off-by: Michael Haggerty mhag...@alum.mit.edu --- builtin/update-ref.c | 8

[PATCH v2 00/27] Clean up update-refs --stdin and implement ref_transaction

2014-03-24 Thread Michael Haggerty
This is v2 of this patch series. See also [1] for more context. Thanks to Brad, Junio, and Johan for their feedback on v1 [2]. I think I have addressed all of your points. Changes relative to v1: * Rename the functions associated with ref_transactions to be more reminiscent of database

[PATCH v2 09/27] update-ref.c: Extract a new function, parse_refname()

2014-03-24 Thread Michael Haggerty
There is no reason to obscure the fact that parse_first_arg() always parses refnames. Form the new function by combining parse_first_arg() and update_store_ref_name(). Signed-off-by: Michael Haggerty mhag...@alum.mit.edu --- builtin/update-ref.c | 90

[PATCH v2 23/27] struct ref_update: Store refname as a FLEX_ARRAY.

2014-03-24 Thread Michael Haggerty
Signed-off-by: Michael Haggerty mhag...@alum.mit.edu --- refs.c | 15 ++- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/refs.c b/refs.c index d72d0ab..2b80f6d 100644 --- a/refs.c +++ b/refs.c @@ -3274,11 +3274,11 @@ static int update_ref_write(const char *action, const

[PATCH v2 24/27] ref_transaction_commit(): Introduce temporary variables

2014-03-24 Thread Michael Haggerty
Use temporary variables in the for-loop blocks to simplify expressions in the rest of the loop. Signed-off-by: Michael Haggerty mhag...@alum.mit.edu --- refs.c | 21 + 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/refs.c b/refs.c index 2b80f6d..d51566c 100644

[PATCH v2 08/27] parse_cmd_verify(): Copy old_sha1 instead of evaluating oldvalue twice

2014-03-24 Thread Michael Haggerty
Aside from avoiding a tiny bit of work, this makes it transparently obvious that old_sha1 and new_sha1 are identical. It is arguably a bit silly to have to set new_sha1 in order to verify old_sha1, but that is a problem for another day. Signed-off-by: Michael Haggerty mhag...@alum.mit.edu ---

[PATCH v2 10/27] update-ref --stdin: Improve error messages for invalid values

2014-03-24 Thread Michael Haggerty
If an invalid value is passed to update-ref --stdin as oldvalue or newvalue, include the command and the name of the reference at the beginning of the error message. Update the tests accordingly. Signed-off-by: Michael Haggerty mhag...@alum.mit.edu --- builtin/update-ref.c | 24

[PATCH v2 01/27] t1400: Fix name and expected result of one test

2014-03-24 Thread Michael Haggerty
The test stdin -z create ref fails with zero new value actually passes an empty new value, not a zero new value. So rename the test s/zero/empty/, and change the expected error from fatal: create $c given zero new value to fatal: create $c missing newvalue Of course, this makes

[PATCH v2 26/27] struct ref_update: Add type field

2014-03-24 Thread Michael Haggerty
This is temporary space for ref_transaction_commit(). Signed-off-by: Michael Haggerty mhag...@alum.mit.edu --- refs.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/refs.c b/refs.c index d1edd57..07f900a 100644 --- a/refs.c +++ b/refs.c @@ -3279,6 +3279,7 @@ struct

[PATCH v2 18/27] update-ref --stdin: Harmonize error messages

2014-03-24 Thread Michael Haggerty
Make (most of) the error messages for invalid input have the same format [1]: $COMMAND [SP $REFNAME]: $MESSAGE Update the tests accordingly. [1] A few error messages are left with their old form, because $COMMAND and $REFNAME aren't passed all the way down the call stack. Maybe

[PATCH v2 19/27] refs: Add a concept of a reference transaction

2014-03-24 Thread Michael Haggerty
Build out the API for dealing with a bunch of reference checks and changes within a transaction. Define an opaque ref_transaction type that is managed entirely within refs.c. Introduce functions for beginning a transaction, adding updates to a transaction, and committing/rolling back a

[PATCH v2 07/27] update-ref --stdin: Read the whole input at once

2014-03-24 Thread Michael Haggerty
Read the whole input into a strbuf at once, and then parse it from there. This might also be a tad faster, but that is not the point. The point is to decouple the parsing code from the input source (the old parsing code had to read new data even in the middle of commands). Add docstrings for the

[PATCH v2 15/27] update-ref --stdin -z: Deprecate interpreting the empty string as zeros

2014-03-24 Thread Michael Haggerty
In the original version of this command, for the single case of the update command's newvalue, the empty string was interpreted as being equivalent to 40 0s. This shorthand is unnecessary (binary input will usually be generated programmatically anyway), and it complicates the parser and the

[PATCH v2 17/27] update-ref --stdin: Improve the error message for unexpected EOF

2014-03-24 Thread Michael Haggerty
Distinguish this error from the error that an argument is missing for another reason. Update the tests accordingly. Signed-off-by: Michael Haggerty mhag...@alum.mit.edu --- builtin/update-ref.c | 4 ++-- t/t1400-update-ref.sh | 12 ++-- 2 files changed, 8 insertions(+), 8 deletions(-)

[PATCH v2 22/27] struct ref_update: Rename field ref_name to refname

2014-03-24 Thread Michael Haggerty
This is consistent with the usual nomenclature. Signed-off-by: Michael Haggerty mhag...@alum.mit.edu --- refs.c | 18 +- refs.h | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/refs.c b/refs.c index dfff117..d72d0ab 100644 --- a/refs.c +++ b/refs.c @@

[PATCH v2 20/27] update-ref --stdin: Reimplement using reference transactions

2014-03-24 Thread Michael Haggerty
This change is mostly clerical: the parse_cmd_*() functions need to use local variables rather than a struct ref_update to collect the arguments needed for each update, and then call ref_transaction_*() to queue the change rather than building up the list of changes at the caller side.

[PATCH v2 16/27] t1400: Test one mistake at a time

2014-03-24 Thread Michael Haggerty
This case wants to test passing a bad refname to the update command. But it also passes too few arguments to update, which muddles the situation: which error should be diagnosed? So split this test into two: * One that passes too few arguments to update * One that passes all three arguments to

[PATCH v2 12/27] update-ref --stdin: Simplify error messages for missing oldvalues

2014-03-24 Thread Michael Haggerty
Instead of, for example, fatal: update refs/heads/master missing [oldvalue] NUL emit fatal: update refs/heads/master missing oldvalue Update the tests accordingly. Signed-off-by: Michael Haggerty mhag...@alum.mit.edu --- builtin/update-ref.c | 6 +++--- t/t1400-update-ref.sh | 6

[PATCH v2 14/27] update-ref.c: Extract a new function, parse_next_sha1()

2014-03-24 Thread Michael Haggerty
Replace three functions, update_store_new_sha1(), update_store_old_sha1(), and parse_next_arg(), with a single function, parse_next_sha1(). The new function takes care of a whole argument, including checking whether it is there, converting it to an SHA-1, and emitting errors on EOF or for invalid

[PATCH v2 21/27] refs: Remove API function update_refs()

2014-03-24 Thread Michael Haggerty
It has been superseded by reference transactions. This also means that struct ref_update can become private. Signed-off-by: Michael Haggerty mhag...@alum.mit.edu --- refs.c | 33 - refs.h | 20 2 files changed, 20 insertions(+), 33

[PATCH v2 13/27] t1400: Test that stdin -z update treats empty newvalue as zeros

2014-03-24 Thread Michael Haggerty
This is the (slightly inconsistent) status quo; make sure it doesn't change by accident. Signed-off-by: Michael Haggerty mhag...@alum.mit.edu --- t/t1400-update-ref.sh | 7 +++ 1 file changed, 7 insertions(+) diff --git a/t/t1400-update-ref.sh b/t/t1400-update-ref.sh index a2015d0..208f56e

Re: [PATCH 04/10] t4209: use helper functions to test --grep

2014-03-24 Thread Junio C Hamano
René Scharfe l@web.de writes: -test_expect_success 'log --grep -i' ' - git log -i --grep=InItial --format=%H actual - test_cmp expect_initial actual -' +test_log expect_initial --grep initial +test_log expect_nomatch --grep InItial This, and the next --author one,

Re: [PATCH 03/10] t4209: factor out helper function test_log_icase()

2014-03-24 Thread Junio C Hamano
René Scharfe l@web.de writes: Reduce code duplication by introducing test_log_icase() that runs the same test with both --regexp-ignore-case and -i. The specification of the four basic test scenarios (matching/nomatching combined with case sensitive/insensitive) becomes easier to read

Re: [PATCH 00/10] pickaxe: honor -i when used with -S and --pickaxe-regex; cleanups

2014-03-24 Thread Junio C Hamano
René Scharfe l@web.de writes: This series allows the options -i/--regexp-ignore-case, --pickaxe-regex, and -S to be used together and work as expected to perform a pickaxe search using case-insensitive regular expression matching. Its first half refactors the test script and extends test

Git push race condition?

2014-03-24 Thread Scott Sandler
Hi folks, I run a private Git repository (using Gitlab) with about 200 users doing about 100 pushes per day. I've noticed that a few times in the past several weeks, we've had events where pushes have been lost when two people pushed at just about the same time. The scenario is that two users

Re: [PATCH 2/2] fetch: handle overlaping refspecs on --prune

2014-03-24 Thread Junio C Hamano
Carlos Martín Nieto c...@elego.de writes: From: Carlos Martín Nieto c...@dwim.me We need to consider that a remote-tracking branch may match more than one rhs of a fetch refspec. In such a case, it is not enough to stop at the first match but look at all of the matches in order to determine

Re: Git push race condition?

2014-03-24 Thread Matthieu Moy
Scott Sandler scott.m.sand...@gmail.com writes: Both pushes are determined to be fast-forwards and both succeed, but B' overwrites B and B is no longer on origin/master. The server does have B in its .git directory but the commit isn't on any branch. Is the reflog enabled on the server? If

Re: Git push race condition?

2014-03-24 Thread Scott Sandler
It's a bare repo and I didn't realize server-side reflogs were a thing. Just ran git config core.logallrefupdates true in the repo on the server which seems to be what I should do to enable that. The server does know about B, it shows up when you do git show B. However git branch --contains B

What's cooking in git.git (Mar 2014, #05; Mon, 24)

2014-03-24 Thread Junio C Hamano
Here are the topics that have been cooking. Commits prefixed with '-' are only in 'pu' (proposed updates) while commits prefixed with '+' are in 'next'. More topics merged to 'master', some of which have been cooking before the v1.9.0 final release, many of them fallouts from GSoC microprojects.

Re: with reuse-delta patches, fetching with bitmaps segfaults due to possibly incomplete bitmap traverse

2014-03-24 Thread Junio C Hamano
Jeff King p...@peff.net writes: On Fri, Mar 21, 2014 at 07:58:55PM -0700, Siddharth Agarwal wrote: At Facebook we've found that fetch speed is a bottleneck for our Git repos, so we've been looking to deploy bitmaps to speed up fetches. We've been trying out git-next with the top two patches

Re: [PATCH 03/10] t4209: factor out helper function test_log_icase()

2014-03-24 Thread Jeff King
On Mon, Mar 24, 2014 at 11:22:30AM -0700, Junio C Hamano wrote: +test_log_icase() { + test_log $@ --regexp-ignore-case + test_log $@ -i -cascade broken? Will squash in an obvious fix. I don't think so. This is happening outside of test_expect_success, which is run by test_log. So

Re: [PATCH 04/10] t4209: use helper functions to test --grep

2014-03-24 Thread Jeff King
On Mon, Mar 24, 2014 at 11:22:58AM -0700, Junio C Hamano wrote: René Scharfe l@web.de writes: -test_expect_success 'log --grep -i' ' - git log -i --grep=InItial --format=%H actual - test_cmp expect_initial actual -' +test_log expect_initial --grep initial +test_log

Re: Git push race condition?

2014-03-24 Thread Ævar Arnfjörð Bjarmason
On Mon, Mar 24, 2014 at 8:18 PM, Scott Sandler scott.m.sand...@gmail.com wrote: I run a private Git repository (using Gitlab) with about 200 users doing about 100 pushes per day. Ditto but about 2x those numbers. error: Ref refs/heads/master is at 4584c1f34e07cea2df6abc8e0d407fe016017130 but

Re: [PATCH 12/19] tree-diff: remove special-case diff-emitting code for empty-tree cases

2014-03-24 Thread Junio C Hamano
Kirill Smelkov k...@mns.spb.ru writes: via teaching tree_entry_pathcmp() how to compare empty tree descriptors: Drop this line, as you explain the pretend empty compares bigger than anything else idea later anyway? This early part of the proposed log message made me hiccup while reading it.

Re: Borrowing objects from nearby repositories

2014-03-24 Thread Ævar Arnfjörð Bjarmason
On Wed, Mar 12, 2014 at 4:37 AM, Andrew Keller and...@kellerfarm.com wrote: Hi all, I am considering developing a new feature, and I'd like to poll the group for opinions. Background: A couple years ago, I wrote a set of scripts that speed up cloning of frequently used repositories. The

Re: [PATCH 08/10] pickaxe: move pickaxe() after pickaxe_match()

2014-03-24 Thread Jeff King
On Sat, Mar 22, 2014 at 06:15:58PM +0100, René Scharfe wrote: pickaxe() calls pickaxe_match(); moving the definition of the former those after the latter allows us to do without an explicit function declaration. s/those // -Peff -- To unsubscribe from this list: send the line unsubscribe git

Re: [PATCH 00/10] pickaxe: honor -i when used with -S and --pickaxe-regex; cleanups

2014-03-24 Thread Jeff King
On Sat, Mar 22, 2014 at 06:15:50PM +0100, René Scharfe wrote: This series allows the options -i/--regexp-ignore-case, --pickaxe-regex, and -S to be used together and work as expected to perform a pickaxe search using case-insensitive regular expression matching. Its first half refactors the

Re: [PATCH 11/19] tree-diff: simplify tree_entry_pathcmp

2014-03-24 Thread Junio C Hamano
Kirill Smelkov k...@mns.spb.ru writes: Since an earlier Finally switch over tree descriptors to contain a pre-parsed entry, we can safely access all tree_desc-entry fields directly instead of first extracting them through tree_entry_extract. Use it. The code generated stays the same - only

Re: Git push race condition?

2014-03-24 Thread Scott Sandler
Right. Receiving that error is what happens during my testing with a hook that sleeps for 60s, and that outcome makes sense. But whatever is occurring in production must be different, since both users see successful pushes with the first one just being overwritten. On Mon, Mar 24, 2014 at 5:16

Re: [PATCH 5/5] log: do not segfault on gmtime errors

2014-03-24 Thread Jeff King
On Sat, Mar 22, 2014 at 10:32:37AM +0100, René Scharfe wrote: This test is of questionable portability, since we are depending on gmtime's arbitrary point to decide that our input is crazy and return NULL. The value is sufficiently large that I'd expect most to do so, though, so it may be

Re: [PATCH 03/10] t4018: an infrastructure to test hunk headers

2014-03-24 Thread Jeff King
On Fri, Mar 21, 2014 at 10:07:15PM +0100, Johannes Sixt wrote: Add an infrastructure that simplifies adding new tests of the hunk header regular expressions. To add new tests, a file with the syntax to test can be dropped in the directory t4018. The README file explains how a test file must

Re: [PATCH v2 14/19] tree-diff: rework diff_tree interface to be sha1 based

2014-03-24 Thread Junio C Hamano
Kirill Smelkov k...@mns.spb.ru writes: The downside is that try_to_follow_renames(), if active, we cause re-reading of 2 initial trees, which was negligible based on my timings, That would depend on how often the codepath triggered in your test case, but is totally understandable. It fires

Re: [PATCH 03/10] t4018: an infrastructure to test hunk headers

2014-03-24 Thread Jeff King
On Mon, Mar 24, 2014 at 05:36:59PM -0400, Jeff King wrote: +How to write RIGHT test cases += + +Insert the word ChangeMe (exactly this form) at a distance of +at least two lines from the line that must appear in the hunk header. The existing tests use -U1

Re: [PATCH v2 16/19] tree-diff: reuse base str(buf) memory on sub-tree recursion

2014-03-24 Thread Junio C Hamano
Kirill Smelkov k...@mns.spb.ru writes: instead of allocating it all the time for every subtree in __diff_tree_sha1, let's allocate it once in diff_tree_sha1, and then all callee just use it in stacking style, without memory allocations. This should be faster, and for me this change gives the

Re: [PATCH 04/10] t4209: use helper functions to test --grep

2014-03-24 Thread René Scharfe
Am 24.03.2014 22:14, schrieb Jeff King: On Mon, Mar 24, 2014 at 11:22:58AM -0700, Junio C Hamano wrote: René Scharfe l@web.de writes: -test_expect_success 'log --grep -i' ' - git log -i --grep=InItial --format=%H actual - test_cmp expect_initial actual -' +test_log

Re: [PATCH 03/10] t4209: factor out helper function test_log_icase()

2014-03-24 Thread René Scharfe
Am 24.03.2014 22:10, schrieb Jeff King: On Mon, Mar 24, 2014 at 11:22:30AM -0700, Junio C Hamano wrote: +test_log_icase() { + test_log $@ --regexp-ignore-case + test_log $@ -i -cascade broken? Will squash in an obvious fix. I don't think so. This is happening outside of

Re: [PATCH 17/19] Portable alloca for Git

2014-03-24 Thread Junio C Hamano
Kirill Smelkov k...@mns.spb.ru writes: On Fri, Feb 28, 2014 at 06:19:58PM +0100, Erik Faye-Lund wrote: On Fri, Feb 28, 2014 at 6:00 PM, Kirill Smelkov k...@mns.spb.ru wrote: ... In fact that would be maybe preferred, for maintainers to enable alloca with knowledge and testing, as one

Re: [PATCH 00/10] userdiff: cpp pattern simplification and test framework

2014-03-24 Thread Jeff King
On Fri, Mar 21, 2014 at 10:07:12PM +0100, Johannes Sixt wrote: Here is a series that makes the hunk header pattern for C and C++ even simpler than suggested by Peff in [1] to catch a lot more C++ functions and two more C patterns. As a preparatory work, the test cases are totally rewritten

Re: [PATCH 03/12] t: drop useless sane_unset GIT_* calls

2014-03-24 Thread Jeff King
On Fri, Mar 21, 2014 at 02:24:31PM -0700, Junio C Hamano wrote: Unsetting these is not only useless, but can be confusing to a reader, who may wonder why some tests in a script unset them and others do not (t0001 is particularly guilty of this inconsistency, probably because many of its

Re: [PATCH 04/12] t: stop using GIT_CONFIG to cross repo boundaries

2014-03-24 Thread Jeff King
On Fri, Mar 21, 2014 at 02:26:02PM -0700, Junio C Hamano wrote: Jeff King p...@peff.net writes: Some tests want to check or set config in another repository. E.g., t1000 creates repositories and makes sure that their core.bare and core.worktree settings are what we expect. We can do

Re: [PATCH 5/5] log: do not segfault on gmtime errors

2014-03-24 Thread René Scharfe
Am 24.03.2014 22:33, schrieb Jeff King: On Sat, Mar 22, 2014 at 10:32:37AM +0100, René Scharfe wrote: @@ -184,8 +184,10 @@ const char *show_date(unsigned long time, int tz, enum date_mode mode) tz = local_tzoffset(time); tm = time_to_tm(time, tz); - if (!tm) -

Re: [PATCH 03/12] t: drop useless sane_unset GIT_* calls

2014-03-24 Thread Junio C Hamano
Jeff King p...@peff.net writes: I do not have a problem with that, as it implicitly covers all of the tests following it. I do not think it is particularly necessary, though. Assuming we start with a known test environment and avoiding polluting it for further tests are basic principles of

Re: Git push race condition?

2014-03-24 Thread Matthieu Moy
Scott Sandler scott.m.sand...@gmail.com writes: It's a bare repo and I didn't realize server-side reflogs were a thing. Just ran git config core.logallrefupdates true in the repo on the server which seems to be what I should do to enable that. That should be it, yes. The server does know

Re: [PATCH 03/10] t4209: factor out helper function test_log_icase()

2014-03-24 Thread Junio C Hamano
René Scharfe l@web.de writes: Am 24.03.2014 22:10, schrieb Jeff King: On Mon, Mar 24, 2014 at 11:22:30AM -0700, Junio C Hamano wrote: +test_log_icase() { + test_log $@ --regexp-ignore-case + test_log $@ -i -cascade broken? Will squash in an obvious fix. I don't think so. This is

Re: [PATCH 5/5] log: do not segfault on gmtime errors

2014-03-24 Thread Jeff King
On Mon, Mar 24, 2014 at 11:03:42PM +0100, René Scharfe wrote: If the result is all-zeroes, can we check for that case instead? I suppose that will eventually create a trap at midnight on January 1st of the year 0 (though I am not sure such a date is even meaningful, given the history of our

Re: Git push race condition?

2014-03-24 Thread Junio C Hamano
Matthieu Moy matthieu@grenoble-inp.fr writes: What you describe really looks like a force-push, or a hook doing a ref update (e.g. a hook on a dev branch that updates master if the code passes tests or so). ... or a filesystem that is broken. But I thought this is just a plain-vanilla

Re: Git push race condition?

2014-03-24 Thread Jeff King
On Mon, Mar 24, 2014 at 10:16:52PM +0100, Ævar Arnfjörð Bjarmason wrote: error: Ref refs/heads/master is at 4584c1f34e07cea2df6abc8e0d407fe016017130 but expected 61b79b6d35b066d054fb3deab550f1c51598cf5f remote: error: failed to lock refs/heads/master I also see this error once in a

Re: Git push race condition?

2014-03-24 Thread Jeff King
On Mon, Mar 24, 2014 at 03:18:14PM -0400, Scott Sandler wrote: I've noticed that a few times in the past several weeks, we've had events where pushes have been lost when two people pushed at just about the same time. The scenario is that two users both have commits based on commit A, call

Re: Git push race condition?

2014-03-24 Thread Nasser Grainawi
On Mar 24, 2014, at 4:54 PM, Jeff King p...@peff.net wrote: On Mon, Mar 24, 2014 at 03:18:14PM -0400, Scott Sandler wrote: I've noticed that a few times in the past several weeks, we've had events where pushes have been lost when two people pushed at just about the same time. The scenario

Re: [RFC/PATCH] Better control of the tests run by a test suite

2014-03-24 Thread Jeff King
On Mon, Mar 24, 2014 at 01:49:44AM -0700, Ilya Bobyr wrote: Here are some examples of how functionality added by the patch could be used. In order to run setup tests and then only a specific test (use case 1) one can do: $ ./t-init.sh --run='1 2 25' or: $ ./t-init.sh

[PATCH v2] Clarify pre-push hook documentation

2014-03-24 Thread David Cowden
The documentation as-is does not mention that the pre-push hook is executed even when there is nothing to push. This can lead a new reader to believe there will always be lines fed to the script's standard input and cause minor confusion as to what is happening when there are no lines provided to

[PATCH v3] Clarify pre-push hook documentation

2014-03-24 Thread David Cowden
The documentation as-is does not mention that the pre-push hook is executed even when there is nothing to push. This can lead a new reader to believe there will always be lines fed to the script's standard input and cause minor confusion as to what is happening when there are no lines provided to

[PATCH] Allow --pretty to be passed to git-describe.

2014-03-24 Thread Cyril Roelandt
In some cases, ony may want to find the the most recent tag that is reachable from a commit and have it pretty printed, using the formatting options available in git-log and git-show. Signed-off-by: Cyril Roelandt tipec...@gmail.com --- Documentation/git-describe.txt | 4

Re: [PATCH] builtin/apply.c: use iswspace() to detect line-ending-like chars

2014-03-24 Thread Junio C Hamano
Michael Haggerty mhag...@alum.mit.edu writes: -while ((*last1 == '\r') || (*last1 == '\n')) +while (iswspace(*last1)) last1--; -while ((*last2 == '\r') || (*last2 == '\n')) +while (iswspace(*last2)) last2--; /* skip leading whitespace */

Re: [PATCH 03/12] t: drop useless sane_unset GIT_* calls

2014-03-24 Thread Junio C Hamano
Jeff King p...@peff.net writes: Hmph. I am looking at git show HEAD^:t/t0001-init.sh after applying this patch, and it does look consistently done with GIT_CONFIG and GIT_DIR (I am not sure about GIT_WORK_TREE but from a cursory read it is done consistently for tests on non-bare

Re: [RFC/PATCH] Better control of the tests run by a test suite

2014-03-24 Thread Junio C Hamano
Jeff King p...@peff.net writes: On Mon, Mar 24, 2014 at 01:49:44AM -0700, Ilya Bobyr wrote: Here are some examples of how functionality added by the patch could be used. In order to run setup tests and then only a specific test (use case 1) one can do: $ ./t-init.sh --run='1 2

Re: [PATCH] Allow --pretty to be passed to git-describe.

2014-03-24 Thread Junio C Hamano
Cyril Roelandt tipec...@gmail.com writes: In some cases, ony may want to find the the most recent tag that is reachable from a commit and have it pretty printed, using the formatting options available in git-log and git-show. Sorry, but I do not understand the motivation I can read from

Re: [PATCH] Allow --pretty to be passed to git-describe.

2014-03-24 Thread Eric Sunshine
On Mon, Mar 24, 2014 at 9:04 PM, Cyril Roelandt tipec...@gmail.com wrote: In some cases, ony may want to find the the most recent tag that is reachable s/ony/one/ from a commit and have it pretty printed, using the formatting options available in git-log and git-show. Signed-off-by: Cyril