Re: [PATCH 7/9] tests: include detailed trace logs with --write-junit-xml upon failure

2018-09-03 Thread Eric Sunshine
On Mon, Sep 3, 2018 at 5:10 PM Johannes Schindelin via GitGitGadget wrote: > So let's do something different in VSTS: let's run all the tests with > `--quiet` first, and only if a failure is encountered, try to trace the > commands as they are executed. [...] > > Signed-off-by: Johannes

Re: [PATCH] i18n: fix mistakes in translated strings

2018-09-03 Thread Jiang Xin
Jean-Noël Avila 于2018年8月24日周五 上午5:02写道: > diff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c > index 2bcc70fdfe..b56028ba9d 100644 > --- a/builtin/submodule--helper.c > +++ b/builtin/submodule--helper.c > @@ -542,7 +542,7 @@ static void runcommand_in_submodule_cb(const struct

[L10N] Kickoff for Git 2.19.0 round 2

2018-09-03 Thread Jiang Xin
Hi, Let's start new round of l10n for Git 2.19.0. It includes fixes from @jnavila. You can get it from the usual place: https://github.com/git-l10n/git-po/ As how to update your XX.po and help to translate Git, please see "Updating a XX.po file" and other sections in “po/README" file. --

Re: [PATCH 4/9] tests: optionally write results as JUnit-style .xml

2018-09-03 Thread Eric Sunshine
On Mon, Sep 3, 2018 at 5:10 PM Johannes Schindelin via GitGitGadget wrote: > This will come in handy when publishing the results of Git's test suite > during an automated VSTS CI run. > > Signed-off-by: Johannes Schindelin > --- > diff --git a/t/test-lib.sh b/t/test-lib.sh > @@ -431,11 +434,24

[PATCH] Documentation/git.txt: clarify that GIT_TRACE=/path appends

2018-09-03 Thread SZEDER Gábor
The current wording of the description of GIT_TRACE=/path/to/file ("... will try to write the trace messages into it") might be misunderstood as "overwriting"; at least I interpreted it that way on a cursory first read. State it more explicitly that the trace messages are appended.

Re: [PATCH v4 01/12] t: add test functions to translate hash-related values

2018-09-03 Thread Eric Sunshine
On Mon, Sep 3, 2018 at 7:25 PM brian m. carlson wrote: > Add several test functions to make working with various hash-related > values easier. > [...] > diff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh > @@ -1155,3 +1155,70 @@ depacketize () { > +# Detect the hash algorithm in use.

Re: [PATCH 2/9] ci/lib.sh: encapsulate Travis-specific things

2018-09-03 Thread Eric Sunshine
On Mon, Sep 3, 2018 at 5:10 PM Johannes Schindelin via GitGitGadget wrote: > The upcoming patches will allow building git.git via VSTS CI, where > variable names and URLs look a bit different than in Travis CI. > > Signed-off-by: Johannes Schindelin > --- > diff --git

[PATCH v4 11/12] t1407: make hash size independent

2018-09-03 Thread brian m. carlson
Instead of hard-coding a 40-based constant, split the output of for-each-ref and for-each-reflog by field. Signed-off-by: brian m. carlson --- t/t1407-worktree-ref-store.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/t/t1407-worktree-ref-store.sh

[PATCH v4 10/12] t1406: make hash-size independent

2018-09-03 Thread brian m. carlson
Instead of hard-coding a 40-based constant, split the output of for-each-ref and for-each-reflog by field. Signed-off-by: brian m. carlson --- t/t1406-submodule-ref-store.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/t/t1406-submodule-ref-store.sh

[PATCH v4 02/12] t0000: use hash translation table

2018-09-03 Thread brian m. carlson
If the hash we're using is 32 bytes in size, attempting to insert a 20-byte object name won't work. Since these are synthesized objects that are almost all zeros, look them up in a translation table. Signed-off-by: brian m. carlson --- t/t-basic.sh | 13 +++-- 1 file changed, 7

[PATCH v4 06/12] t0064: make hash size independent

2018-09-03 Thread brian m. carlson
Compute test values of the appropriate size instead of hard-coding 40-character values. Rename the echo20 function to echoid, since the values may be of varying sizes. Signed-off-by: brian m. carlson --- t/t0064-sha1-array.sh | 49 --- 1 file changed, 27

[PATCH v4 12/12] t5318: use test_oid for HASH_LEN

2018-09-03 Thread brian m. carlson
From: Derrick Stolee Signed-off-by: Derrick Stolee Signed-off-by: brian m. carlson --- t/t5318-commit-graph.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/t/t5318-commit-graph.sh b/t/t5318-commit-graph.sh index 3c1ffad491..d286516f0e 100755 ---

[PATCH v4 04/12] t0002: abstract away SHA-1 specific constants

2018-09-03 Thread brian m. carlson
Adjust the test so that it computes variables for object IDs instead of using hard-coded hashes. Signed-off-by: brian m. carlson --- t/t0002-gitfile.sh | 27 +++ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/t/t0002-gitfile.sh b/t/t0002-gitfile.sh index

[PATCH v4 08/12] t1400: switch hard-coded object ID to variable

2018-09-03 Thread brian m. carlson
Switch a hard-coded all-zeros object ID to use a variable instead. Signed-off-by: brian m. carlson --- t/t1400-update-ref.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/t1400-update-ref.sh b/t/t1400-update-ref.sh index 7c8df20955..6072650686 100755 ---

[PATCH v4 01/12] t: add test functions to translate hash-related values

2018-09-03 Thread brian m. carlson
Add several test functions to make working with various hash-related values easier. Add test_oid_init, which loads common hash-related constants and placeholder object IDs from the newly added files in t/oid-info. Provide values for these constants for both SHA-1 and SHA-256. Add test_oid_cache,

[PATCH v4 07/12] t1006: make hash size independent

2018-09-03 Thread brian m. carlson
Compute the size of the tree and commit objects we're creating by checking for the size of an object ID and computing the resulting sizes accordingly. Signed-off-by: brian m. carlson --- t/t1006-cat-file.sh | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git

[PATCH v4 03/12] t0000: update tests for SHA-256

2018-09-03 Thread brian m. carlson
Test t tests the "basics of the basics" and as such, checks that we have various fixed hard-coded object IDs. The tests relying on these assertions have been marked with the SHA1 prerequisite, as they will obviously not function in their current form with SHA-256. Use the test_oid helper to

[PATCH v4 09/12] t1405: make hash size independent

2018-09-03 Thread brian m. carlson
Instead of hard-coding a 40-based constant, split the output of for-each-ref and for-each-reflog by field. Signed-off-by: brian m. carlson --- t/t1405-main-ref-store.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/t/t1405-main-ref-store.sh b/t/t1405-main-ref-store.sh

[PATCH v4 00/12] Hash-independent tests (part 3)

2018-09-03 Thread brian m. carlson
This is the next in the series of improvements to make tests hash-independent. A range-diff is below. Changes from v3: * Update t/README to specify new helpers. * Escape "$" in double quotes. * Add documentation comments to test helpers. * Use local instead of underscores in variable names. *

[PATCH v4 05/12] t0027: make hash size independent

2018-09-03 Thread brian m. carlson
We transform various object IDs into all-zero object IDs for comparison. Adjust the length as well so that this works for all hash algorithms. While it would be slightly more efficient to use a sed y/// expression instead of both the tr and sed, retain the tr in both cases for parallelism and

[PATCH 8/9] tests: record more stderr with --write-junit-xml in case of failure

2018-09-03 Thread Johannes Schindelin via GitGitGadget
From: Johannes Schindelin Sometimes, failures in a test case are actually caused by issues in earlier test cases. To make it easier to see those issues, let's attach the output from before the failing test case (i.e. stdout/stderr since the previous failing test case, or the start of the test

[PATCH 3/9] test-date: add a subcommand to measure times in shell scripts

2018-09-03 Thread Johannes Schindelin via GitGitGadget
From: Johannes Schindelin In the next commit, we want to teach Git's test suite to optionally output test results in JUnit-style .xml files. These files contain information about the time spent. So we need a way to measure time. While we could use `date +%s` for that, this will give us only

[PATCH 9/9] README: add a build badge (status of the VSTS build)

2018-09-03 Thread Johannes Schindelin via GitGitGadget
From: Johannes Schindelin Just like so many other OSS projects, we now also have a build badge. Signed-off-by: Johannes Schindelin --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index f920a42fad..f260e78042 100644 --- a/README.md +++ b/README.md @@

[PATCH 2/9] ci/lib.sh: encapsulate Travis-specific things

2018-09-03 Thread Johannes Schindelin via GitGitGadget
From: Johannes Schindelin The upcoming patches will allow building git.git via VSTS CI, where variable names and URLs look a bit different than in Travis CI. Signed-off-by: Johannes Schindelin --- ci/install-dependencies.sh | 3 ++- ci/lib.sh | 44

[PATCH 7/9] tests: include detailed trace logs with --write-junit-xml upon failure

2018-09-03 Thread Johannes Schindelin via GitGitGadget
From: Johannes Schindelin The JUnit XML format lends itself to be presented in a powerful UI, where you can drill down to the information you are interested in very quickly. For test failures, this usually means that you want to see the detailed trace of the failing tests. With Travis CI, we

[PATCH 6/9] Add a build definition for VSTS

2018-09-03 Thread Johannes Schindelin via GitGitGadget
From: Johannes Schindelin This commit adds a .vsts-ci.yml which is Visual Studio Team Services' equivalent to Travis CI's .travis.yml. To make things a bit easier to understand, we refrain from using the `matrix` feature here because (while it is powerful) it can be a bit confusing to users who

[PATCH 4/9] tests: optionally write results as JUnit-style .xml

2018-09-03 Thread Johannes Schindelin via GitGitGadget
From: Johannes Schindelin This will come in handy when publishing the results of Git's test suite during an automated VSTS CI run. Signed-off-by: Johannes Schindelin --- t/.gitignore | 1 + t/test-lib.sh | 98 +++ 2 files changed, 99

[PATCH 1/9] ci: rename the library of common functions

2018-09-03 Thread Johannes Schindelin via GitGitGadget
From: Johannes Schindelin The name is hard-coded to reflect that we use Travis CI for continuous testing. In the next commits, we will extend this to be able use Visual Studio Team Services, too. So let's adjust the name to make it more generic. Signed-off-by: Johannes Schindelin ---

[PATCH 5/9] ci/lib.sh: add support for VSTS CI

2018-09-03 Thread Johannes Schindelin via GitGitGadget
From: Johannes Schindelin This patch introduces a conditional arm that defines some environment variables and a function that displays the URL given the job id (to identify previous runs for known-good trees). Signed-off-by: Johannes Schindelin --- ci/lib.sh | 23 +++ 1

[PATCH 0/9] Offer to run CI/PR builds in Visual Studio Team Services

2018-09-03 Thread Johannes Schindelin via GitGitGadget
For a long time already, we have Git's source code continuously tested via Travis CI, see e.g. https://travis-ci.org/git/git/builds/421738884. It has served us well, and more and more developers actually pay attention and benefit from the testing this gives us. It is also an invaluable tool for

Re: [GSoC][PATCH v8 17/20] stash: convert save to builtin

2018-09-03 Thread Johannes Schindelin
Hi Eric, On Mon, 3 Sep 2018, Eric Sunshine wrote: > On Mon, Sep 3, 2018 at 2:44 PM Johannes Schindelin > wrote: > > where `strbuf_join_argv()` would be implemented like this (and I would put > > it into strbuf.c and strbuf.h: > > > > const char *strbuf_join_argv(struct strbuf *buf, > >

Re: [PATCH v2 2/3] read-cache: load cache extensions on worker thread

2018-09-03 Thread Duy Nguyen
On Mon, Sep 3, 2018 at 9:21 PM Duy Nguyen wrote: > > I used p0002-read-cache.sh to generate some performance data on the > > cumulative impact: > > > > 100,000 entries > > > > TestHEAD~3 HEAD~2 > >

Re: [PATCH v2 2/3] read-cache: load cache extensions on worker thread

2018-09-03 Thread Duy Nguyen
On Wed, Aug 29, 2018 at 5:25 PM Ben Peart wrote: > > This patch helps address the CPU cost of loading the index by loading > the cache extensions on a worker thread in parallel with loading the cache > entries. > > This is possible because the current extensions don't access the cache > entries

Re: [PATCH v2 1/3] read-cache: speed up index load through parallelization

2018-09-03 Thread Duy Nguyen
On Wed, Aug 29, 2018 at 5:25 PM Ben Peart wrote: > diff --git a/read-cache.c b/read-cache.c > index 7b1354d759..c30346388a 100644 > --- a/read-cache.c > +++ b/read-cache.c > @@ -1889,16 +1889,229 @@ static size_t estimate_cache_size(size_t > ondisk_size, unsigned int entries) > return

Re: [PATCH] add -p: coalesce hunks before testing applicability

2018-09-03 Thread Jochen Sprickerhof
Hi Phillip, * Phillip Wood [2018-08-30 14:47]: When $newhunk is created it is marked as dirty to prevent coalesce_overlapping_hunks() from coalescing it. This patch does not change that. What is happening is that by calling coalesce_overlapping_hunks() the hunks that are not currently

Re: [GSoC][PATCH v8 00/20] Convert "git stash" to C builtin

2018-09-03 Thread Johannes Schindelin
Hi Paul, On Fri, 31 Aug 2018, Paul-Sebastian Ungureanu wrote: > This a new iteration of `stash.c`. Thank you for the pleasant read! I read through all of the patches, spending particularly some time with the `stash create` one. Apart from the few comments I had, I only have positive things to

Re: [GSoC][PATCH v8 20/20] stash: replace all `write-tree` child processes with API calls

2018-09-03 Thread Johannes Schindelin
Hi Paul, On Fri, 31 Aug 2018, Paul-Sebastian Ungureanu wrote: > This commit replaces spawning `git write-tree` with API calls. > > Signed-off-by: Paul-Sebastian Ungureanu > --- > builtin/stash.c | 41 - > 1 file changed, 12 insertions(+), 29

Re: [RFC PATCH 08/12] commit-graph: convert to using the_hash_algo

2018-09-03 Thread brian m. carlson
On Wed, Aug 29, 2018 at 08:41:36AM -0400, Derrick Stolee wrote: > diff --git a/t/t5318-commit-graph.sh b/t/t5318-commit-graph.sh > index 6aee861f78..676c1a9ae0 100755 > --- a/t/t5318-commit-graph.sh > +++ b/t/t5318-commit-graph.sh > @@ -333,7 +333,7 @@ test_expect_success 'git commit-graph verify'

Re: [GSoC][PATCH v8 17/20] stash: convert save to builtin

2018-09-03 Thread Eric Sunshine
On Mon, Sep 3, 2018 at 2:44 PM Johannes Schindelin wrote: > where `strbuf_join_argv()` would be implemented like this (and I would put > it into strbuf.c and strbuf.h: > > const char *strbuf_join_argv(struct strbuf *buf, > int argc, const char **argv,

Re: [GSoC][PATCH v8 19/20] stash: optimize `get_untracked_files()` and `check_changes()`

2018-09-03 Thread Johannes Schindelin
Hi Paul, On Fri, 31 Aug 2018, Paul-Sebastian Ungureanu wrote: > This commits introduces a optimization by avoiding calling the > same functions again. For example, `git stash push -u` > would call at some points the following functions: > > * `check_changes()` (inside `do_push_stash()`) > *

Re: [GSoC][PATCH v8 17/20] stash: convert save to builtin

2018-09-03 Thread Johannes Schindelin
Hi Paul, On Fri, 31 Aug 2018, Paul-Sebastian Ungureanu wrote: > Add stash save to the helper and delete functions which are no > longer needed (`show_help()`, `save_stash()`, `push_stash()`, > `create_stash()`, `clear_stash()`, `untracked_files()` and > `no_changes()`). > > The `-m` option is

test files with same names?

2018-09-03 Thread Duy Nguyen
We have these test files with the same description: t0410-partial-clone.sh t5616-partial-clone.sh t2000-checkout-cache-clash.sh t2001-checkout-cache-clash.sh t4134-apply-submodule.sh t4137-apply-submodule.sh t7500-commit.sh t7501-commit.sh t7502-commit.sh t7509-commit.sh partial-clone files, I

[PATCH v2 23/24] revision.c: reduce implicit dependency the_repository

2018-09-03 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- list-objects.c | 8 +--- revision.c | 44 +++- revision.h | 2 +- 3 files changed, 29 insertions(+), 25 deletions(-) diff --git a/list-objects.c b/list-objects.c index c99c47ac18..0c2989d5ca 100644 ---

[PATCH v2 24/24] Rename functions to avoid breaking in-flight topics

2018-09-03 Thread Nguyễn Thái Ngọc Duy
The three functions init_revisions(), diff_setup() and rerere() are prefixed temporarily with repo_ to avoid breaking other topics which add new call sites for these functions. This is a temporary measure. Once everything is merged, it will be reverted and the new call sites fixed. Signed-off-by:

[PATCH v2 18/24] line-range.c: remove implicit dependency on the_index

2018-09-03 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/blame.c | 2 +- line-log.c | 4 ++-- line-range.c| 22 ++ line-range.h| 6 -- 4 files changed, 21 insertions(+), 13 deletions(-) diff --git a/builtin/blame.c b/builtin/blame.c index c2da673ac8..97632828db

[PATCH v2 20/24] tree-diff.c: remove implicit dependency on the_index

2018-09-03 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- tree-diff.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tree-diff.c b/tree-diff.c index 1cfd77ae6b..86cf5a3971 100644 --- a/tree-diff.c +++ b/tree-diff.c @@ -605,7 +605,7 @@ static void try_to_follow_renames(const struct object_id

[PATCH v2 19/24] submodule.c: remove implicit dependency on the_index

2018-09-03 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/pull.c | 2 +- submodule.c| 28 +--- submodule.h| 9 ++--- transport.c| 9 ++--- 4 files changed, 30 insertions(+), 18 deletions(-) diff --git a/builtin/pull.c b/builtin/pull.c index

[PATCH v2 22/24] revision.c: remove implicit dependency on the_index

2018-09-03 Thread Nguyễn Thái Ngọc Duy
"remove" is probably a strong word because the dependency is still there, hidden behind the_repository. This patch is almost mechanical, all call sites are updated to take the_repository, no exception. Signed-off-by: Nguyễn Thái Ngọc Duy --- bisect.c | 4 ++--

[PATCH v2 16/24] rerere.c: remove implicit dependency on the_index

2018-09-03 Thread Nguyễn Thái Ngọc Duy
The reason rerere(), rerere_forget() and rerere_remaining() take a struct repository instead of struct index_state is not obvious from the patch: deep in update_paths() and find_conflict(), hold_locked_index() and read_index() are called. These functions assumes the index path at $GIT_DIR/index

[PATCH v2 21/24] ws.c: remove implicit dependency on the_index

2018-09-03 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- apply.c | 8 +--- cache.h | 2 +- diff.c | 6 +++--- ws.c| 5 ++--- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/apply.c b/apply.c index d80b3547c2..fc52993548 100644 --- a/apply.c +++ b/apply.c @@ -2131,10 +2131,12 @@ static

[PATCH v2 17/24] userdiff.c: remove implicit dependency on the_index

2018-09-03 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- archive-zip.c | 14 +- builtin/grep.c | 3 ++- combine-diff.c | 2 +- diff.c | 40 +++- diff.h | 3 ++- diffcore-pickaxe.c | 4 ++-- grep.c | 21

[PATCH v2 10/24] diff-lib.c: remove implicit dependency on the_index

2018-09-03 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- diff-lib.c | 17 ++--- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/diff-lib.c b/diff-lib.c index 88a98b1c06..c54773fe12 100644 --- a/diff-lib.c +++ b/diff-lib.c @@ -70,7 +70,7 @@ static int match_stat_with_submodule(struct

[PATCH v2 11/24] ll-merge.c: remove implicit dependency on the_index

2018-09-03 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- apply.c| 9 ++--- builtin/checkout.c | 3 ++- diff.c | 2 +- ll-merge.c | 17 + ll-merge.h | 5 - merge-blobs.c | 3 ++- merge-recursive.c | 3 ++- notes-merge.c | 3 ++-

[PATCH v2 14/24] patch-ids.c: remove implicit dependency on the_index

2018-09-03 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/log.c | 2 +- patch-ids.c | 4 ++-- patch-ids.h | 3 ++- revision.c| 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/builtin/log.c b/builtin/log.c index 33084102e0..2910122d90 100644 --- a/builtin/log.c +++

[PATCH v2 13/24] merge.c: remove implicit dependency on the_index

2018-09-03 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/merge.c | 8 +--- builtin/pull.c | 7 +-- cache.h | 6 -- merge.c | 20 +++- sequencer.c | 6 +++--- 5 files changed, 28 insertions(+), 19 deletions(-) diff --git a/builtin/merge.c

[PATCH v2 00/24] Kill the_index part 4

2018-09-03 Thread Nguyễn Thái Ngọc Duy
v2 changes: - the 'repo' argument is renamed to 'r' in most places. I still keep 'repo' as the name if it's not the first argument (i.e. it's some normal parameter and not the "this" object in C++ sense). - I accidentally merged the diff.c changes into the 'read-cache.c: remove const...'

[PATCH v2 05/24] blame.c: rename "repo" argument to "r"

2018-09-03 Thread Nguyễn Thái Ngọc Duy
The current naming convention for 'struct repository *' is 'r' for temporary variables or arguments. I did not notice this. Since we're updating blame.c again in the next patch, let's fix this. Signed-off-by: Nguyễn Thái Ngọc Duy --- blame.c | 36 ++-- 1 file

[PATCH v2 07/24] grep.c: remove implicit dependency on the_index

2018-09-03 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/grep.c | 4 ++-- builtin/log.c | 2 +- grep.c | 13 - grep.h | 7 +-- revision.c | 4 ++-- 5 files changed, 18 insertions(+), 12 deletions(-) diff --git a/builtin/grep.c b/builtin/grep.c index

[PATCH v2 15/24] sha1-file.c: remove implicit dependency on the_index

2018-09-03 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/difftool.c | 2 +- builtin/hash-object.c | 2 +- builtin/replace.c | 2 +- builtin/update-index.c | 2 +- cache.h| 4 ++-- diff.c | 20 - notes-merge.c | 2 +- read-cache.c

[PATCH v2 06/24] diff.c: remove the_index dependency in textconv() functions

2018-09-03 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- blame.c| 7 --- builtin/cat-file.c | 6 -- builtin/log.c | 3 ++- combine-diff.c | 27 --- diff.c | 17 + diff.h | 9 +++-- diffcore-pickaxe.c | 4 ++--

[PATCH v2 03/24] diff.c: reduce implicit dependency on the_index

2018-09-03 Thread Nguyễn Thái Ngọc Duy
diff and textconv code has so widespread use that it's hard to simply update their api and all call sites at once because it would result in a big patch. For now reduce the_index references to two places: diff_setup() and fill_textconv(). Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/reset.c

[PATCH v2 12/24] merge-blobs.c: remove implicit dependency on the_index

2018-09-03 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/merge-tree.c | 2 +- merge-blobs.c| 15 +++ merge-blobs.h| 7 +-- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/builtin/merge-tree.c b/builtin/merge-tree.c index f8023bae1e..f32941fdab 100644 ---

[PATCH v2 02/24] read-cache.c: remove 'const' from index_has_changes()

2018-09-03 Thread Nguyễn Thái Ngọc Duy
This function calls do_diff_cache() which eventually needs to set this "istate" to unpack_options->src_index (*). This is an unfortunate fact that unpack_trees() _will_ destroy src_index so we can't really pass a const index_state there. Just remove 'const'. (*) Right now diff_cache() in

[PATCH v2 04/24] combine-diff.c: remove implicit dependency on the_index

2018-09-03 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- combine-diff.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/combine-diff.c b/combine-diff.c index de7695e728..4fa7707b57 100644 --- a/combine-diff.c +++ b/combine-diff.c @@ -1054,7 +1054,8 @@ static void show_patch_diff(struct

[PATCH v2 09/24] read-cache.c: remove implicit dependency on the_index

2018-09-03 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- read-cache.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/read-cache.c b/read-cache.c index 8e92b1e21f..b9df81e94e 100644 --- a/read-cache.c +++ b/read-cache.c @@ -823,7 +823,7 @@ struct cache_entry *make_cache_entry(struct

[PATCH v2 01/24] archive.c: remove implicit dependency the_repository

2018-09-03 Thread Nguyễn Thái Ngọc Duy
The new "repo" field in archive_args has been added since b612ee202a (archive.c: avoid access to the_index - 2018-08-13). Use it instead of hard coding the_repository. Signed-off-by: Nguyễn Thái Ngọc Duy --- archive.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/archive.c

[PATCH v2 08/24] diff.c: remove implicit dependency on the_index

2018-09-03 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- blame.c | 20 +++- builtin/diff.c | 2 +- builtin/log.c| 2 +- builtin/merge.c | 2 +- builtin/range-diff.c | 2 +- diff-no-index.c | 9 +++-- diff.c | 4 ++-- diff.h

Re: [PATCH 12/21] patch-ids.c: remove implicit dependency on the_index

2018-09-03 Thread Duy Nguyen
On Mon, Aug 27, 2018 at 9:13 PM Stefan Beller wrote: > > > -int init_patch_ids(struct patch_ids *ids) > > +int init_patch_ids(struct patch_ids *ids, struct repository *repo) > > { > > memset(ids, 0, sizeof(*ids)); > > - diff_setup(>diffopts, the_repository); > > +

Re: [PATCH] i18n: fix mistakes in translated strings

2018-09-03 Thread Jean-Noël AVILA
Le jeudi 23 août 2018, 23:28:55 CEST Junio C Hamano a écrit : > Jean-Noël Avila writes: > > > - die(_("run_command returned non-zero status while" > > + die(_("run_command returned non-zero status while " > > "recursing in the

Re: [PATCH] bisect.c: make show_list() build again

2018-09-03 Thread Duy Nguyen
On Sun, Sep 2, 2018 at 9:57 AM Christian Couder wrote: > > On Sun, Sep 2, 2018 at 9:42 AM, Nguyễn Thái Ngọc Duy > wrote: > > > In order to stop this from happening again, the function is now > > compiled unconditionally but exits early unless DEBUG_BISECT is > > non-zero. > > Thanks for going

Re: non-smooth progress indication for git fsck and git gc

2018-09-03 Thread Ævar Arnfjörð Bjarmason
On Sun, Sep 02 2018, Jeff King wrote: > On Sun, Sep 02, 2018 at 03:55:28AM -0400, Jeff King wrote: > >> I still think the more interesting long-term thing here is to reuse the >> pack verification from index-pack, which actually hashes as it does the >> per-object countup. >> >> That code isn't

Re: [GSoC][PATCH v8 14/20] stash: convert create to builtin

2018-09-03 Thread Johannes Schindelin
Hi Paul, On Fri, 31 Aug 2018, Paul-Sebastian Ungureanu wrote: > diff --git a/builtin/stash--helper.c b/builtin/stash--helper.c > index 87568b0f34..ce360a569d 100644 > --- a/builtin/stash--helper.c > +++ b/builtin/stash--helper.c > @@ -290,6 +296,18 @@ static int reset_head(void) > return

Re: [GSoC][PATCH v8 18/20] stash: convert `stash--helper.c` into `stash.c`

2018-09-03 Thread Johannes Schindelin
Hi Paul, On Fri, 31 Aug 2018, Paul-Sebastian Ungureanu wrote: > diff --git a/builtin/stash--helper.c b/builtin/stash.c > similarity index 90% > rename from builtin/stash--helper.c > rename to builtin/stash.c > index 1269f2548c..3d2316e3f7 100644 > --- a/builtin/stash--helper.c > +++

[PATCH v5 10/10] fsck: support comments & empty lines in skipList

2018-09-03 Thread Ævar Arnfjörð Bjarmason
It's annoying not to be able to put comments and empty lines in the skipList, when e.g. keeping a big central list of commits to skip in /etc/gitconfig, which was my motivation for 1362df0d41 ("fetch: implement fetch.fsck.*", 2018-07-27). Implement that, and document what version of Git this was

[PATCH v5 07/10] fsck: add a performance test for skipList

2018-09-03 Thread Ævar Arnfjörð Bjarmason
From: René Scharfe Create a performance test to see how the skipList implementation performs. First we setup N bad commits, then we see how progressively working our way up to 0..N in increments of 10x does. I.e. the needle(s) in the haystack get progressively more numerous. Signed-off-by: René

[PATCH v5 04/10] fsck: document and test commented & empty line skipList input

2018-09-03 Thread Ævar Arnfjörð Bjarmason
There is currently no comment syntax for the fsck.skipList, this isn't really by design, and it would be nice to have support for comments. Document that this doesn't work, and test for how this errors out. These tests reveal a current bug, if there's invalid input the output will emit some of

[PATCH v5 09/10] fsck: use oidset instead of oid_array for skipList

2018-09-03 Thread Ævar Arnfjörð Bjarmason
From: René Scharfe Change the implementation of the skipList feature to use oidset instead of oid_array to store SHA-1s for later lookup. This list is parsed once on startup by fsck, fetch-pack or receive-pack depending on the *.skipList config in use. I.e. only once per invocation, but note

[PATCH v5 06/10] fsck: add a performance test

2018-09-03 Thread Ævar Arnfjörð Bjarmason
Add a plain performance test for "fsck". This test will not be used to / referred to in any upcoming commit of mine in this series, but having a simple test for fsck performance is valuable, so let's add it while we're at it. Signed-off-by: Ævar Arnfjörð Bjarmason --- t/perf/p1450-fsck.sh | 13

[PATCH v5 01/10] fsck tests: setup of bogus commit object

2018-09-03 Thread Ævar Arnfjörð Bjarmason
Several fsck tests used the exact same git-hash-object output, but had copy/pasted that part of the setup code. Let's instead do that setup once and use it in subsequent tests. Signed-off-by: Ævar Arnfjörð Bjarmason --- t/t5504-fetch-receive-strict.sh | 8 1 file changed, 4

[PATCH v5 05/10] fsck: document that skipList input must be unabbreviated

2018-09-03 Thread Ævar Arnfjörð Bjarmason
Abbreviating the SHA-1s in the skipList input has never worked, but the documentation hasn't unambiguously stated that this is an error, and there was no test for it. Let's fix both since it would be easy for some later refactoring e.g. switch to accidentally switch to a looser OID parsing

[PATCH v5 08/10] fsck: use strbuf_getline() to read skiplist file

2018-09-03 Thread Ævar Arnfjörð Bjarmason
From: René Scharfe The buffer is unlikely to contain a NUL character, so printing its contents using %s in a die() format is unsafe (detected with ASan). Use an idiomatic strbuf_getline() loop instead, which ensures the buffer is always NUL-terminated, supports CRLF files as well, accepts files

[PATCH v5 03/10] fsck: document and test sorted skipList input

2018-09-03 Thread Ævar Arnfjörð Bjarmason
Ever since the skipList support was first added in cd94c6f91 ("fsck: git receive-pack: support excluding objects from fsck'ing", 2015-06-22) the documentation for the format has that the file is a sorted list of object names. Thus, anyone using the feature would have thought the list needed to be

[PATCH v5 00/10] use oidset for skiplist + docs + tests + comment support

2018-09-03 Thread Ævar Arnfjörð Bjarmason
Addresses feedback René had on v4. Notes below: René Scharfe (3): fsck: add a performance test for skipList fsck: use strbuf_getline() to read skiplist file No changes. fsck: use oidset instead of oid_array for skipList Now we note in the commit message that the skipList is re-consulted

[PATCH v5 02/10] fsck tests: add a test for no skipList input

2018-09-03 Thread Ævar Arnfjörð Bjarmason
The recent 65a836fa6b ("fsck: add stress tests for fsck.skipList", 2018-07-27) added various stress tests for odd invocations of fsck.skipList, but didn't tests for some very simple ones, such as asserting that providing to skipList with a bad commit causes fsck to exit with a non-zero exit code.

Re: [GSoC][PATCH v8 15/20] stash: convert push to builtin

2018-09-03 Thread Johannes Schindelin
Hi Paul, On Fri, 31 Aug 2018, Paul-Sebastian Ungureanu wrote: > diff --git a/builtin/stash--helper.c b/builtin/stash--helper.c > index ce360a569d..23670321d8 100644 > --- a/builtin/stash--helper.c > +++ b/builtin/stash--helper.c > @@ -1204,6 +1214,223 @@ static int create_stash(int argc, const

Re: [GSoC][PATCH v8 08/20] stash: convert branch to builtin

2018-09-03 Thread Johannes Schindelin
Hi Paul, On Fri, 31 Aug 2018, Paul-Sebastian Ungureanu wrote: > diff --git a/builtin/stash--helper.c b/builtin/stash--helper.c > index cbe23fef11..dadc028649 100644 > --- a/builtin/stash--helper.c > +++ b/builtin/stash--helper.c > @@ -535,6 +541,42 @@ static int drop_stash(int argc, const char

Re: [GSoC][PATCH v8 13/20] stash: convert store to builtin

2018-09-03 Thread Johannes Schindelin
Hi Paul, On Fri, 31 Aug 2018, Paul-Sebastian Ungureanu wrote: > diff --git a/builtin/stash--helper.c b/builtin/stash--helper.c > index 02b593e0cd..87568b0f34 100644 > --- a/builtin/stash--helper.c > +++ b/builtin/stash--helper.c > @@ -723,6 +728,54 @@ static int show_stash(int argc, const char

Re: Trivial enhancement: All commands which require an author should accept --author

2018-09-03 Thread Ævar Arnfjörð Bjarmason
On Thu, Aug 30 2018, Johannes Schindelin wrote: > Hi Ævar, > > On Thu, 30 Aug 2018, Ævar Arnfjörð Bjarmason wrote: > >> On Thu, Aug 30 2018, Johannes Schindelin wrote: >> >> > On Wed, 29 Aug 2018, Junio C Hamano wrote: >> > >> >> Johannes Schindelin writes: >> >> >> >> > The `stash` command

git log --author-date-order not always working

2018-09-03 Thread thomas menzel
hi, i just ran into this little possible bug but cant pin it down any further as it happens against a git repo for work project that i cant share. when i run this git log against my repo i get this wrong sort order (1st col is authored date and 2nd is commit date): $ git log --author=menzel

Re: [GSoC][PATCH v8 05/20] stash: add tests for `git stash show` config

2018-09-03 Thread Johannes Schindelin
Hi Junio, On Thu, 30 Aug 2018, Junio C Hamano wrote: > Paul-Sebastian Ungureanu writes: > > +test_stat_and_patch () { > > + if test "" = "$1" > > + then > > + test_might_fail git config --unset stash.showStat > > + else > > + test_config stash.showStat "$1" > > + fi

Re: Feature request: hooks directory

2018-09-03 Thread Wesley Schwengle
Hello Christian, 2018-09-03 6:00 GMT+02:00 Christian Couder : > Hi Wesley, > > On Sun, Sep 2, 2018 at 11:38 PM, Wesley Schwengle wrote: >> Hi all, >> >> I've made some progress with the hook.d implementation. It isn't >> finished, as it is my first C project I'm still somewhat rocky with >> how