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

Re: receive.denyNonNonFastForwards not denying force update

From
Jeff King <peff@peff.net>
Date
Aug 21, 2012, 06:31 UTC
Message-ID
<20120821063152.GD26516@sigill.intra.peff.net>
In-Reply-To
<20120821062219.GB26516@sigill.intra.peff.net>
On Tue, Aug 21, 2012 at 02:22:19AM -0400, Jeff King wrote:
> And this might be a good follow-on:
> 
> -- >8 --
> Subject: [PATCH] gitignore: report access errors of exclude files

And if we are going to do that, then we almost certainly want to do this.

-- >8 --
Subject: [PATCH] attr: warn on inaccessible attribute files

Just like config and gitignore files, we silently ignore missing or inaccessible attribute files. An existent but inaccessible file is probably a configuration error, so let's warn the user.

Signed-off-by: Jeff King <peff@peff.net>
---
 attr.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/attr.c b/attr.c
index b52efb5..cab01b8 100644
--- a/attr.c
+++ b/attr.c
@@ -352,8 +352,11 @@ static struct attr_stack *read_attr_from_file(const char *path, int macro_ok)
 	char buf[2048];
 	int lineno = 0;
 
-	if (!fp)
+	if (!fp) {
+		if (errno != ENOENT)
+			warning(_("unable to access '%s': %s"), path, strerror(errno));
 		return NULL;
+	}
 	res = xcalloc(1, sizeof(*res));
 	while (fgets(buf, sizeof(buf), fp))
 		handle_attr_line(res, buf, path, ++lineno, macro_ok);
-- 
1.7.12.4.g4e9f38f
Previous: Jeff KingNext: Junio C Hamano
Message 13 of 20 in “receive.denyNonNonFastForwards not denying force update”
  1. John ArthorneAug 20, 2012
  2. Junio C HamanoAug 20, 2012
  3. Sitaram ChamartyAug 21, 2012
  4. Junio C HamanoAug 21, 2012
  5. Brandon CaseyAug 21, 2012
  6. Jay SoffianAug 21, 2012
  7. Junio C HamanoAug 21, 2012
  8. Jeff KingAug 21, 2012
  9. Junio C HamanoAug 21, 2012
  10. Jeff KingAug 21, 2012
  11. Jeff KingAug 21, 2012
  12. Jeff KingAug 21, 2012
  13. Jeff KingAug 21, 2012
  14. Junio C HamanoAug 21, 2012
  15. Jeff KingAug 21, 2012
  16. Junio C HamanoAug 21, 2012
  17. Junio C HamanoAug 21, 2012
  18. Jeff KingAug 21, 2012
  19. Sitaram ChamartyAug 21, 2012
  20. John ArthorneSep 10, 2012

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.