Merge branch 'sp/safecrlf'
authorJunio C Hamano <gitster@pobox.com>
Sun, 17 Feb 2008 01:59:20 +0000 (17:59 -0800)
committerJunio C Hamano <gitster@pobox.com>
Sun, 17 Feb 2008 01:59:20 +0000 (17:59 -0800)
* sp/safecrlf:
  safecrlf: Add mechanism to warn about irreversible crlf conversions

1  2 
Documentation/config.txt
builtin-apply.c
builtin-blame.c
cache.h
config.c
convert.c
diff.c
environment.c

Simple merge
diff --cc builtin-apply.c
Simple merge
diff --cc builtin-blame.c
Simple merge
diff --cc cache.h
Simple merge
diff --cc config.c
index 7881bbc7782b7937e450ad99c4bb6bda67c1f2e3,3256c99553564eedfcfc17e4b289d85a72bb145d..8064cae18290d66ee69f1a56e501391ecb317b3d
+++ b/config.c
@@@ -415,9 -407,16 +415,18 @@@ int git_default_config(const char *var
                return 0;
        }
  
+       if (!strcmp(var, "core.safecrlf")) {
+               if (value && !strcasecmp(value, "warn")) {
+                       safe_crlf = SAFE_CRLF_WARN;
+                       return 0;
+               }
+               safe_crlf = git_config_bool(var, value);
+               return 0;
+       }
        if (!strcmp(var, "user.name")) {
 +              if (!value)
 +                      return config_error_nonbool(var);
                strlcpy(git_default_name, value, sizeof(git_default_name));
                return 0;
        }
diff --cc convert.c
Simple merge
diff --cc diff.c
Simple merge
diff --cc environment.c
index fa3633372b8249899ff1e57a2f1431de029b211d,e351e99ed76827c2b341343a63aecca426867214..3527f1663f3f948085ab56a81609ed9764b4e6e9
@@@ -30,11 -30,12 +30,12 @@@ int core_compression_seen
  size_t packed_git_window_size = DEFAULT_PACKED_GIT_WINDOW_SIZE;
  size_t packed_git_limit = DEFAULT_PACKED_GIT_LIMIT;
  size_t delta_base_cache_limit = 16 * 1024 * 1024;
 -char *pager_program;
 +const char *pager_program;
  int pager_use_color = 1;
 -char *editor_program;
 -char *excludes_file;
 +const char *editor_program;
 +const char *excludes_file;
  int auto_crlf = 0;    /* 1: both ways, -1: only when adding git objects */
+ enum safe_crlf safe_crlf = SAFE_CRLF_WARN;
  unsigned whitespace_rule_cfg = WS_DEFAULT_RULE;
  
  /* This is set by setup_git_dir_gently() and/or git_default_config() */