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

[PATCH] Remove pointless calls to access(2) when checking for .mailmap

From
Alex Riesen <raa.lkml@gmail.com>
Date
Apr 30, 2007, 22:27 UTC
Message-ID
<20070430222705.GC5000@steel.home>

read_mailmap already returns not 0 in case of error, and nothing seem to be interested in it. It also is silent about the fact (read_mailmap being to chatty would justify the call to access, but there is no point for it to be and it isn't).

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
---
 builtin-blame.c    |    2 +-
 builtin-shortlog.c |    3 +--
 2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/builtin-blame.c b/builtin-blame.c
index 682edba..3442d28 100644
--- a/builtin-blame.c
+++ b/builtin-blame.c
@@ -2375,7 +2375,7 @@ int cmd_blame(int argc, const char **argv, const char *prefix)
 		die("reading graft file %s failed: %s",
 		    revs_file, strerror(errno));
 
-	if (!no_mailmap && !access(".mailmap", R_OK))
+	if (!no_mailmap)
 		read_mailmap(&mailmap, ".mailmap", NULL);
 
 	assign_blame(&sb, &revs, opt);
diff --git a/builtin-shortlog.c b/builtin-shortlog.c
index b57a88a..8d3f742 100644
--- a/builtin-shortlog.c
+++ b/builtin-shortlog.c
@@ -283,8 +283,7 @@ int cmd_shortlog(int argc, const char **argv, const char *prefix)
 	if (argc > 1)
 		die ("unrecognized argument: %s", argv[1]);
 
-	if (!access(".mailmap", R_OK))
-		read_mailmap(&mailmap, ".mailmap", &common_repo_prefix);
+	read_mailmap(&mailmap, ".mailmap", &common_repo_prefix);
 
 	if (rev.pending.nr == 0) {
 		if (isatty(0))
-- 
1.5.2.rc0.792.g7f4bd0
Message 1 of 1 in “Remove pointless calls to access(2) when checking for .mailmap”
  1. Remove pointless calls to access(2) when checking for .mailmapAlex Riesen, Apr 30, 2007

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.