]> asedeno.scripts.mit.edu Git - git.git/commitdiff
Merge branch 'ld/discovery-limit-to-fs' (early part)
authorJunio C Hamano <gitster@pobox.com>
Fri, 21 May 2010 11:02:15 +0000 (04:02 -0700)
committerJunio C Hamano <gitster@pobox.com>
Fri, 21 May 2010 11:02:15 +0000 (04:02 -0700)
* 'ld/discovery-limit-to-fs' (early part):
  Rename ONE_FILESYSTEM to DISCOVERY_ACROSS_FILESYSTEM
  GIT_ONE_FILESYSTEM: flip the default to stop at filesystem boundaries
  Add support for GIT_ONE_FILESYSTEM
  truncate cwd string before printing error message
  config.c: remove static keyword from git_env_bool()

1  2 
Documentation/git.txt
cache.h
config.c

diff --combined Documentation/git.txt
index 1a6ba878232f735b9cdac84aff897ef872381bdf,991aaec5992801b68fd6224435d378e0530201a5..bec6348dab45580d90b38dac5667434ba661bf94
@@@ -12,7 -12,6 +12,7 @@@ SYNOPSI
  'git' [--version] [--exec-path[=GIT_EXEC_PATH]] [--html-path]
      [-p|--paginate|--no-pager] [--no-replace-objects]
      [--bare] [--git-dir=GIT_DIR] [--work-tree=GIT_WORK_TREE]
 +    [-c name=value]
      [--help] COMMAND [ARGS]
  
  DESCRIPTION
@@@ -44,17 -43,9 +44,17 @@@ unreleased) version of git, that is ava
  branch of the `git.git` repository.
  Documentation for older releases are available here:
  
 -* link:v1.7.0.3/git.html[documentation for release 1.7.0.3]
 +* link:v1.7.1/git.html[documentation for release 1.7.1]
  
  * release notes for
 +  link:RelNotes-1.7.1.txt[1.7.1].
 +
 +* link:v1.7.0.6/git.html[documentation for release 1.7.0.6]
 +
 +* release notes for
 +  link:RelNotes-1.7.0.6.txt[1.7.0.6],
 +  link:RelNotes-1.7.0.5.txt[1.7.0.5],
 +  link:RelNotes-1.7.0.4.txt[1.7.0.4],
    link:RelNotes-1.7.0.3.txt[1.7.0.3],
    link:RelNotes-1.7.0.2.txt[1.7.0.2],
    link:RelNotes-1.7.0.1.txt[1.7.0.1],
@@@ -229,12 -220,6 +229,12 @@@ displayed. See linkgit:git-help[1] for 
  because `git --help ...` is converted internally into `git
  help ...`.
  
 +-c <name>=<value>::
 +      Pass a configuration parameter to the command. The value
 +      given will override values from configuration files.
 +      The <name> is expected in the same format as listed by
 +      'git config' (subkeys separated by dots).
 +
  --exec-path::
        Path to wherever your core git programs are installed.
        This can also be controlled by setting the GIT_EXEC_PATH
@@@ -545,6 -530,16 +545,16 @@@ git so take care if using Cogito etc
        a GIT_DIR set on the command line or in the environment.
        (Useful for excluding slow-loading network directories.)
  
+ 'GIT_DISCOVERY_ACROSS_FILESYSTEM'::
+       When run in a directory that does not have ".git" repository
+       directory, git tries to find such a directory in the parent
+       directories to find the top of the working tree, but by default it
+       does not cross filesystem boundaries.  This environment variable
+       can be set to true to tell git not to stop at filesystem
+       boundaries.  Like 'GIT_CEILING_DIRECTORIES', this will not affect
+       an explicit repository directory set via 'GIT_DIR' or on the
+       command line.
  git Commits
  ~~~~~~~~~~~
  'GIT_AUTHOR_NAME'::
diff --combined cache.h
index 8270390c885ab16de68ff700e2a1eb69cee5e7cb,535153e1b32e2f9c7b0644aadccd725a0613746d..d00d2be320152cfdd2580468db27d6735dc59748
+++ b/cache.h
@@@ -701,7 -701,7 +701,7 @@@ static inline void *read_sha1_file(cons
        return read_sha1_file_repl(sha1, type, size, NULL);
  }
  extern int hash_sha1_file(const void *buf, unsigned long len, const char *type, unsigned char *sha1);
 -extern int write_sha1_file(void *buf, unsigned long len, const char *type, unsigned char *return_sha1);
 +extern int write_sha1_file(const void *buf, unsigned long len, const char *type, unsigned char *return_sha1);
  extern int pretend_sha1_file(void *, unsigned long, enum object_type, unsigned char *);
  extern int force_object_loose(const unsigned char *sha1, time_t mtime);
  
@@@ -718,8 -718,6 +718,8 @@@ extern int has_loose_object_nonlocal(co
  
  extern int has_pack_index(const unsigned char *sha1);
  
 +extern void assert_sha1_type(const unsigned char *sha1, enum object_type expect);
 +
  extern const signed char hexval_table[256];
  static inline unsigned int hexval(unsigned char c)
  {
@@@ -938,15 -936,12 +938,15 @@@ extern int update_server_info(int)
  typedef int (*config_fn_t)(const char *, const char *, void *);
  extern int git_default_config(const char *, const char *, void *);
  extern int git_config_from_file(config_fn_t fn, const char *, void *);
 +extern int git_config_parse_parameter(const char *text);
 +extern int git_config_from_parameters(config_fn_t fn, void *data);
  extern int git_config(config_fn_t fn, void *);
  extern int git_parse_ulong(const char *, unsigned long *);
  extern int git_config_int(const char *, const char *);
  extern unsigned long git_config_ulong(const char *, const char *);
  extern int git_config_bool_or_int(const char *, const char *, int *);
  extern int git_config_bool(const char *, const char *);
 +extern int git_config_maybe_bool(const char *, const char *);
  extern int git_config_string(const char **, const char *, const char *);
  extern int git_config_pathname(const char **, const char *, const char *);
  extern int git_config_set(const char *, const char *);
@@@ -954,6 -949,7 +954,7 @@@ extern int git_config_set_multivar(cons
  extern int git_config_rename_section(const char *, const char *);
  extern const char *git_etc_gitconfig(void);
  extern int check_repository_format_version(const char *var, const char *value, void *cb);
+ extern int git_env_bool(const char *, int);
  extern int git_config_system(void);
  extern int git_config_global(void);
  extern int config_error_nonbool(const char *);
@@@ -1045,7 -1041,6 +1046,7 @@@ void shift_tree_by(const unsigned char 
  #define WS_INDENT_WITH_NON_TAB        04
  #define WS_CR_AT_EOL           010
  #define WS_BLANK_AT_EOF        020
 +#define WS_TAB_IN_INDENT       040
  #define WS_TRAILING_SPACE      (WS_BLANK_AT_EOL|WS_BLANK_AT_EOF)
  #define WS_DEFAULT_RULE (WS_TRAILING_SPACE|WS_SPACE_BEFORE_TAB)
  extern unsigned whitespace_rule_cfg;
@@@ -1054,7 -1049,7 +1055,7 @@@ extern unsigned parse_whitespace_rule(c
  extern unsigned ws_check(const char *line, int len, unsigned ws_rule);
  extern void ws_check_emit(const char *line, int len, unsigned ws_rule, FILE *stream, const char *set, const char *reset, const char *ws);
  extern char *whitespace_error_string(unsigned ws);
 -extern int ws_fix_copy(char *, const char *, int, unsigned, int *);
 +extern void ws_fix_copy(struct strbuf *, const char *, int, unsigned, int *);
  extern int ws_blank_line(const char *line, int len, unsigned ws_rule);
  
  /* ls-files */
@@@ -1064,7 -1059,4 +1065,7 @@@ void overlay_tree_on_cache(const char *
  char *alias_lookup(const char *alias);
  int split_cmdline(char *cmdline, const char ***argv);
  
 +/* builtin/merge.c */
 +int checkout_fast_forward(const unsigned char *from, const unsigned char *to);
 +
  #endif /* CACHE_H */
diff --combined config.c
index aab53298a1a02577015a2c3481667a9b53bba1b1,70e460016e1bb56295686768dd0b1cc6b981881e..9b6b1df212252901b2e577009651ba8d26e4f25a
+++ b/config.c
@@@ -7,7 -7,6 +7,7 @@@
   */
  #include "cache.h"
  #include "exec_cmd.h"
 +#include "strbuf.h"
  
  #define MAXNAME (256)
  
@@@ -19,48 -18,6 +19,48 @@@ static int zlib_compression_seen
  
  const char *config_exclusive_filename = NULL;
  
 +struct config_item
 +{
 +      struct config_item *next;
 +      char *name;
 +      char *value;
 +};
 +static struct config_item *config_parameters;
 +static struct config_item **config_parameters_tail = &config_parameters;
 +
 +static void lowercase(char *p)
 +{
 +      for (; *p; p++)
 +              *p = tolower(*p);
 +}
 +
 +int git_config_parse_parameter(const char *text)
 +{
 +      struct config_item *ct;
 +      struct strbuf tmp = STRBUF_INIT;
 +      struct strbuf **pair;
 +      strbuf_addstr(&tmp, text);
 +      pair = strbuf_split(&tmp, '=');
 +      if (pair[0]->len && pair[0]->buf[pair[0]->len - 1] == '=')
 +              strbuf_setlen(pair[0], pair[0]->len - 1);
 +      strbuf_trim(pair[0]);
 +      if (!pair[0]->len) {
 +              strbuf_list_free(pair);
 +              return -1;
 +      }
 +      ct = xcalloc(1, sizeof(struct config_item));
 +      ct->name = strbuf_detach(pair[0], NULL);
 +      if (pair[1]) {
 +              strbuf_trim(pair[1]);
 +              ct->value = strbuf_detach(pair[1], NULL);
 +      }
 +      strbuf_list_free(pair);
 +      lowercase(ct->name);
 +      *config_parameters_tail = ct;
 +      config_parameters_tail = &ct->next;
 +      return 0;
 +}
 +
  static int get_next_char(void)
  {
        int c;
@@@ -365,30 -322,17 +365,30 @@@ unsigned long git_config_ulong(const ch
        return ret;
  }
  
 -int git_config_bool_or_int(const char *name, const char *value, int *is_bool)
 +int git_config_maybe_bool(const char *name, const char *value)
  {
 -      *is_bool = 1;
        if (!value)
                return 1;
        if (!*value)
                return 0;
 -      if (!strcasecmp(value, "true") || !strcasecmp(value, "yes") || !strcasecmp(value, "on"))
 +      if (!strcasecmp(value, "true")
 +          || !strcasecmp(value, "yes")
 +          || !strcasecmp(value, "on"))
                return 1;
 -      if (!strcasecmp(value, "false") || !strcasecmp(value, "no") || !strcasecmp(value, "off"))
 +      if (!strcasecmp(value, "false")
 +          || !strcasecmp(value, "no")
 +          || !strcasecmp(value, "off"))
                return 0;
 +      return -1;
 +}
 +
 +int git_config_bool_or_int(const char *name, const char *value, int *is_bool)
 +{
 +      int v = git_config_maybe_bool(name, value);
 +      if (0 <= v) {
 +              *is_bool = 1;
 +              return v;
 +      }
        *is_bool = 0;
        return git_config_int(name, value);
  }
@@@ -739,7 -683,7 +739,7 @@@ const char *git_etc_gitconfig(void
        return system_wide;
  }
  
static int git_env_bool(const char *k, int def)
+ int git_env_bool(const char *k, int def)
  {
        const char *v = getenv(k);
        return v ? git_config_bool(k, v) : def;
@@@ -755,15 -699,6 +755,15 @@@ int git_config_global(void
        return !git_env_bool("GIT_CONFIG_NOGLOBAL", 0);
  }
  
 +int git_config_from_parameters(config_fn_t fn, void *data)
 +{
 +      const struct config_item *ct;
 +      for (ct = config_parameters; ct; ct = ct->next)
 +              if (fn(ct->name, ct->value, data) < 0)
 +                      return -1;
 +      return 0;
 +}
 +
  int git_config(config_fn_t fn, void *data)
  {
        int ret = 0, found = 0;
                found += 1;
        }
        free(repo_config);
 +
 +      if (config_parameters) {
 +              ret += git_config_from_parameters(fn, data);
 +              found += 1;
 +      }
 +
        if (found == 0)
                return -1;
        return ret;