git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Michael J Gruber <git@drmicha.warpmail.net>
Cc: git@vger.kernel.org
Subject: Re: [RFC] add test cases for the --repo option to git push
Date: Wed, 25 Feb 2009 13:58:17 -0800	[thread overview]
Message-ID: <7vhc2iyy9y.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <1235497240-20677-1-git-send-email-git@drmicha.warpmail.net> (Michael J. Gruber's message of "Tue, 24 Feb 2009 18:40:40 +0100")

Michael J Gruber <git@drmicha.warpmail.net> writes:

> @@ -419,6 +419,41 @@ test_expect_success 'push with config remote.*.push = HEAD' '
>  git config --remove-section remote.there
>  git config --remove-section branch.master
>  
> +test_expect_success 'push with --repo=repourl from non-tracking branch' '
> +
> +	mk_test heads/master &&
> +	git push --repo=testrepo &&
> +	check_push_result $the_commit heads/master
> +'
> +
> +# set up fake remote config
> +test_expect_success 'push with --repo=remoterepo from non-tracking branch' '
> +
> +	mk_test heads/master &&
> +	git config remote.testremote.url testrepo &&
> +	git push --repo=testremote &&
> +	check_push_result $the_commit heads/master
> +'
> +
> +# set up fake tracking info; testrepo exists, origin does not.
> +test_expect_failure 'push with --repo=repo from tracking branch with bad config' '
> +
> +	mk_test heads/master &&
> +	git config branch.master.remote origin &&
> +	test_must_fail git push --repo=testrepo
> +'

At this point, you have:

	branch.master.remote = origin
        remote.testremote.url = testrepo

and nothing else related to push.  And you are asking a "git push but
instead of origin please default to testrepo".

In response to that request, in order to figure out what refs to push by
default, remote.testremote.push instead of remote.origin.push will be
consulted, and we won't even have to notice nor complain the missing
remote.origin.  remote.testremote.push is missing, so the push defaults to
the "matching ref" behaviour.

I do not understand why you expect the above to fail.

> +test_expect_failure 'push with --repo=repo from tracking branch with good config' '
> +
> +	mk_test heads/master &&
> +	git config branch.master.remote testrepo &&
> +	git push --repo=origin &&
> +	check_push_result $the_commit heads/master
> +'

Likewise.

I think the "good/bad config" labels given to your two test scripts are
swapped and there is no bug or misfeature here.

  reply	other threads:[~2009-02-25 21:59 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-20  9:16 git push usage Jay Soffian
2009-02-21  9:32 ` Jay Soffian
2009-02-24 17:40   ` [RFC] add test cases for the --repo option to git push Michael J Gruber
2009-02-25 21:58     ` Junio C Hamano [this message]
2009-02-26  9:26       ` Michael J Gruber
2009-02-26 17:09         ` Junio C Hamano
2009-02-26 17:48           ` Michael J Gruber
2009-02-26 22:11             ` Jay Soffian
2009-02-27 10:42           ` Michael J Gruber
2009-02-27 17:34             ` Junio C Hamano
2009-02-27 20:48             ` Jay Soffian
2009-02-27 21:00               ` Linus Torvalds
2009-02-27 21:21                 ` Jay Soffian

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=7vhc2iyy9y.fsf@gitster.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@drmicha.warpmail.net \
    --cc=git@vger.kernel.org \
    /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).