Re: [PATCH 1/6] ident: make user_ident_explicitly_given private

2012-11-14 Thread Jonathan Nieder
Jeff King wrote:

 There are no users of this global variable, as queriers
 go through the user_ident_sufficiently_given accessor.
 Let's make it private, which will enable further
 refactoring.
[...]
 --- 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);

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,
and the variable can finally be made static.

This patch finally does that, which is a nice way to make cache.h
easier to read and change less often.

For what it's worth,
Reviewed-by: Jonathan Nieder jrnie...@gmail.com
--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/6] ident: make user_ident_explicitly_given private

2012-11-14 Thread Jeff King
On Wed, Nov 14, 2012 at 08:44:57AM -0800, Jonathan Nieder wrote:

  -#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);
 
 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,
 and the variable can finally be made static.

Thanks for digging up the history. I remembered trying to do this before
during the ident refactoring that went into v1.7.11, but it didn't work
then for some reason (I think it was probably an earlier iteration of
the series, and then I forgot to revisit it during the final one).

I'll add your explanation to the commit message if I re-roll.

-Peff
--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html