From: "René Scharfe" <l.s.r@web.de>
To: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>,
"Junio C Hamano" <gitster@pobox.com>
Cc: git@vger.kernel.org, "Michał Kępień" <michal@isc.org>
Subject: [PATCH 2/2] combine-diff: abort if --output is given
Date: Sat, 18 Jun 2022 13:12:34 +0200 [thread overview]
Message-ID: <493bbdb3-be73-9aa2-e3f6-82508d15ef88@web.de> (raw)
In-Reply-To: <220524.86v8tuvfl1.gmgdl@evledraar.gmail.com>
The code for combined diffs currently only writes to stdout. Abort and
report that fact instead of silently ignoring the --output option. The
(empty) output file has already been created at that point, though.
Reported-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: René Scharfe <l.s.r@web.de>
---
combine-diff.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/combine-diff.c b/combine-diff.c
index 11df1d7f39..b0ece95480 100644
--- a/combine-diff.c
+++ b/combine-diff.c
@@ -1501,6 +1501,9 @@ void diff_tree_combined(const struct object_id *oid,
if (opt->ignore_regex_nr)
die("combined diff and '%s' cannot be used together",
"--ignore-matching-lines");
+ if (opt->close_file)
+ die("combined diff and '%s' cannot be used together",
+ "--output");
/* nothing to do, if no parents */
if (!num_parent)
--
2.36.1
prev parent reply other threads:[~2022-06-18 11:12 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-14 9:32 Bug: combined diff with --ignore-matching-lines René Scharfe
2022-05-23 18:31 ` [PATCH] diff: fix a segfault in >2 tree -I<regex> and --output=<file> Ævar Arnfjörð Bjarmason
2022-05-23 20:08 ` Junio C Hamano
2022-05-24 11:38 ` Ævar Arnfjörð Bjarmason
2022-05-24 19:38 ` Junio C Hamano
2022-05-24 20:17 ` Ævar Arnfjörð Bjarmason
2022-06-18 11:12 ` René Scharfe
2022-06-18 11:12 ` [PATCH 1/2] combine-diff: abort if --ignore-matching-lines is given René Scharfe
2022-06-21 15:35 ` Junio C Hamano
2022-06-21 15:58 ` René Scharfe
2022-06-21 16:55 ` Junio C Hamano
2022-06-18 11:12 ` René Scharfe [this message]
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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=493bbdb3-be73-9aa2-e3f6-82508d15ef88@web.de \
--to=l.s.r@web.de \
--cc=avarab@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=michal@isc.org \
/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.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).