threads / patch / 15346

patch, 4 partstests: use "git xyzzy" form

Subject: [PATCH 0/4] tests: use "git xyzzy" form

## tl;dr

7 messages between Sep 3, 2008 and Sep 3, 2008. Diffs are folded; open one to read it.

replies: 6people: 4as markdown or json

Nanako Shiraishi· Sep 3, 2008, 08:59 UTC · lore

These four patches update test scripts to use "git xyzzy" format so that they can serve as sample usage for git commands better.

 [PATCH 1/4] tests: use "git xyzzy" form (t0000 - t3599)
 [PATCH 2/4] tests: use "git xyzzy" form (t3600 - t6999)
 [PATCH 3/4] tests: use "git xyzzy" form (t7000 - t7199)
 [PATCH 4/4] tests: use "git xyzzy" form (t7200 - t9001)
 t/t0050-filesystem.sh                |    2 +-
 t/t1007-hash-object.sh               |    2 +-
 t/t1200-tutorial.sh                  |    2 +-
 t/t1303-wacky-config.sh              |    2 +-
 t/t1400-update-ref.sh                |   10 +-
 t/t1503-rev-parse-verify.sh          |    2 +-
 t/t2005-checkout-index-symlinks.sh   |    4 +-
 t/t2050-git-dir-relative.sh          |    4 +-
 t/t2101-update-index-reupdate.sh     |    2 +-
 t/t2102-update-index-symlinks.sh     |    2 +-
 t/t2200-add-update.sh                |   12 +-
 t/t3001-ls-files-others-exclude.sh   |    2 +-
 t/t3020-ls-files-error-unmatch.sh    |    2 +-
 t/t3030-merge-recursive.sh           |   14 +-
 t/t3200-branch.sh                    |   58 +++---
 t/t3210-pack-refs.sh                 |    4 +-
 t/t3400-rebase.sh                    |    6 +-
 t/t3401-rebase-partial.sh            |   22 ++--
 t/t3403-rebase-skip.sh               |    2 +-
 t/t3404-rebase-interactive.sh        |    2 +-
 t/t3407-rebase-abort.sh              |    2 +-
 t/t3500-cherry.sh                    |   12 +-
 t/t3600-rm.sh                        |    4 +-
 t/t3800-mktag.sh                     |   12 +-
 t/t3900-i18n-commit.sh               |    6 +-
 t/t3901-i18n-patch.sh                |   16 +-
 t/t3903-stash.sh                     |    2 +-
 t/t4012-diff-binary.sh               |    4 +-
 t/t4103-apply-binary.sh              |   26 ++--
 t/t4124-apply-ws-rule.sh             |    2 +-
 t/t4127-apply-same-fn.sh             |    4 +-
 t/t4150-am.sh                        |    2 +-
 t/t4151-am-abort.sh                  |    4 +-
 t/t5300-pack-object.sh               |   14 +-
 t/t5301-sliding-window.sh            |    4 +-
 t/t5302-pack-index.sh                |   12 +-
 t/t5400-send-pack.sh                 |   30 ++--
 t/t5401-update-hooks.sh              |    4 +-
 t/t5402-post-merge-hook.sh           |    4 +-
 t/t5403-post-checkout-hook.sh        |    4 +-
 t/t5500-fetch-pack.sh                |    4 +-
 t/t5510-fetch.sh                     |    2 +-
 t/t5530-upload-pack-error.sh         |    4 +-
 t/t5600-clone-fail-cleanup.sh        |   12 +-
 t/t5602-clone-remote-exec.sh         |    4 +-
 t/t6006-rev-list-format.sh           |    6 +-
 t/t6025-merge-symlinks.sh            |   32 ++--
 t/t6026-merge-attr.sh                |   12 +-
 t/t6030-bisect-porcelain.sh          |    4 +-
 t/t6120-describe.sh                  |   30 ++--
 t/t6300-for-each-ref.sh              |   28 ++--
 t/t7001-mv.sh                        |   12 +-
 t/t7003-filter-branch.sh             |   22 ++--
 t/t7004-tag.sh                       |  318 +++++++++++++++++-----------------
 t/t7101-reset.sh                     |    8 +-
 t/t7102-reset.sh                     |    4 +-
 t/t7103-reset-bare.sh                |    2 +-
 t/t7201-co.sh                        |    2 +-
 t/t7300-clean.sh                     |   72 ++++----
 t/t7400-submodule-basic.sh           |   48 +++---
 t/t7401-submodule-summary.sh         |    2 +-
 t/t7500-commit.sh                    |    2 +-
 t/t7501-commit.sh                    |   48 +++---
 t/t7502-status.sh                    |    2 +-
 t/t7505-prepare-commit-msg-hook.sh   |    2 +-
 t/t7506-status-submodule.sh          |    2 +-
 t/t7600-merge.sh                     |    2 +-
 t/t7601-merge-pull-config.sh         |    2 +-
 t/t7602-merge-octopus-many.sh        |    2 +-
 t/t7603-merge-reduce-heads.sh        |    2 +-
 t/t7604-merge-custom-message.sh      |    2 +-
 t/t7605-merge-resolve.sh             |    2 +-
 t/t7610-mergetool.sh                 |    2 +-
 t/t7701-repack-unpack-unreachable.sh |    2 +-
 t/t9001-send-email.sh                |    2 +-
 75 files changed, 513 insertions(+), 513 deletions(-)
-- 
Nanako Shiraishi
http://ivory.ap.teacup.com/nanako3/
Andreas Ericsson· Sep 3, 2008, 10:55 UTC · re: Nanako Shiraishi · lore

Re: [PATCH 0/4] tests: use "git xyzzy" form

Nanako Shiraishi wrote:
Show 8 quoted lines
> These four patches update test scripts to use "git xyzzy" format so that
> they can serve as sample usage for git commands better.
> 
>  [PATCH 1/4] tests: use "git xyzzy" form (t0000 - t3599)
>  [PATCH 2/4] tests: use "git xyzzy" form (t3600 - t6999)
>  [PATCH 3/4] tests: use "git xyzzy" form (t7000 - t7199)
>  [PATCH 4/4] tests: use "git xyzzy" form (t7200 - t9001)
> 

Are you absolutely 100% certain that what you're testing is still the files in the build directory after applying these patches?

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231
Junio C Hamano· Sep 3, 2008, 20:01 UTC · re: Andreas Ericsson · lore

Re: [PATCH 0/4] tests: use "git xyzzy" form

Andreas Ericsson <ae@op5.se> writes:
Show 11 quoted lines
> Nanako Shiraishi wrote:
>> These four patches update test scripts to use "git xyzzy" format so that
>> they can serve as sample usage for git commands better.
>>
>>  [PATCH 1/4] tests: use "git xyzzy" form (t0000 - t3599)
>>  [PATCH 2/4] tests: use "git xyzzy" form (t3600 - t6999)
>>  [PATCH 3/4] tests: use "git xyzzy" form (t7000 - t7199)
>>  [PATCH 4/4] tests: use "git xyzzy" form (t7200 - t9001)
>
> Are you absolutely 100% certain that what you're testing is still
> the files in the build directory after applying these patches?

Very good point, but that issue has been with us forever before these patches, because many command invocations do use "git foo" form already. t/test-lib.sh is supposed to make sure the tests do not refer to installed git.

My primary development box does not have any git installed on the system path, and I keep a bunch of installations with prefix=$HOME/git-$variant/ where $variant are master, next, maint, plus things like v1.3.0, v1.4.4.4, etc.

$PATH begins with "/home/junio/gitstuff/bin:/home/junio/git-active/bin:" before the usual /usr/bin:/bin and friends. "gitstuff" has things like stgit, guilt and tig but no git in it. $HOME/git-active is a symbolic link to point at a specific variant installed, usually 'next' but switched to 'master' during the -rc cycle.

I created a copy of installation from git-master in git-dontuse, replaced all git and git subcommands with this shell script, and pointed at it with $HOME/git-active:

    #!/bin/sh
    echo "DO NOT USE ME"
    echo "DO NOT USE ME" >&2
    exit 1
The test passes, with or without these four patches.
Junio C Hamano· Sep 3, 2008, 20:45 UTC · re: Junio C Hamano · lore

Re: [PATCH 0/4] tests: use "git xyzzy" form

Thanks.
I looked at the output from:
    $ git grep -e git-'[a-z]' t/t[0-8]???-*.sh t/t9001-*.sh

after applying these patches to the tip of ho/dashless topic, 7e44c93 ('git foo' program identifies itself without dash in die() messages, 2008-08-31) to review what you did not change are reasonable.

I won't quote the whole output from the above grep, but there are a few lines worth commenting on.

t/t5300-pack-object.sh:test_description='git-pack-object t/t5305-include-tag.sh:test_description='git-pack-object --include-tag'

These might want changing.

t/t5602-clone-remote-exec.sh: echo "localhost git-upload-pack '\''/path/to/repo'\''" >expected t/t5602-clone-remote-exec.sh: GIT_SSH=./not_ssh git clone -u /something/bin/git-upload-pack localhost:/path/to/repo junk t/t5602-clone-remote-exec.sh: echo "localhost /something/bin/git-upload-pack '\''/path/to/repo'\''" >expected

These we do want to keep in git-foo form

The remainder of the grep output looked all reasonable; they hit options like "--git-dir" and "is-inside-git-dir", and pathnames like "git-gui" and ".git/rebase-merge/git-rebase-todo".

Doing this _carefully_ (otherwise the result would be useless) must have been quite a lot of effort, and what was posted seems to have been done quite carefully.

The cross-checking I did with "grep" in this message does *not* catch if you converted something that shouldn't have been converted (e.g. changing the pathname ".git/rebase-merge/git-rebase-todo" to "git rebase-todo" would have been a disaster). It needs real eyeballing of the patches themselves to catch such an error, and we would need help from people.

Volunteers? Just please say "I'll go through patch [n/4] line by line" now to avoid duplicated work with others (more eyeballs looking at the same thing will catch more errors, but I do not think we have that many volunteers here), and then after you are done, come back with "They all are command invocations and conversion is correct" or with "This one is incorrect and should be kept."

Oh, also, there are many other t9XXX series of tests. Can somebody volunteer to do the same for the rest of them?

Puh-leeeeze?
Jeff King· Sep 3, 2008, 20:59 UTC · re: Junio C Hamano · lore

Re: [PATCH 0/4] tests: use "git xyzzy" form

On Wed, Sep 03, 2008 at 01:45:46PM -0700, Junio C Hamano wrote:
> Doing this _carefully_ (otherwise the result would be useless) must have
> been quite a lot of effort, and what was posted seems to have been done
> quite carefully.

Yes, thank you Nanako. After complaining about it to Junio, I expected I would have to be the one to do it. But procrastination pays off once again...

Show 5 quoted lines
> The cross-checking I did with "grep" in this message does *not* catch if
> you converted something that shouldn't have been converted (e.g. changing
> the pathname ".git/rebase-merge/git-rebase-todo" to "git rebase-todo"
> would have been a disaster).  It needs real eyeballing of the patches
> themselves to catch such an error, and we would need help from people.

When I did this the last time, I recall that most of the errors of that sort tended to make the test fail loudly. So that is a point in our favor. However, I agree that eyeballing is a good strategy here.

I just checked 1/4, which looks fine. Made much easier by the use of --color-words (even easier with -U0, but sometimes the context is helpful for seeing that it is correct).

In 2/4, we change some instances of git-upload-pack, which you otherwise mentioned in your "should be left". It's in t5530 and t5602. Otherwise looks fine.

-Peff
Jeff King· Sep 3, 2008, 21:09 UTC · re: Jeff King · lore

Re: [PATCH 0/4] tests: use "git xyzzy" form

On Wed, Sep 03, 2008 at 04:59:45PM -0400, Jeff King wrote:
Show 7 quoted lines
> I just checked 1/4, which looks fine. Made much easier by the use of
> --color-words (even easier with -U0, but sometimes the context is
> helpful for seeing that it is correct).
> 
> In 2/4, we change some instances of git-upload-pack, which you otherwise
> mentioned in your "should be left". It's in t5530 and t5602. Otherwise
> looks fine.
And 3/4 and 4/4 look fine to me, too.
-Peff
Junio C Hamano· Sep 3, 2008, 21:22 UTC · re: Jeff King · lore

Re: [PATCH 0/4] tests: use "git xyzzy" form

Jeff King <peff@peff.net> writes:
Show 11 quoted lines
> On Wed, Sep 03, 2008 at 04:59:45PM -0400, Jeff King wrote:
>
>> I just checked 1/4, which looks fine. Made much easier by the use of
>> --color-words (even easier with -U0, but sometimes the context is
>> helpful for seeing that it is correct).
>> 
>> In 2/4, we change some instances of git-upload-pack, which you otherwise
>> mentioned in your "should be left". It's in t5530 and t5602. Otherwise
>> looks fine.
>
> And 3/4 and 4/4 look fine to me, too.

Thanks, both. All four patches queued (with the tweak I mentioned to the test title of t5300 and t5305 in an earlier message).

← back to recent threads