git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nate Case <ncase@xes-inc.com>
To: git@vger.kernel.org, gitster@pobox.com
Cc: Nate Case <ncase@xes-inc.com>
Subject: [PATCH] format-patch: Respect --quiet option
Date: Wed, 18 Mar 2009 12:00:45 -0500	[thread overview]
Message-ID: <1237395645-22085-1-git-send-email-ncase@xes-inc.com> (raw)

Hide the patch filename output from 'git format-patch' when --quiet
is used.  The man pages suggested that this should have already worked.

Signed-off-by: Nate Case <ncase@xes-inc.com>
---
 builtin-log.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/builtin-log.c b/builtin-log.c
index 8684fcd..8af55d2 100644
--- a/builtin-log.c
+++ b/builtin-log.c
@@ -573,7 +573,7 @@ static FILE *realstdout = NULL;
 static const char *output_directory = NULL;
 static int outdir_offset;
 
-static int reopen_stdout(const char *oneline, int nr, int total)
+static int reopen_stdout(const char *oneline, int nr, struct rev_info *rev)
 {
 	char filename[PATH_MAX];
 	int len = 0;
@@ -598,7 +598,9 @@ static int reopen_stdout(const char *oneline, int nr, int total)
 		strcpy(filename + len, fmt_patch_suffix);
 	}
 
-	fprintf(realstdout, "%s\n", filename + outdir_offset);
+	if (!DIFF_OPT_TST(&rev->diffopt, QUIET))
+		fprintf(realstdout, "%s\n", filename + outdir_offset);
+
 	if (freopen(filename, "w", stdout) == NULL)
 		return error("Cannot open patch file %s",filename);
 
@@ -687,7 +689,7 @@ static void make_cover_letter(struct rev_info *rev, int use_stdout,
 		die("Cover letter needs email format");
 
 	if (!use_stdout && reopen_stdout(numbered_files ?
-				NULL : "cover-letter", 0, rev->total))
+				NULL : "cover-letter", 0, rev))
 		return;
 
 	head_sha1 = sha1_to_hex(head->object.sha1);
@@ -1106,7 +1108,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
 		}
 		if (!use_stdout && reopen_stdout(numbered_files ? NULL :
 				get_oneline_for_filename(commit, keep_subject),
-				rev.nr, rev.total))
+				rev.nr, &rev))
 			die("Failed to create output files");
 		shown = log_tree_commit(&rev, commit);
 		free(commit->buffer);
-- 
1.6.0.2

                 reply	other threads:[~2009-03-18 17:48 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=1237395645-22085-1-git-send-email-ncase@xes-inc.com \
    --to=ncase@xes-inc.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.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;
as well as URLs for NNTP newsgroup(s).