From: "Harald Nordgren via GitGitGadget" <gitgitgadget@gmail.com>
To: git@vger.kernel.org
Cc: Harald Nordgren <haraldnordgren@gmail.com>,
Harald Nordgren <haraldnordgren@gmail.com>
Subject: [PATCH] push: add push.showProgress config option
Date: Thu, 23 Apr 2026 12:30:35 +0000 [thread overview]
Message-ID: <pull.2279.git.git.1776947435168.gitgitgadget@gmail.com> (raw)
From: Harald Nordgren <haraldnordgren@gmail.com>
Add a `push.showProgress` boolean config that sets the default for
progress reporting during `git push`. Setting it to `false` suppresses
the pack-objects progress output (Enumerating/Counting/Compressing/
Writing objects) without silencing the ref update summary line the
way `--quiet` does. An explicit `--progress` or `--no-progress` on the
command line still overrides the config.
Signed-off-by: Harald Nordgren <haraldnordgren@gmail.com>
---
push: add showProgress config option
The amount of output shown for each push is excessive in my opinion.
It can be silenced by '-q', but this has the bad side-effect that the
success message is not shown. '--no-progress' exists, so would make
sense to allow this to be always be turned on.
Enumerating objects: 17, done.
Counting objects: 100% (17/17), done.
Delta compression using up to 8 threads
Compressing objects: 100% (9/9), done.
Writing objects: 100% (9/9), 1.32 KiB | 1.32 MiB/s, done.
Total 9 (delta 8), reused 0 (delta 0), pack-reused 0 (from 0)
remote: Resolving deltas: 100% (8/8), completed with 8 local objects.
To github.com:HaraldNordgren/git.git
+ 3b9fc3aac6...6d326b0098 push-use-progress-config -> push-use-progress-config (forced update)
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-2279%2FHaraldNordgren%2Fpush-use-progress-config-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-2279/HaraldNordgren/push-use-progress-config-v1
Pull-Request: https://github.com/git/git/pull/2279
Documentation/config/push.adoc | 8 ++++++++
builtin/push.c | 3 +++
t/t5523-push-upstream.sh | 23 +++++++++++++++++++++++
3 files changed, 34 insertions(+)
diff --git a/Documentation/config/push.adoc b/Documentation/config/push.adoc
index d9112b2260..92f22c8ec3 100644
--- a/Documentation/config/push.adoc
+++ b/Documentation/config/push.adoc
@@ -137,3 +137,11 @@ This will result in only b (a and c are cleared).
If set to `false`, disable use of bitmaps for `git push` even if
`pack.useBitmaps` is `true`, without preventing other git operations
from using bitmaps. Default is `true`.
+
+`push.showProgress`::
+ If set to `false`, suppress progress reporting during `git push`,
+ equivalent to passing `--no-progress` on the command line. If set
+ to `true`, force progress reporting, equivalent to `--progress`.
+ If unset, progress is reported when standard error is connected to
+ a terminal. An explicit `--progress` or `--no-progress` on the
+ command line overrides this configuration.
diff --git a/builtin/push.c b/builtin/push.c
index 7100ffba5d..d35f816740 100644
--- a/builtin/push.c
+++ b/builtin/push.c
@@ -539,6 +539,9 @@ static int git_push_config(const char *k, const char *v,
else
*flags &= ~TRANSPORT_PUSH_FORCE_IF_INCLUDES;
return 0;
+ } else if (!strcmp(k, "push.showprogress")) {
+ progress = git_config_bool(k, v);
+ return 0;
}
return git_default_config(k, v, ctx, NULL);
diff --git a/t/t5523-push-upstream.sh b/t/t5523-push-upstream.sh
index 22d3e1162c..27aa87ee01 100755
--- a/t/t5523-push-upstream.sh
+++ b/t/t5523-push-upstream.sh
@@ -120,6 +120,29 @@ test_expect_success TTY 'push --no-progress suppresses progress' '
test_grep ! "Writing objects" err
'
+test_expect_success TTY 'push.showProgress=false suppresses progress' '
+ ensure_fresh_upstream &&
+
+ test_terminal git -c push.showProgress=false push -u upstream main \
+ >out 2>err &&
+ test_grep ! "Writing objects" err
+'
+
+test_expect_success 'push.showProgress=true forces progress on non-tty' '
+ ensure_fresh_upstream &&
+
+ git -c push.showProgress=true push -u upstream main >out 2>err &&
+ test_grep "Writing objects" err
+'
+
+test_expect_success TTY '--progress overrides push.showProgress=false' '
+ ensure_fresh_upstream &&
+
+ test_terminal git -c push.showProgress=false push -u --progress \
+ upstream main >out 2>err &&
+ test_grep "Writing objects" err
+'
+
test_expect_success TTY 'quiet push' '
ensure_fresh_upstream &&
base-commit: 94f057755b7941b321fd11fec1b2e3ca5313a4e0
--
gitgitgadget
reply other threads:[~2026-04-23 12:30 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=pull.2279.git.git.1776947435168.gitgitgadget@gmail.com \
--to=gitgitgadget@gmail.com \
--cc=git@vger.kernel.org \
--cc=haraldnordgren@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox