git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Taylor Blau <me@ttaylorr.com>
To: git@vger.kernel.org
Cc: peff@peff.net, szeder.dev@gmail.com, dstolee@microsoft.com,
	gitster@pobox.com
Subject: [PATCH 1/4] commit-graph.c: don't use discarded graph_name in error
Date: Thu, 23 Apr 2020 15:41:02 -0600	[thread overview]
Message-ID: <17dff6142e62d202794986f0bd51e4a8604f8e49.1587677671.git.me@ttaylorr.com> (raw)
In-Reply-To: <cover.1587677671.git.me@ttaylorr.com>

When writing a commit-graph layer, we do so in a temporary file which is
renamed into place. If we fail to create a temporary file, for e.g.,
because we have too many open files, then 'git_mkstemp_mode' sets the
pattern to the empty string, in which case we get an error something
along the lines of:

  error: unable to create ''

It's not useful to show the pattern here at all, since we (1) know the
pattern is well-formed, and (2) would have already shown the dirname
when trying to create the leading directories. So, replace this error
with something friendlier.

Signed-off-by: Taylor Blau <me@ttaylorr.com>
---
 commit-graph.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/commit-graph.c b/commit-graph.c
index b8737f0ce9..afde075962 100644
--- a/commit-graph.c
+++ b/commit-graph.c
@@ -1397,7 +1397,7 @@ static int write_commit_graph_file(struct write_commit_graph_context *ctx)
 
 		fd = git_mkstemp_mode(ctx->graph_name, 0444);
 		if (fd < 0) {
-			error(_("unable to create '%s'"), ctx->graph_name);
+			error(_("unable to create temporary graph layer"));
 			return -1;
 		}
 
-- 
2.26.0.113.ge9739cdccc


  reply	other threads:[~2020-04-23 21:41 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-23 21:40 [PATCH 0/4] commit-graph: handle file descriptor exhaustion Taylor Blau
2020-04-23 21:41 ` Taylor Blau [this message]
2020-04-23 21:41 ` [PATCH 2/4] t/test-lib.sh: make ULIMIT_FILE_DESCRIPTORS available to tests Taylor Blau
2020-04-23 21:41 ` [PATCH 3/4] commit-graph.c: gracefully handle file descriptor exhaustion Taylor Blau
2021-06-24  9:51   ` t5324-split-commit-graph.sh flaky due to assumptions about ulimit behavior Ævar Arnfjörð Bjarmason
2021-06-24 15:52     ` Jeff King
2020-04-23 21:41 ` [PATCH 4/4] commit-graph: close descriptors after mmap Taylor Blau
2020-04-23 22:04   ` Junio C Hamano
2020-04-24  3:56     ` Jeff King
2020-04-24 13:17     ` Derrick Stolee
2020-04-24 16:35       ` Taylor Blau
2020-04-24 20:02       ` Junio C Hamano
2020-04-27 10:57         ` Derrick Stolee
2020-04-23 21:43 ` [PATCH 0/4] commit-graph: handle file descriptor exhaustion Taylor Blau

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=17dff6142e62d202794986f0bd51e4a8604f8e49.1587677671.git.me@ttaylorr.com \
    --to=me@ttaylorr.com \
    --cc=dstolee@microsoft.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=peff@peff.net \
    --cc=szeder.dev@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;
as well as URLs for NNTP newsgroup(s).