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

[PATCH] Make commit, cherry-pick and revert more silent.

From
GGabriel <g2p.code@gmail.com>
Date
Jan 6, 2008, 15:43 UTC
Message-ID
<1199634201-26013-1-git-send-email-g2p.code@gmail.com>
Commit now obeys --quiet more.
Cherry-pick and revert call commit as --quiet.
Prevents us from displaying working-tree status once or even twice.
---
 builtin-commit.c |    4 +++-
 builtin-revert.c |    6 ++++--
 2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/builtin-commit.c b/builtin-commit.c
index 73f1e35..96ace77 100644
--- a/builtin-commit.c
+++ b/builtin-commit.c
@@ -759,7 +759,9 @@ int cmd_commit(int argc, const char **argv, const char *prefix)
 
 	if (!prepare_log_message(index_file, prefix) && !in_merge &&
 	    !allow_empty && !(amend && is_a_merge(head_sha1))) {
-		run_status(stdout, index_file, prefix, 0);
+		fprintf(stderr, "There are no changes, not committing.\n");
+		if (!quiet)
+			run_status(stdout, index_file, prefix, 0);
 		rollback_index_files();
 		unlink(commit_editmsg);
 		return 1;
diff --git a/builtin-revert.c b/builtin-revert.c
index 4bf8eb2..b925358 100644
--- a/builtin-revert.c
+++ b/builtin-revert.c
@@ -392,9 +392,11 @@ static int revert_or_cherry_pick(int argc, const char **argv)
 
 	if (!no_commit) {
 		if (edit)
-			return execl_git_cmd("commit", "-n", NULL);
+			return execl_git_cmd("commit", "--quiet",
+				"-n", NULL);
 		else
-			return execl_git_cmd("commit", "-n", "-F", defmsg, NULL);
+			return execl_git_cmd("commit", "--quiet",
+				"-n", "-F", defmsg, NULL);
 	}
 	if (reencoded_message)
 		free(reencoded_message);
-- 
1.5.4.rc2.39.g00d2
Next: Junio C Hamano
Message 1 of 3 in “Make commit, cherry-pick and revert more silent.”
  1. Make commit, cherry-pick and revert more silent.Gabriel, Jan 6, 2008
  2. Junio C HamanoJan 6, 2008
  3. GabrielJan 7, 2008

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.