git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH] transport: report missing submodule pushes consistently on stderr
@ 2016-08-23 21:40 Stefan Beller
  2016-08-24 10:28 ` Leandro Lucarella
  0 siblings, 1 reply; 4+ messages in thread
From: Stefan Beller @ 2016-08-23 21:40 UTC (permalink / raw)
  To: gitster; +Cc: git, hvoigt, leandro.lucarella, Stefan Beller

The surrounding advice is printed to stderr, but the list of submodules
is not. Make the report consistent by reporting everything to stderr.

Signed-off-by: Stefan Beller <sbeller@google.com>
---

  This fixes one of the bugs mentioned in
  https://public-inbox.org/git/CAGZ79kbkyupBJfvyX3Hj_R5ZW36+3ufOnnLC-Dpic40nPJAxDA@mail.gmail.com/T/#t
  
  How to fix the other was not as obvious to me as I do not understand the
  philosophy on verbosity in the transport code.
  
  Thanks,
  Stefan

 transport.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/transport.c b/transport.c
index cf8de6e..94d6dc3 100644
--- a/transport.c
+++ b/transport.c
@@ -771,7 +771,7 @@ static void die_with_unpushed_submodules(struct string_list *needs_pushing)
 	fprintf(stderr, _("The following submodule paths contain changes that can\n"
 			"not be found on any remote:\n"));
 	for (i = 0; i < needs_pushing->nr; i++)
-		printf("  %s\n", needs_pushing->items[i].string);
+		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"
-- 
2.10.0.rc1.1.g1ceb01a


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] transport: report missing submodule pushes consistently on stderr
  2016-08-23 21:40 [PATCH] transport: report missing submodule pushes consistently on stderr Stefan Beller
@ 2016-08-24 10:28 ` Leandro Lucarella
  2016-08-24 16:35   ` Stefan Beller
  0 siblings, 1 reply; 4+ messages in thread
From: Leandro Lucarella @ 2016-08-24 10:28 UTC (permalink / raw)
  To: Stefan Beller; +Cc: gitster, git, hvoigt

On Tue, 23 Aug 2016 14:40:08 -0700
Stefan Beller <sbeller@google.com> wrote:
> The surrounding advice is printed to stderr, but the list of
> submodules is not. Make the report consistent by reporting everything
> to stderr.
> 
> Signed-off-by: Stefan Beller <sbeller@google.com>
> ---
> 
>   This fixes one of the bugs mentioned in
>   https://public-inbox.org/git/CAGZ79kbkyupBJfvyX3Hj_R5ZW36+3ufOnnLC-Dpic40nPJAxDA@mail.gmail.com/T/#t
>   
>   How to fix the other was not as obvious to me as I do not
> understand the philosophy on verbosity in the transport code.

I had a look and I would say just enclose all the fprintf() inside a:

	if (transport->verbose > 0)

But then this is the first time I look at the code. I was about to send
a patch too but it will conflict with this one :)

Anyway, thanks for the quick fix to the inconsistent printing with
--quiet.


-- 
Leandro Lucarella
Technical Development Lead
Sociomantic Labs GmbH <http://www.sociomantic.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] transport: report missing submodule pushes consistently on stderr
  2016-08-24 10:28 ` Leandro Lucarella
@ 2016-08-24 16:35   ` Stefan Beller
  2016-08-26 22:21     ` Stefan Beller
  0 siblings, 1 reply; 4+ messages in thread
From: Stefan Beller @ 2016-08-24 16:35 UTC (permalink / raw)
  To: Leandro Lucarella; +Cc: Junio C Hamano, git@vger.kernel.org, Heiko Voigt

On Wed, Aug 24, 2016 at 3:28 AM, Leandro Lucarella
<leandro.lucarella@sociomantic.com> wrote:
> On Tue, 23 Aug 2016 14:40:08 -0700
> Stefan Beller <sbeller@google.com> wrote:
>> The surrounding advice is printed to stderr, but the list of
>> submodules is not. Make the report consistent by reporting everything
>> to stderr.
>>
>> Signed-off-by: Stefan Beller <sbeller@google.com>
>> ---
>>
>>   This fixes one of the bugs mentioned in
>>   https://public-inbox.org/git/CAGZ79kbkyupBJfvyX3Hj_R5ZW36+3ufOnnLC-Dpic40nPJAxDA@mail.gmail.com/T/#t
>>
>>   How to fix the other was not as obvious to me as I do not
>> understand the philosophy on verbosity in the transport code.
>
> I had a look and I would say just enclose all the fprintf() inside a:
>
>         if (transport->verbose > 0)
>
> But then this is the first time I look at the code. I was about to send
> a patch too but it will conflict with this one :)

Well you can still send a patch :)

We have

    int verbose = (transport->verbose > 0);
    int quiet = (transport->verbose < 0);

So you're suggesting to only print these warnings when the
user asked for explicit verbose?

A few lines before the call to die_with_unpushed_submodules we have

     die ("Failed to push all needed submodules!");

which would also need a wrapping like

    if (quiet)
        return -1;
    else
        die(...);

Thanks,
Stefan

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] transport: report missing submodule pushes consistently on stderr
  2016-08-24 16:35   ` Stefan Beller
@ 2016-08-26 22:21     ` Stefan Beller
  0 siblings, 0 replies; 4+ messages in thread
From: Stefan Beller @ 2016-08-26 22:21 UTC (permalink / raw)
  To: Leandro Lucarella; +Cc: Junio C Hamano, git@vger.kernel.org, Heiko Voigt

On Wed, Aug 24, 2016 at 9:35 AM, Stefan Beller <sbeller@google.com> wrote:
> On Wed, Aug 24, 2016 at 3:28 AM, Leandro Lucarella
> <leandro.lucarella@sociomantic.com> wrote:
>> On Tue, 23 Aug 2016 14:40:08 -0700
>> Stefan Beller <sbeller@google.com> wrote:
>>> The surrounding advice is printed to stderr, but the list of
>>> submodules is not. Make the report consistent by reporting everything
>>> to stderr.
>>>
>>> Signed-off-by: Stefan Beller <sbeller@google.com>
>>> ---

So we seem to have dropped the ball on the followup; this patch nevertheless
is a good idea?

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-08-26 22:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-23 21:40 [PATCH] transport: report missing submodule pushes consistently on stderr Stefan Beller
2016-08-24 10:28 ` Leandro Lucarella
2016-08-24 16:35   ` Stefan Beller
2016-08-26 22:21     ` Stefan Beller

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).