login
Header Space

 
 

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

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <git@...>
Cc: Linus Torvalds <torvalds@...>, Jeff King <peff@...>, Theodore Tso <tytso@...>
Date: Sunday, February 4, 2007 - 11:00 pm

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


-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
What's in git.git (stable), Junio C Hamano, (Sun Feb 4, 5:36 am)
Quick status updates, Junio C Hamano, (Tue Feb 6, 3:40 am)
[PATCH] git-push: allow globbing wildcard refspec., Junio C Hamano, (Tue Feb 6, 3:48 am)
Re: [PATCH] git-push: allow globbing wildcard refspec., Shawn O. Pearce, (Tue Feb 6, 3:53 am)
Re: What's in git.git (stable), Jeff King, (Sun Feb 4, 2:51 pm)
Re: What's in git.git (stable), Linus Torvalds, (Sun Feb 4, 3:12 pm)
Re: What's in git.git (stable), Theodore Tso, (Sun Feb 4, 4:58 pm)
[PATCH 1/2] Rename get_ident() to fmt_ident() and make it av..., Junio C Hamano, (Sun Feb 4, 11:00 pm)
speck-geostationary