threads / patch / 41451

patchtests: rename work-tree tests to *work-tree*

Subject: [PATCH] tests: rename work-tree tests to *work-tree*

## tl;dr

4 messages between Feb 20, 2016 and Feb 22, 2016. Diffs are folded; open one to read it.

replies: 3people: 2as markdown or json

Michael J Gruber· Feb 20, 2016, 16:18 UTC · lore

"Work tree" or "working tree" is the name of a checked out tree, "worktree" the name of the command which manages several working trees. The naming of tests mixes these two, currently:

$ls t/*worktree* t/t1501-worktree.sh t/t1509-root-worktree.sh t/t2025-worktree-add.sh t/t2026-worktree-prune.sh t/t2027-worktree-list.sh t/t2104-update-index-skip-worktree.sh t/t3320-notes-merge-worktrees.sh t/t7011-skip-worktree-reading.sh t/t7012-skip-worktree-writing.sh t/t7409-submodule-detached-worktree.sh

$grep -l "git worktree" t/*.sh t/t0002-gitfile.sh t/t1400-update-ref.sh t/t2025-worktree-add.sh t/t2026-worktree-prune.sh t/t2027-worktree-list.sh t/t3320-notes-merge-worktrees.sh t/t7410-submodule-checkout-to.sh

Rename t1501, t1509 and t7409 to make it clear on first glance that they test work tree related behavior, rather than the worktree command.

t2104, t7011 and t7012 are about the "skip-worktree" flag so that their name should remain unchanged.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
---
Just some housekeeping. Not super necessary, but should make it easier to find
the right test to amend, for example.
 t/{t1501-worktree.sh => t1501-work-tree.sh}                               | 0
 t/{t1509-root-worktree.sh => t1509-root-work-tree.sh}                     | 0
 ...bmodule-detached-worktree.sh => t7409-submodule-detached-work-tree.sh} | 0
 3 files changed, 0 insertions(+), 0 deletions(-)
 rename t/{t1501-worktree.sh => t1501-work-tree.sh} (100%)
 rename t/{t1509-root-worktree.sh => t1509-root-work-tree.sh} (100%)
 rename t/{t7409-submodule-detached-worktree.sh => t7409-submodule-detached-work-tree.sh} (100%)
Show changes to 3 files +0 −0

t/t1501-worktree.sh, t/t1509-root-worktree.sh, t/t7409-submodule-detached-worktree.sh

diff --git a/t/t1501-worktree.sh b/t/t1501-work-tree.sh
similarity index 100%
rename from t/t1501-worktree.sh
rename to t/t1501-work-tree.sh
diff --git a/t/t1509-root-worktree.sh b/t/t1509-root-work-tree.sh
similarity index 100%
rename from t/t1509-root-worktree.sh
rename to t/t1509-root-work-tree.sh
diff --git a/t/t7409-submodule-detached-worktree.sh b/t/t7409-submodule-detached-work-tree.sh
similarity index 100%
rename from t/t7409-submodule-detached-worktree.sh
rename to t/t7409-submodule-detached-work-tree.sh
-- 
2.7.1.428.g2de392b
Junio C Hamano· Feb 20, 2016, 21:42 UTC · re: Michael J Gruber · lore

Re: [PATCH] tests: rename work-tree tests to *work-tree*

Michael J Gruber <git@drmicha.warpmail.net> writes:
Show 16 quoted lines
> "Work tree" or "working tree" is the name of a checked out tree,
> "worktree" the name of the command which manages several working trees.
> The naming of tests mixes these two, currently:
>
> $ls t/*worktree*
> ...
> Rename t1501, t1509 and t7409 to make it clear on first glance that they
> test work tree related behavior, rather than the worktree command.
>
> t2104, t7011 and t7012 are about the "skip-worktree" flag so that their
> name should remain unchanged.
>
> Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
> ---
> Just some housekeeping. Not super necessary, but should make it easier to find
> the right test to amend, for example.

That is rather unfortunate. Most of them predate the "worktree" subcommand, I think, and having to rename them merely because a subcommand with a confusing name appeared sound somewhat backwards.

Michael J Gruber· Feb 22, 2016, 10:35 UTC · re: Junio C Hamano · lore

Re: [PATCH] tests: rename work-tree tests to *work-tree*

Junio C Hamano venit, vidit, dixit 20.02.2016 22:42:
Show 22 quoted lines
> Michael J Gruber <git@drmicha.warpmail.net> writes:
> 
>> "Work tree" or "working tree" is the name of a checked out tree,
>> "worktree" the name of the command which manages several working trees.
>> The naming of tests mixes these two, currently:
>>
>> $ls t/*worktree*
>> ...
>> Rename t1501, t1509 and t7409 to make it clear on first glance that they
>> test work tree related behavior, rather than the worktree command.
>>
>> t2104, t7011 and t7012 are about the "skip-worktree" flag so that their
>> name should remain unchanged.
>>
>> Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
>> ---
>> Just some housekeeping. Not super necessary, but should make it easier to find
>> the right test to amend, for example.
> 
> That is rather unfortunate.  Most of them predate the "worktree"
> subcommand, I think, and having to rename them merely because a
> subcommand with a confusing name appeared sound somewhat backwards.
The question is: What ist the way forward?

I was looking for a proper place for a "git worktree" test and got confused by the status quo. My suggestion is one way to help that confusion, but I'd be happy to learn other ways. "grep" is an answer, too.

Maybe it's also time to admit that the numbering and naming scheme in t/ don't scale and that we should rather support other means of navigating t/, such as standardizing a comment boiler plate in each test or such.

In fact, giving up on the numbering scheme would allow to regroup tests more easily because there would be no room constraint any more (within a fixed finite set of numbers).

Michael
Junio C Hamano· Feb 22, 2016, 17:57 UTC · re: Michael J Gruber · lore

Re: [PATCH] tests: rename work-tree tests to *work-tree*

Michael J Gruber <git@drmicha.warpmail.net> writes:
Show 5 quoted lines
>> That is rather unfortunate.  Most of them predate the "worktree"
>> subcommand, I think, and having to rename them merely because a
>> subcommand with a confusing name appeared sound somewhat backwards.
>
> The question is: What ist the way forward?

Probably many. Take this as-is is one, rename newer ones that are about worktree subcommand to "s/worktree/worktree-cmd/" would be another.

Show 7 quoted lines
> I was looking for a proper place for a "git worktree" test and got
> confused by the status quo. My suggestion is one way to help that
> confusion, but I'd be happy to learn other ways. "grep" is an answer, too.
>
> Maybe it's also time to admit that the numbering and naming scheme in t/
> don't scale and that we should rather support other means of navigating
> t/, such as standardizing a comment boiler plate in each test or such.

Yeah, test_description at the beginning of each test may have been a well meaning attempt, but it is not helping us very much.

> In fact, giving up on the numbering scheme would allow to regroup tests
> more easily because there would be no room constraint any more (within a
> fixed finite set of numbers).

I tend to agree that may be an easier way forward in the longer term.

Thanks.

← back to recent threads