All of lore.kernel.org
 help / color / mirror / Atom feed
* git push --quiet option does not seem to work
@ 2016-05-13 21:21 Chris B
  2016-05-13 22:33 ` Jeff King
  0 siblings, 1 reply; 14+ messages in thread
From: Chris B @ 2016-05-13 21:21 UTC (permalink / raw)
  To: git

Hi I am using 2.8.2.windows.1 and writing Powershell scripts doing
some Git stuff.

I have to use the --quiet option for git because it constantly outputs
progress to stderr.

However, it seems that --quiet does not actually work in git push. The
output still goes to stderr.
When there are changes committed to push it always outputs something
to stderr. If there is nothing to push, then it actually is silent.

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

* Re: git push --quiet option does not seem to work
  2016-05-13 21:21 git push --quiet option does not seem to work Chris B
@ 2016-05-13 22:33 ` Jeff King
  2016-05-15 20:29   ` Chris B
  0 siblings, 1 reply; 14+ messages in thread
From: Jeff King @ 2016-05-13 22:33 UTC (permalink / raw)
  To: Chris B; +Cc: git

On Fri, May 13, 2016 at 05:21:30PM -0400, Chris B wrote:

> Hi I am using 2.8.2.windows.1 and writing Powershell scripts doing
> some Git stuff.
> 
> I have to use the --quiet option for git because it constantly outputs
> progress to stderr.
> 
> However, it seems that --quiet does not actually work in git push. The
> output still goes to stderr.
> When there are changes committed to push it always outputs something
> to stderr. If there is nothing to push, then it actually is silent.

Can you be more specific? It seems to work for me:

  $ rm -rf dst.git &&
    git init --bare -q dst.git &&
    git push dst.git
  Counting objects: 6, done.
  Delta compression using up to 8 threads.
  Compressing objects: 100% (3/3), done.
  Writing objects: 100% (6/6), 441 bytes | 0 bytes/s, done.
  Total 6 (delta 0), reused 0 (delta 0)
  To dst.git
   * [new branch]      master -> master

  $ rm -rf dst.git &&
    git init --bare -q dst.git &&
    git push -q dst.git
  [no output]

Are you seeing progress reporting, the status table, or something else?
Are you using a particular protocol that might invoke a git-remote-*
helper that doesn't respect the quiet flag?

-Peff

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

* Re: git push --quiet option does not seem to work
  2016-05-13 22:33 ` Jeff King
@ 2016-05-15 20:29   ` Chris B
  2016-05-15 20:34     ` Chris B
  2016-05-15 21:23     ` Jeff King
  0 siblings, 2 replies; 14+ messages in thread
From: Chris B @ 2016-05-15 20:29 UTC (permalink / raw)
  To: Jeff King; +Cc: git

Try it by making some changes to files and committing them, and then push.
It works fine for me when there is nothing to actually push, but not
so when there are commits to push.

It always outputs the progress to STDERR even when I add --quiet.



On Fri, May 13, 2016 at 6:33 PM, Jeff King <peff@peff.net> wrote:
> On Fri, May 13, 2016 at 05:21:30PM -0400, Chris B wrote:
>
>> Hi I am using 2.8.2.windows.1 and writing Powershell scripts doing
>> some Git stuff.
>>
>> I have to use the --quiet option for git because it constantly outputs
>> progress to stderr.
>>
>> However, it seems that --quiet does not actually work in git push. The
>> output still goes to stderr.
>> When there are changes committed to push it always outputs something
>> to stderr. If there is nothing to push, then it actually is silent.
>
> Can you be more specific? It seems to work for me:
>
>   $ rm -rf dst.git &&
>     git init --bare -q dst.git &&
>     git push dst.git
>   Counting objects: 6, done.
>   Delta compression using up to 8 threads.
>   Compressing objects: 100% (3/3), done.
>   Writing objects: 100% (6/6), 441 bytes | 0 bytes/s, done.
>   Total 6 (delta 0), reused 0 (delta 0)
>   To dst.git
>    * [new branch]      master -> master
>
>   $ rm -rf dst.git &&
>     git init --bare -q dst.git &&
>     git push -q dst.git
>   [no output]
>
> Are you seeing progress reporting, the status table, or something else?
> Are you using a particular protocol that might invoke a git-remote-*
> helper that doesn't respect the quiet flag?
>
> -Peff

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

* Re: git push --quiet option does not seem to work
  2016-05-15 20:29   ` Chris B
@ 2016-05-15 20:34     ` Chris B
  2016-05-15 21:23     ` Jeff King
  1 sibling, 0 replies; 14+ messages in thread
From: Chris B @ 2016-05-15 20:34 UTC (permalink / raw)
  To: Jeff King; +Cc: git

By the way, I also notice by your prompt you seem to be testing this
in Linux. I did indicate I'm using the Windows version. That might
make a difference.


On Sun, May 15, 2016 at 4:29 PM, Chris B <chris.blaszczynski@gmail.com> wrote:
> Try it by making some changes to files and committing them, and then push.
> It works fine for me when there is nothing to actually push, but not
> so when there are commits to push.
>
> It always outputs the progress to STDERR even when I add --quiet.
>
>
>
> On Fri, May 13, 2016 at 6:33 PM, Jeff King <peff@peff.net> wrote:
>> On Fri, May 13, 2016 at 05:21:30PM -0400, Chris B wrote:
>>
>>> Hi I am using 2.8.2.windows.1 and writing Powershell scripts doing
>>> some Git stuff.
>>>
>>> I have to use the --quiet option for git because it constantly outputs
>>> progress to stderr.
>>>
>>> However, it seems that --quiet does not actually work in git push. The
>>> output still goes to stderr.
>>> When there are changes committed to push it always outputs something
>>> to stderr. If there is nothing to push, then it actually is silent.
>>
>> Can you be more specific? It seems to work for me:
>>
>>   $ rm -rf dst.git &&
>>     git init --bare -q dst.git &&
>>     git push dst.git
>>   Counting objects: 6, done.
>>   Delta compression using up to 8 threads.
>>   Compressing objects: 100% (3/3), done.
>>   Writing objects: 100% (6/6), 441 bytes | 0 bytes/s, done.
>>   Total 6 (delta 0), reused 0 (delta 0)
>>   To dst.git
>>    * [new branch]      master -> master
>>
>>   $ rm -rf dst.git &&
>>     git init --bare -q dst.git &&
>>     git push -q dst.git
>>   [no output]
>>
>> Are you seeing progress reporting, the status table, or something else?
>> Are you using a particular protocol that might invoke a git-remote-*
>> helper that doesn't respect the quiet flag?
>>
>> -Peff

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

* Re: git push --quiet option does not seem to work
  2016-05-15 20:29   ` Chris B
  2016-05-15 20:34     ` Chris B
@ 2016-05-15 21:23     ` Jeff King
  2016-05-16  0:51       ` Chris B
  1 sibling, 1 reply; 14+ messages in thread
From: Jeff King @ 2016-05-15 21:23 UTC (permalink / raw)
  To: Chris B; +Cc: git

On Sun, May 15, 2016 at 04:29:36PM -0400, Chris B wrote:

> Try it by making some changes to files and committing them, and then push.
> It works fine for me when there is nothing to actually push, but not
> so when there are commits to push.

In my example there were commits to push.

As you noted, my test was on Linux, so it's certainly possible that it's
Windows-specific. What protocol are you pushing over (e.g., http follows
a very different code path for progress)?

-Peff

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

* Re: git push --quiet option does not seem to work
  2016-05-15 21:23     ` Jeff King
@ 2016-05-16  0:51       ` Chris B
  2016-05-16  0:58         ` Jeff King
  0 siblings, 1 reply; 14+ messages in thread
From: Chris B @ 2016-05-16  0:51 UTC (permalink / raw)
  To: Jeff King; +Cc: git

I did not see in your example any commit. But if you say so.
I saw git init which would be a new repo.. don't know if it makes a difference.

It's pushing to HTTPS.

I can provide the real example tomorrow.

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

* Re: git push --quiet option does not seem to work
  2016-05-16  0:51       ` Chris B
@ 2016-05-16  0:58         ` Jeff King
  2016-05-16 13:13           ` Chris B
  0 siblings, 1 reply; 14+ messages in thread
From: Jeff King @ 2016-05-16  0:58 UTC (permalink / raw)
  To: Chris B; +Cc: git

On Sun, May 15, 2016 at 08:51:53PM -0400, Chris B wrote:

> I did not see in your example any commit. But if you say so.

I didn't show the commit step. But you can see that I made two identical
pushes, one quiet and one not, and the non-quiet one actually pushed
commits and showed the progress meter.

That doesn't help with your problem, though...

> I saw git init which would be a new repo.. don't know if it makes a difference.
> 
> It's pushing to HTTPS.

I repeated my test pushing over https, but it still seems to work as
expected with "-q".  So perhaps it is just Windows-specific, or perhaps
there's something else going on.

-Peff

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

* Re: git push --quiet option does not seem to work
  2016-05-16  0:58         ` Jeff King
@ 2016-05-16 13:13           ` Chris B
  2016-05-16 13:28             ` Johannes Schindelin
  0 siblings, 1 reply; 14+ messages in thread
From: Chris B @ 2016-05-16 13:13 UTC (permalink / raw)
  To: Jeff King; +Cc: git

PS H:\test-ps\myrepo> "hi" >> whatever

PS H:\test-ps\myrepo> git add .

PS H:\test-ps\myrepo> git commit -m 'boo'
[test1 3cde450] boo
 Committer: xxxxxxxxxxxxxxxx
Your name and email address were configured automatically based
on your username and hostname. Please check that they are accurate.
You can suppress this message by setting them explicitly. Run the
following command and follow the instructions in your editor to edit
your configuration file:

    git config --global --edit

After doing this, you may fix the identity used for this commit with:

    git commit --amend --reset-author

 1 file changed, 0 insertions(+), 0 deletions(-)

PS H:\test-ps\myrepo> git push --quiet
git : remote:
At line:1 char:1
+ git push --quiet
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (remote: :String) [],
RemoteException
    + FullyQualifiedErrorId : NativeCommandError

remote: Analyzing objects... (3/3) (119 ms)
remote: Storing packfile... done (113 ms)
remote: Storing index... done (29 ms)

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

* Re: git push --quiet option does not seem to work
  2016-05-16 13:13           ` Chris B
@ 2016-05-16 13:28             ` Johannes Schindelin
  2016-05-16 13:37               ` Jeff King
  0 siblings, 1 reply; 14+ messages in thread
From: Johannes Schindelin @ 2016-05-16 13:28 UTC (permalink / raw)
  To: Chris B; +Cc: Jeff King, git

Hi Chris,

could you please quote just the parts of the mail you are replying to, and
*not* top-post? It would be appreciated.

On Mon, 16 May 2016, Chris B wrote:

> PS H:\test-ps\myrepo> git push --quiet
> git : remote:
> At line:1 char:1
> + git push --quiet
> + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>     + CategoryInfo          : NotSpecified: (remote: :String) [],
> RemoteException
>     + FullyQualifiedErrorId : NativeCommandError
> 
> remote: Analyzing objects... (3/3) (119 ms)
> remote: Storing packfile... done (113 ms)
> remote: Storing index... done (29 ms)

So it actually works, eh?

Could you please verify that this is a PowerShell-only problem by
performing a similar push in Git CMD and in Git Bash?

Ciao,
Johannes

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

* Re: git push --quiet option does not seem to work
  2016-05-16 13:28             ` Johannes Schindelin
@ 2016-05-16 13:37               ` Jeff King
  2016-05-16 14:32                 ` Chris B
  0 siblings, 1 reply; 14+ messages in thread
From: Jeff King @ 2016-05-16 13:37 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: Chris B, git

On Mon, May 16, 2016 at 03:28:30PM +0200, Johannes Schindelin wrote:

> > PS H:\test-ps\myrepo> git push --quiet
> > git : remote:
> > At line:1 char:1
> > + git push --quiet
> > + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> >     + CategoryInfo          : NotSpecified: (remote: :String) [],
> > RemoteException
> >     + FullyQualifiedErrorId : NativeCommandError
> > 
> > remote: Analyzing objects... (3/3) (119 ms)
> > remote: Storing packfile... done (113 ms)
> > remote: Storing index... done (29 ms)
> 
> So it actually works, eh?
> 
> Could you please verify that this is a PowerShell-only problem by
> performing a similar push in Git CMD and in Git Bash?

I don't know much about PowerShell, but presumably it is responsible for
the first few lines.

But there is something else going on, too, which is those "remote:"
lines. Those are being relayed from the server by the git client. I
don't think it would be correct for the client to suppress them, even
with "--quiet", because the client side has no idea if they are progress
junk or critical error messages.

The client _does_ pass along the "quiet" flag to the server via the git
protocol, so it should be the server's responsibility to drop progress
output when it is present. The server side here is clearly not stock
git, from the content of those progress messages (some googling shows it
looks like whatever visualstudio.com is running, but I don't know what
that is). So either the server implementation doesn't support the
"quiet" protocol extension, or it is ignoring it. It might be worth
filing a bug with them.

-Peff

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

* Re: git push --quiet option does not seem to work
  2016-05-16 13:37               ` Jeff King
@ 2016-05-16 14:32                 ` Chris B
  2016-05-16 15:04                   ` Johannes Schindelin
  0 siblings, 1 reply; 14+ messages in thread
From: Chris B @ 2016-05-16 14:32 UTC (permalink / raw)
  To: Jeff King; +Cc: Johannes Schindelin, git

Once I included the whole email in my reply, but otherwise I deleted it all.

Anyway, it is not a Powershell thing. I tested on another repo on
GitHub and it worked as expected. So I guess indeed the problem lies
with Microsoft's implementation.

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

* Re: git push --quiet option does not seem to work
  2016-05-16 14:32                 ` Chris B
@ 2016-05-16 15:04                   ` Johannes Schindelin
  2016-05-16 15:17                     ` Jeff King
  0 siblings, 1 reply; 14+ messages in thread
From: Johannes Schindelin @ 2016-05-16 15:04 UTC (permalink / raw)
  To: Chris B; +Cc: Jeff King, git

Hi Chris,

On Mon, 16 May 2016, Chris B wrote:

> Once I included the whole email in my reply, but otherwise I deleted it
> all.

Both are bad practice. If you are considerate with the reader's time, this
consideration is typically reprocicated. So it is a good idea to save the
reader time by giving them the precise context they need.

> Anyway, it is not a Powershell thing. I tested on another repo on
> GitHub and it worked as expected. So I guess indeed the problem lies
> with Microsoft's implementation.

This is *really* unclear.

What "Microsoft's implementation"??? Do you refer to VSTS, or do you refer
to Git for Windows, or PowerShell?

Please. To make it really simple for everybody involved, try to repeat as
closely as possible the same push from PowerShell, Git CMD and Git Bash.
We want to compare oranges to oranges.

FWIW You can repeat the same push by force-pushing the previous state
between re-runs. E.g.

	git push myremote HEAD^:my-branch
	git push myremote my-branch

Ciao,
Johannes

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

* Re: git push --quiet option does not seem to work
  2016-05-16 15:04                   ` Johannes Schindelin
@ 2016-05-16 15:17                     ` Jeff King
  2016-05-17  0:06                       ` Chris B
  0 siblings, 1 reply; 14+ messages in thread
From: Jeff King @ 2016-05-16 15:17 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: Chris B, git

On Mon, May 16, 2016 at 05:04:34PM +0200, Johannes Schindelin wrote:

> > Anyway, it is not a Powershell thing. I tested on another repo on
> > GitHub and it worked as expected. So I guess indeed the problem lies
> > with Microsoft's implementation.
> 
> This is *really* unclear.
> 
> What "Microsoft's implementation"??? Do you refer to VSTS, or do you refer
> to Git for Windows, or PowerShell?
> 
> Please. To make it really simple for everybody involved, try to repeat as
> closely as possible the same push from PowerShell, Git CMD and Git Bash.
> We want to compare oranges to oranges.

I don't think there is much to debug there. According to

  http://superuser.com/questions/213848/using-powershell-call-native-command-line-app-and-capture-stderr/462362#462362

and other sources, it looks like PowerShell is very picky about calling
programs which produce any output on stderr, and may in an error object.
So I think both Powershell and Git are working as advertised, it's just
that their behaviors are incompatible.

The "bug" is that the server is asking the client to write non-error
output to stderr, even though the client should have asked the server to
be quiet (though it would not hurt to check that it is doing so by
looking at the output of GIT_TRACE_PACKET).

-Peff

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

* Re: git push --quiet option does not seem to work
  2016-05-16 15:17                     ` Jeff King
@ 2016-05-17  0:06                       ` Chris B
  0 siblings, 0 replies; 14+ messages in thread
From: Chris B @ 2016-05-17  0:06 UTC (permalink / raw)
  To: Jeff King; +Cc: Johannes Schindelin, git

>> Once I included the whole email in my reply, but otherwise I deleted it
>> all.

> Both are bad practice. If you are considerate with the reader's time, this
> consideration is typically reprocicated. So it is a good idea to save the
> reader time by giving them the precise context they need.

This is among a few reasons I don't understand why in 2016 we use mail
lists for this kind of stuff. First time I've had to deal with this
since the 1990's so I forgot how it works.

On Mon, May 16, 2016 at 11:17 AM, Jeff King <peff@peff.net> wrote:
> On Mon, May 16, 2016 at 05:04:34PM +0200, Johannes Schindelin wrote:
>
>> > Anyway, it is not a Powershell thing. I tested on another repo on
>> > GitHub and it worked as expected. So I guess indeed the problem lies
>> > with Microsoft's implementation.
>>
>> This is *really* unclear.
>>
>> What "Microsoft's implementation"??? Do you refer to VSTS, or do you refer
>> to Git for Windows, or PowerShell?
>>
>> Please. To make it really simple for everybody involved, try to repeat as
>> closely as possible the same push from PowerShell, Git CMD and Git Bash.
>> We want to compare oranges to oranges.

As I was mentioning GitHub I assumed "Microsoft implementation" would
indicate their hosted Git service "Visual Studio Team Services".

I really didn't think there was anything else to provide. The feedback
lead me to test with Github and with that I verified that when the
remote was for Github it worked, but when the remote was VSTS it was
not.. and "not working" means not paying attention to "--quiet"
setting only with git push, while it does work for other commands such
as clone. (though I think I have to re-test with pull.)

The problem is not with Powershell (though how it handles seeing
output in STDERR is not anything I agree with). I was merely trying to
point out that 'git push --quiet' was not working until we realized it
was with VSTS.

This "ticket" if it exists as such in a maillist can be closed.

I think this accurately sums it up:

> The "bug" is that the server is asking the client to write non-error
> output to stderr, even though the client should have asked the server to
> be quiet (though it would not hurt to check that it is doing so by
> looking at the output of GIT_TRACE_PACKET).
>
> -Peff

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

end of thread, other threads:[~2016-05-17  0:06 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-13 21:21 git push --quiet option does not seem to work Chris B
2016-05-13 22:33 ` Jeff King
2016-05-15 20:29   ` Chris B
2016-05-15 20:34     ` Chris B
2016-05-15 21:23     ` Jeff King
2016-05-16  0:51       ` Chris B
2016-05-16  0:58         ` Jeff King
2016-05-16 13:13           ` Chris B
2016-05-16 13:28             ` Johannes Schindelin
2016-05-16 13:37               ` Jeff King
2016-05-16 14:32                 ` Chris B
2016-05-16 15:04                   ` Johannes Schindelin
2016-05-16 15:17                     ` Jeff King
2016-05-17  0:06                       ` Chris B

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.