All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Stefan Beller <sbeller@google.com>
Cc: git@vger.kernel.org, hvoigt@hvoigt.net, dborowitz@google.com
Subject: Re: [PATCH] transport submodules: correct error message
Date: Tue, 17 Jan 2017 15:42:59 -0800	[thread overview]
Message-ID: <xmqq8tq9ckxo.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <20170113235427.5768-1-sbeller@google.com> (Stefan Beller's message of "Fri, 13 Jan 2017 15:54:27 -0800")

Stefan Beller <sbeller@google.com> writes:

> Trying to push with --recurse-submodules=on-demand would run into
> the same problem. To fix this issue
>     1) specifically mention that we looked for branches on the remote.

That makes an incorrect statement ("not found on any remote"---we
did not inspect all of the said remote, only heads and tags) into an
irrelevant statement ("not found on any remote branch"---the end
user would say "so what?  I know it exists there, it's just that not
all remote refs have corresponding tracking ref locally on our side").

Perhaps it may be an improvement.

>     2) advertise pushing without recursing into submodules. ("Use this
>        command to make the error message go away")

Not mentioning "on-demand" may be an improvement for those who do
use set-up like Dave has, where remote tracking information is
incomplete if you only look at heads and refs, in the sense that we
no longer suggest ineffective workaround.  

But would it be an improvement to suggest --no-recurse-submodules?

This issue seems like a property of the particular set-up, as
opposed to being a one-off issue.  The next, subsequent and probably
all future pushes from that repository will have the same issue
because the root cause is not due to the relative position of
commits we have locally vs the tips of remote, but due to the way
remote tracking is set-up, no?

If that is the case, perhaps configuring push.recurseSubmodules to
turn this off (especially because you plan to turn the defaul to
"check") and not giving the command line option would give a more
pleasant end-user experience, I suspect.


>
> While at it, remove some empty lines, as they blow up the error message.
>
> Reported-by: Dave Borowitz <dborowitz@google.com>
> Signed-off-by: Stefan Beller <sbeller@google.com>
> ---
>  transport.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/transport.c b/transport.c
> index 3e8799a611..2445bf0dca 100644
> --- a/transport.c
> +++ b/transport.c
> @@ -883,14 +883,14 @@ static void die_with_unpushed_submodules(struct string_list *needs_pushing)
>  	int i;
>  
>  	fprintf(stderr, _("The following submodule paths contain changes that can\n"
> -			"not be found on any remote:\n"));
> +			"not be found on any remote branch:\n"));
>  	for (i = 0; i < needs_pushing->nr; i++)
>  		fprintf(stderr, "  %s\n", needs_pushing->items[i].string);
> -	fprintf(stderr, _("\nPlease try\n\n"
> -			  "	git push --recurse-submodules=on-demand\n\n"
> -			  "or cd to the path and use\n\n"
> -			  "	git push\n\n"
> -			  "to push them to a remote.\n\n"));
> +	fprintf(stderr, _("\nSuppress submodule checks via\n"
> +			  "	git push --no-recurse-submodules\n"
> +			  "or cd to the path and use\n"
> +			  "	git push\n"
> +			  "to push them to a remote.\n"));
>  
>  	string_list_clear(needs_pushing, 0);

  reply	other threads:[~2017-01-17 23:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-13 23:54 [PATCH] transport submodules: correct error message Stefan Beller
2017-01-17 23:42 ` Junio C Hamano [this message]
2017-01-18  0:08   ` Stefan Beller
2017-01-18  0:15     ` Junio C Hamano
2017-01-18  0:21       ` Stefan Beller

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=xmqq8tq9ckxo.fsf@gitster.mtv.corp.google.com \
    --to=gitster@pobox.com \
    --cc=dborowitz@google.com \
    --cc=git@vger.kernel.org \
    --cc=hvoigt@hvoigt.net \
    --cc=sbeller@google.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.