git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] fetch: only show "Fetching remote" when verbose mode is enabled

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 25, 2015, 18:34 UTC
Message-ID
<xmqqwpuakd9y.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<1445741384-30828-1-git-send-email-pabs3@bonedaddy.net>
Paul Wise <pabs3@bonedaddy.net> writes:

I ignored your patch when you sent it the first time the last week, due to the same issues I had with this round (see below) and forgot about it.

> By default when fetching one remote nothing is printed unless there
> are changes that need fetching. This makes fetching multiple remotes
> be just as verbose as fetching a single remote.

I read this several times over a few days and I still cannot tell what you are trying to say. Let me disect.

> By default when fetching one remote nothing is printed unless there
> are changes that need fetching.

This is the description of the current behaviour, and a correct one at that. We are silent when nothing needs to be done here.

I cannot tell if you are trying to say if that is problematic, or if you are trying to say if it is a good thing.

> This makes fetching multiple remotes
> be just as verbose as fetching a single remote.
I cannot tell what "This" refers to.

Your earlier sentence was about the behaviour of fetching from one remote, e.g. "git fetch this". And this second sentence makes it sound as if that behaviour has some influence on how verbosely "git fetch group" (where 'this' and 'that' are members of 'remotes.group') to fetch from multiple remotes behaves.

Also (and this is the more important part of my complaint), I cannot tell if you are saying that it is *bad* for fetching multiple to be just as verbose, or if it is *good*, or what.

If you are fetching from two places, and only one of them has something new, you would see

    $ git fetch subs
    Fetching paulus
    Fetching l10n
    From git://one.of.the.places.xz/
       aadb70a..74301d6  master     -> this/master
so that you can see how remote.subs group expanded to.
   
> This is needed when fetching multiple repositories using the myrepos
> tool in minimal output mode, where myrepos only prints the repository
> names when git fetch prints some output.

That does not sound like a valid excuse to change the behaviour of the command everybody, not just "myrepos tool" (whatever it is), uses. Your explanation does not seem to give us enough information to answer this question intelligently: shouldn't you be fixing myrepos instead, perhaps by making it run 'git fetch' with more verbose mode, if it wants to see more information, or running 'git fetch' and parsing different parts of its output?

Having said all that, this time I read the change and the change itself feels 40% sensible, even for those who do not care about "myrepos" at all.

I'd sell it like the attached, if I were doing this patch. The last paragraph is where the remaining 60% went ;-)

-- sample --
Subject: fetch: do not show remote group component without change

When fetching from a remote group, "Fetching X" is shown, followed by the URL and ref-update summary, for each component of the remote group. With the default verbosity, the URL and ref-update summary are not shown for repositories without anything new, but "Fetching X" is always shown, which results in an output like this:

    $ git fetch group
    Fetching X
    From git://the.url.for.X.repo/
       aadb70a..74301d6  master     -> X/master
    Fetching Y
    Fetching Z

if the 'remotes.group' is configured to refer to three remotes, X, Y and Z. Given that "git fetch Y" would have produced no output with the same verbosity, having the last two lines look inconsistent.

Tweak the verbosity so that "Fetching X" lines are given only when a verbose output was requested with "git fetch -v".

Note that the current output was deliberately designed like this to give an easy reminder for the user what the components of 'group' are. With this change, we are selfishly and unilaterally breaking a feature that was designed to help them, but if they strongly care, they can complain and revert this change.

-- end sample --
Previous: Paul WiseNext: Paul Wise
Message 2 of 4 in “fetch: only show "Fetching remote" when verbose mode is enabled”
  1. fetch: only show "Fetching remote" when verbose mode is enabledPaul Wise, Oct 25, 2015
  2. Junio C HamanoOct 25, 2015
  3. Paul WiseOct 26, 2015
  4. Junio C HamanoOct 26, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.