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

[PATCH 3/5] ident: make user_ident_explicitly_given static

From
Jeff King <peff@peff.net>
Date
Nov 28, 2012, 18:26 UTC
Message-ID
<20121128182613.GC17122@sigill.intra.peff.net>
In-Reply-To
<20121128182534.GA21020@sigill.intra.peff.net>

In v1.5.6-rc0~56^2 (2008-05-04) "user_ident_explicitly_given" was introduced as a global for communication between config, ident, and builtin-commit. In v1.7.0-rc0~72^2 (2010-01-07) readers switched to using the common wrapper user_ident_sufficiently_given(). After v1.7.11-rc1~15^2~18 (2012-05-21), the var is only written in ident.c.

Now we can make it static, which will enable further refactoring without worrying about upsetting other code.

Signed-off-by: Jeff King <peff@peff.net>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
---
 cache.h | 4 ----
 ident.c | 6 +++++-
 2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/cache.h b/cache.h
index dbd8018..50d9eea 100644
--- a/cache.h
+++ b/cache.h
@@ -1149,10 +1149,6 @@ struct config_include_data {
 #define CONFIG_INCLUDE_INIT { 0 }
 extern int git_config_include(const char *name, const char *value, void *data);
 
-#define IDENT_NAME_GIVEN 01
-#define IDENT_MAIL_GIVEN 02
-#define IDENT_ALL_GIVEN (IDENT_NAME_GIVEN|IDENT_MAIL_GIVEN)
-extern int user_ident_explicitly_given;
 extern int user_ident_sufficiently_given(void);
 
 extern const char *git_commit_encoding;
diff --git a/ident.c b/ident.c
index a4bf206..733d69d 100644
--- a/ident.c
+++ b/ident.c
@@ -10,7 +10,11 @@
 static struct strbuf git_default_name = STRBUF_INIT;
 static struct strbuf git_default_email = STRBUF_INIT;
 static char git_default_date[50];
-int user_ident_explicitly_given;
+
+#define IDENT_NAME_GIVEN 01
+#define IDENT_MAIL_GIVEN 02
+#define IDENT_ALL_GIVEN (IDENT_NAME_GIVEN|IDENT_MAIL_GIVEN)
+static int user_ident_explicitly_given;
 
 #ifdef NO_GECOS_IN_PWENT
 #define get_gecos(ignored) "&"
-- 
1.8.0.207.gdf2154c
Previous: Jeff KingNext: Jeff King
Message 4 of 12 in “jk/send-email-sender-prompt loose ends”
  1. 0/5 jk/send-email-sender-prompt loose endsJeff King, Nov 28, 2012
  2. 1/5 test-lib: allow negation of prerequisitesJeff King, Nov 28, 2012
  3. 2/5 t7502: factor out autoident prerequisiteJeff King, Nov 28, 2012
  4. 3/5 ident: make user_ident_explicitly_given staticJeff King, Nov 28, 2012
  5. 4/5 ident: keep separate "explicit" flags for author and committerJeff King, Nov 28, 2012
  6. 5/5 t: add tests for "git var"Jeff King, Nov 28, 2012
  7. 6/5 t9001: check send-email behavior with implicit senderJeff King, Nov 28, 2012
  8. Junio C HamanoNov 28, 2012
  9. Jeff KingNov 28, 2012
  10. Jeff KingNov 28, 2012
  11. Junio C HamanoNov 28, 2012
  12. Felipe ContrerasNov 28, 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.