Re: [RFC PATCH] t/helper: Move sources to t/helper-src; gitignore any files in t/helper

2017-12-12 Thread Junio C Hamano
Stefan Beller  writes:

> Compiled test helpers in t/helper are out of sync with the .gitignore
> files quite frequently. This can happen when new test helpers are added,
> but the explicit .gitignore file is not updated in the same commit, or
> when you forget to 'make clean' before checking out a different version
> of git, as the different version may have a different explicit list of
> test helpers to ignore.
>
> This can be fixed by using overly broad ignore patterns, such as ignoring
> the whole directory via '//t/helper/*' in .gitignore.

If we ignore everything but resurrect *.[ch] with negative exclude
rules, can we do the same without moving things around?


[RFC PATCH] t/helper: Move sources to t/helper-src; gitignore any files in t/helper

2017-12-12 Thread Stefan Beller
Compiled test helpers in t/helper are out of sync with the .gitignore
files quite frequently. This can happen when new test helpers are added,
but the explicit .gitignore file is not updated in the same commit, or
when you forget to 'make clean' before checking out a different version
of git, as the different version may have a different explicit list of
test helpers to ignore.

This can be fixed by using overly broad ignore patterns, such as ignoring
the whole directory via '//t/helper/*' in .gitignore.

However we do not want to have an overlap of checked source files and
ignored files, hence we'll move the the source files currently residing
in t/helper to t/helper-src. To accommodate that we'll need to update
the Makefile as well to look at a different place for the source files.
(This patch takes the hacky approach in symlinking the sources back into
the t/helper, which we'd want to avoid long term)

Signed-off-by: Stefan Beller 
---
 Makefile   |  4 +++
 t/{helper => helper-src}/.gitignore|  0
 t/{helper => helper-src}/test-chmtime.c|  0
 t/{helper => helper-src}/test-config.c |  0
 t/{helper => helper-src}/test-ctype.c  |  0
 t/{helper => helper-src}/test-date.c   |  0
 t/{helper => helper-src}/test-delta.c  |  0
 t/{helper => helper-src}/test-dump-cache-tree.c|  0
 t/{helper => helper-src}/test-dump-split-index.c   |  0
 .../test-dump-untracked-cache.c|  0
 t/{helper => helper-src}/test-fake-ssh.c   |  0
 t/{helper => helper-src}/test-genrandom.c  |  0
 t/{helper => helper-src}/test-hashmap.c|  0
 t/{helper => helper-src}/test-index-version.c  |  0
 .../test-lazy-init-name-hash.c |  0
 t/{helper => helper-src}/test-line-buffer.c|  0
 t/{helper => helper-src}/test-match-trees.c|  0
 t/{helper => helper-src}/test-mergesort.c  |  0
 t/{helper => helper-src}/test-mktemp.c |  0
 t/{helper => helper-src}/test-online-cpus.c|  0
 t/{helper => helper-src}/test-parse-options.c  |  0
 t/{helper => helper-src}/test-path-utils.c |  0
 t/{helper => helper-src}/test-prio-queue.c |  0
 t/{helper => helper-src}/test-read-cache.c |  0
 t/{helper => helper-src}/test-ref-store.c  |  0
 t/{helper => helper-src}/test-regex.c  |  0
 t/{helper => helper-src}/test-revision-walking.c   |  0
 t/{helper => helper-src}/test-run-command.c|  0
 t/{helper => helper-src}/test-scrap-cache-tree.c   |  0
 t/{helper => helper-src}/test-sha1-array.c |  0
 t/{helper => helper-src}/test-sha1.c   |  0
 t/{helper => helper-src}/test-sha1.sh  |  0
 t/{helper => helper-src}/test-sigchain.c   |  0
 t/{helper => helper-src}/test-strcmp-offset.c  |  0
 t/{helper => helper-src}/test-string-list.c|  0
 t/{helper => helper-src}/test-submodule-config.c   |  0
 t/{helper => helper-src}/test-subprocess.c |  0
 t/{helper => helper-src}/test-svn-fe.c |  0
 .../test-urlmatch-normalization.c  |  0
 t/{helper => helper-src}/test-wildmatch.c  |  0
 t/{helper => helper-src}/test-write-cache.c|  0
 t/helper/.gitignore| 39 +-
 42 files changed, 5 insertions(+), 38 deletions(-)
 copy t/{helper => helper-src}/.gitignore (100%)
 rename t/{helper => helper-src}/test-chmtime.c (100%)
 rename t/{helper => helper-src}/test-config.c (100%)
 rename t/{helper => helper-src}/test-ctype.c (100%)
 rename t/{helper => helper-src}/test-date.c (100%)
 rename t/{helper => helper-src}/test-delta.c (100%)
 rename t/{helper => helper-src}/test-dump-cache-tree.c (100%)
 rename t/{helper => helper-src}/test-dump-split-index.c (100%)
 rename t/{helper => helper-src}/test-dump-untracked-cache.c (100%)
 rename t/{helper => helper-src}/test-fake-ssh.c (100%)
 rename t/{helper => helper-src}/test-genrandom.c (100%)
 rename t/{helper => helper-src}/test-hashmap.c (100%)
 rename t/{helper => helper-src}/test-index-version.c (100%)
 rename t/{helper => helper-src}/test-lazy-init-name-hash.c (100%)
 rename t/{helper => helper-src}/test-line-buffer.c (100%)
 rename t/{helper => helper-src}/test-match-trees.c (100%)
 rename t/{helper => helper-src}/test-mergesort.c (100%)
 rename t/{helper => helper-src}/test-mktemp.c (100%)
 rename t/{helper => helper-src}/test-online-cpus.c (100%)
 rename t/{helper => helper-src}/test-parse-options.c (100%)
 rename t/{helper => helper-src}/test-path-utils.c (100%)
 rename t/{helper => helper-src}/test-prio-queue.c (100%)
 rename t/{helper => helper-src}/test-read-cache.c (100%)
 rename t/{helper => helper-src}/test-ref-store.c (100%)
 rename t/{helper => helper-src}/test-regex.c (100%)
 rename t/{helper => helper-src}/test-revision-walking.c (100%)
 rename t/{helper =>