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

[PATCH 4/5] apply: pass through quiet flag to fix t4150

From
PGPhilip Peterson via GitGitGadget <gitgitgadget@gmail.com>
Date
Feb 18, 2024, 07:33 UTC
Message-ID
<c0d670df198eabc20bf89854184db7a100cb3030.1708241613.git.gitgitgadget@gmail.com>
In-Reply-To
<pull.1666.git.git.1708241612.gitgitgadget@gmail.com>
From: Philip Peterson <philip.c.peterson@gmail.com>

This test was failing because it expects the invocation of `git apply` to be silent. Because previous patches introduce verbosity where previously there was a silent error (in the form of a return code), this adds an opportunity for a bug to become visible. The bug is in the way `git am` invokes `git apply`, not passing through --quiet when it is specified.

Signed-off-by: Philip Peterson <philip.c.peterson@gmail.com>
---
 builtin/am.c | 5 +++++
 1 file changed, 5 insertions(+)
diff --git a/builtin/am.c b/builtin/am.c
index d1990d7edcb..799cb8128a3 100644
--- a/builtin/am.c
+++ b/builtin/am.c
@@ -36,6 +36,7 @@
 #include "mailinfo.h"
 #include "apply.h"
 #include "string-list.h"
+#include "packfile.h"
 #include "pager.h"
 #include "path.h"
 #include "repository.h"
@@ -2412,6 +2413,10 @@ int cmd_am(int argc, const char **argv, const char *prefix)
 
 	argc = parse_options(argc, argv, prefix, options, usage, 0);
 
+	if (state.quiet) {
+		strvec_push(&state.git_apply_opts, "--quiet");
+	}
+
 	if (binary >= 0)
 		fprintf_ln(stderr, _("The -b/--binary option has been a no-op for long time, and\n"
 				"it will be removed. Please do not use it anymore."));
-- 
gitgitgadget
Previous: Philip Peterson via GitGitGadgetNext: Philip Peterson via GitGitGadget
Message 5 of 13 in “promise: introduce promises to track success or error”
  1. 0/5 promise: introduce promises to track success or errorPhilip Peterson via GitGitGadget, Feb 18, 2024
  2. 1/5 promise: add promise pattern to track success/error from operationsPhilip Peterson via GitGitGadget, Feb 18, 2024
  3. 3/5 apply: update t4012 test suitePhilip Peterson via GitGitGadget, Feb 18, 2024
  4. 2/5 apply: use new promise structures in git-apply logic as a proving groundPhilip Peterson via GitGitGadget, Feb 18, 2024
  5. 4/5 apply: pass through quiet flag to fix t4150Philip Peterson via GitGitGadget, Feb 18, 2024
  6. 5/5 am: update test t4254 by adding the new error textPhilip Peterson via GitGitGadget, Feb 18, 2024
  7. Phillip WoodFeb 19, 2024
  8. Jeff KingFeb 20, 2024
  9. Phillip WoodFeb 20, 2024
  10. Patrick SteinhardtFeb 20, 2024
  11. Junio C HamanoFeb 20, 2024
  12. Jeff KingFeb 21, 2024
  13. PhilipMar 12, 2024

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.