From: David Aguilar <davvid@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] difftool: add various git-difftool tests
Date: Tue, 24 Mar 2009 20:57:32 -0700 [thread overview]
Message-ID: <402731c90903242057g47cdcb2an39bbd95ff80584c6@mail.gmail.com> (raw)
In-Reply-To: <7vr60m9vca.fsf@gitster.siamese.dyndns.org>
On Tue, Mar 24, 2009 at 7:42 PM, Junio C Hamano <gitster@pobox.com> wrote:
> David Aguilar <davvid@gmail.com> writes:
>
>> +remove_config_vars()
>> +{
>> + # Unset all config variables used by git-difftool
>> + git config --unset diff.tool
>> + git config --unset difftool.test-tool.cmd
>> + git config --unset merge.tool
>> + git config --unset mergetool.test-tool.cmd
>> + return 0
>> +}
>> +
>> +restore_test_defaults()
>> +{
>> + # Restores the test defaults used by several tests
>> + remove_config_vars
>> + unset GIT_DIFF_TOOL &&
>> + unset GIT_MERGE_TOOL &&
>> + unset GIT_DIFFTOOL_NO_PROMPT &&
>
> I thought some shells' "unset" returns non-zero status when is given an
> already unset variable. I suspect you would want to drop the && chain
> just like you did for remove_config_vars for the same reason.
Ah, I learn something new everyday. Thanks.
I've addressed these notes and am sending patch v2 now.
>
>> + git config diff.tool test-tool &&
>> + git config difftool.test-tool.cmd "cat \$LOCAL"
>> +}
>
> 'cat $LOCAL' would be much easier to read, wouldn't it?
>
>> + ...
>> +# Specify the diff tool using $GIT_DIFF_TOOL
>> +test_expect_success 'GIT_DIFF_TOOL variable' '
>> + git config --unset diff.tool &&
>
> You might want to lose && here in case the user told an earlier test that
> sets the configuration to some value skipped (or such test failed), or
> perhaps later somebody adds tests before this one that leaves the config
> without this variable.
>
> Other than that I didn't see major breakages.
>
> Thanks.
>
--
David
prev parent reply other threads:[~2009-03-25 3:59 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-23 8:41 [PATCH] difftool: add git-difftool to the list of commands David Aguilar
2009-03-23 8:41 ` [PATCH] difftool: add various git-difftool tests David Aguilar
2009-03-25 2:42 ` Junio C Hamano
2009-03-25 3:57 ` David Aguilar [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=402731c90903242057g47cdcb2an39bbd95ff80584c6@mail.gmail.com \
--to=davvid@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).