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

[PATCH 1/2] Rename get_ident() to fmt_ident() and make it available to outside

From
Junio C Hamano <junkio@cox.net>
Date
Feb 5, 2007, 03:00 UTC
Message-ID
<7vtzy1pauf.fsf_-_@assigned-by-dhcp.cox.net>
In-Reply-To
<20070204205858.GE12943@thunk.org>

This makes the functionality of ident.c::get_ident() available to other callers.

Signed-off-by: Junio C Hamano <junkio@cox.net>
---
 * This by itself is totally uninteresting, but the second one
   depends on it.
 cache.h |    1 +
 ident.c |    8 ++++----
 2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/cache.h b/cache.h
index 201704b..38a9bc0 100644
--- a/cache.h
+++ b/cache.h
@@ -321,6 +321,7 @@ unsigned long approxidate(const char *);
 
 extern const char *git_author_info(int);
 extern const char *git_committer_info(int);
+extern const char *fmt_ident(const char *name, const char *email, const char *date_str, int);
 
 struct checkout {
 	const char *base_dir;
diff --git a/ident.c b/ident.c
index a6fc7b5..bb03bdd 100644
--- a/ident.c
+++ b/ident.c
@@ -185,8 +185,8 @@ static const char *env_hint =
 "Add --global to set your account\'s default\n"
 "\n";
 
-static const char *get_ident(const char *name, const char *email,
-			     const char *date_str, int error_on_no_name)
+const char *fmt_ident(const char *name, const char *email,
+		      const char *date_str, int error_on_no_name)
 {
 	static char buffer[1000];
 	char date[50];
@@ -233,7 +233,7 @@ static const char *get_ident(const char *name, const char *email,
 
 const char *git_author_info(int error_on_no_name)
 {
-	return get_ident(getenv("GIT_AUTHOR_NAME"),
+	return fmt_ident(getenv("GIT_AUTHOR_NAME"),
 			 getenv("GIT_AUTHOR_EMAIL"),
 			 getenv("GIT_AUTHOR_DATE"),
 			 error_on_no_name);
@@ -241,7 +241,7 @@ const char *git_author_info(int error_on_no_name)
 
 const char *git_committer_info(int error_on_no_name)
 {
-	return get_ident(getenv("GIT_COMMITTER_NAME"),
+	return fmt_ident(getenv("GIT_COMMITTER_NAME"),
 			 getenv("GIT_COMMITTER_EMAIL"),
 			 getenv("GIT_COMMITTER_DATE"),
 			 error_on_no_name);
-- 
1.5.0.rc3.40.g1f7d
Previous: David KågedalNext: Junio C Hamano
Message 10 of 14 in “[ANNOUNCE] GIT 1.5.0-rc3”
  1. Junio C HamanoFeb 1, 2007
  2. Bill LearFeb 1, 2007
  3. Robin RosenbergFeb 1, 2007
  4. What's in git.git (stable)Junio C Hamano, Feb 4, 2007
  5. Jeff KingFeb 4, 2007
  6. Linus TorvaldsFeb 4, 2007
  7. Theodore TsoFeb 4, 2007
  8. Jakub NarebskiFeb 4, 2007
  9. David KågedalFeb 4, 2007
  10. 1/2 Rename get_ident() to fmt_ident() and make it available to outsideJunio C Hamano, Feb 5, 2007
  11. 2/2 git-blame: no rev means start from the working tree file.Junio C Hamano, Feb 5, 2007
  12. Quick status updatesJunio C Hamano, Feb 6, 2007
  13. git-push: allow globbing wildcard refspec.Junio C Hamano, Feb 6, 2007
  14. Shawn O. PearceFeb 6, 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.