threads / patch / 12496

patchgit-submodule: Make update verbose for up to date path

Subject: [PATCH] git-submodule: Make update verbose for up to date path

## tl;dr

5 messages between Mar 4, 2008 and Mar 4, 2008. Diffs are folded; open one to read it.

replies: 4people: 3as markdown or json

Ping Yin· Mar 4, 2008, 14:58 UTC · lore
When 'git submodule update' runs for multiple modules, give 'up to date'
info for up to date modules should be a good idea to show the progress.
---
 git-submodule.sh |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
Show changes to git-submodule.sh +2 −0
diff --git a/git-submodule.sh b/git-submodule.sh
index 67d3224..94e3db7 100755
--- a/git-submodule.sh
+++ b/git-submodule.sh
@@ -305,6 +305,8 @@ cmd_update()
 			die "Unable to checkout '$sha1' in submodule path '$path'"
 
 			say "Submodule path '$path': checked out '$sha1'"
+		else
+			say "Up to date: $path"
 		fi
 	done
 }
-- 
1.5.4.3.347.g5314c
Johannes Schindelin· Mar 4, 2008, 15:04 UTC · re: Ping Yin · lore

Re: [PATCH] git-submodule: Make update verbose for up to date path

Hi,
On Tue, 4 Mar 2008, Ping Yin wrote:
> When 'git submodule update' runs for multiple modules, give 'up to date'
> info for up to date modules should be a good idea to show the progress.

Does this not go contrary to our efforts to make Git less chatty? See e.g. the output of push and fetch...

Ciao, Dscho

Ping Yin· Mar 4, 2008, 16:03 UTC · re: Johannes Schindelin · lore

Re: [PATCH] git-submodule: Make update verbose for up to date path

On Tue, Mar 4, 2008 at 11:04 PM, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:

Show 11 quoted lines
> Hi,
>
>
>  On Tue, 4 Mar 2008, Ping Yin wrote:
>
>  > When 'git submodule update' runs for multiple modules, give 'up to date'
>  > info for up to date modules should be a good idea to show the progress.
>
>  Does this not go contrary to our efforts to make Git less chatty?  See
>  e.g. the output of push and fetch...
>

When i run 'git submodule update' in a repository whose submodules are all clean, there is not any output which makes me not know whether this command are successful. I think this is not friendly.

>  Ciao,
>  Dscho
>
-- 
Ping Yin
Johannes Schindelin· Mar 4, 2008, 16:08 UTC · re: Ping Yin · lore

Re: [PATCH] git-submodule: Make update verbose for up to date path

Hi,
On Wed, 5 Mar 2008, Ping Yin wrote:
> When i run 'git submodule update' in a repository whose submodules are 
> all clean, there is not any output which makes me not know whether this 
> command are successful. I think this is not friendly.

The problem is: people ignore output. Back when merge-recursive was even more chatty than it is now, they happily glanced over the fact that there were _conflicts_.

So we reduced the output.  Drastically.

For example, git reset --hard (amongst others) does not output a _thing_ if it succeeds. This is good. No output means it succeeded.

Now, some other commands take a while to complete, so we have a progress which kicks in after a second or so. Still, this is just to keep the user busy when she would otherwise think that Git hangs.

So no, I do not like submodule becoming chattier. You can add --verbose if you want, but the default should be _quiet_.

Ciao, Dscho

Junio C Hamano· Mar 4, 2008, 20:31 UTC · re: Ping Yin · lore

Re: [PATCH] git-submodule: Make update verbose for up to date path

"Ping Yin" <pkufranky@gmail.com> writes:
> When i run 'git submodule update' in a repository whose submodules are
> all clean, there is not any output which makes me not know whether
> this command are successful. I think this is not friendly.

Not at all. If you are unsuccessful and did not issue an error message, you have a bug to fix.

When a command finishes successfully doing what it was asked to do, especially when it does a lot of things and has potential to issue useful error messages and warnings to some but not all of them, it should stay quiet for successful ones unless there is a very good reason not to. The reasons may include "the user told it to be chatty with --verbose", "it may make the user think it hang, because it takes a long time", and perhaps "it is a rare thing to run and the user may not be familiar with how it acts".

← back to recent threads