Merge branch 'maint'
authorJunio C Hamano <gitster@pobox.com>
Sun, 8 Mar 2009 06:34:13 +0000 (22:34 -0800)
committerJunio C Hamano <gitster@pobox.com>
Sun, 8 Mar 2009 06:34:13 +0000 (22:34 -0800)
* maint:
builtin-revert.c: release index lock when cherry-picking an empty commit
document config --bool-or-int
t1300: use test_must_fail as appropriate
cleanup: add isascii()
Documentation: fix badly indented paragraphs in "--bisect-all" description

1  2 
Documentation/git-config.txt
pretty.c
index 7d140073b13224d0763a6f62f58fc765bfbf0003,6ab2af4b61e2188297e15f2e3c1d9c5f05f680b8..82ce89eae849e5a1c697a3c7f659a80521600348
@@@ -22,7 -22,6 +22,7 @@@ SYNOPSI
  'git config' [<file-option>] [-z|--null] -l | --list
  'git config' [<file-option>] --get-color name [default]
  'git config' [<file-option>] --get-colorbool name [stdout-is-tty]
 +'git config' [<file-option>] -e | --edit
  
  DESCRIPTION
  -----------
@@@ -131,6 -130,10 +131,10 @@@ See also <<FILES>>
        in the config file will cause the value to be multiplied
        by 1024, 1048576, or 1073741824 prior to output.
  
+ --bool-or-int::
+       'git-config' will ensure that the output matches the format of
+       either --bool or --int, as described above.
  -z::
  --null::
        For all options that output values and/or keys, always
        output.  The optional `default` parameter is used instead, if
        there is no color configured for `name`.
  
 +-e::
 +--edit::
 +      Opens an editor to modify the specified config file; either
 +      '--system', '--global', or repository (default).
 +
  [[FILES]]
  FILES
  -----
diff --combined pretty.c
index f49929479f7e68a5214b6b55c31f10e6151c1787,e9540e46da7af16e3aa765d79a5b03a4847975df..c0184080998734450b250aa7dc72c427e1ecac8a
+++ b/pretty.c
  
  static char *user_format;
  
 +static void save_user_format(struct rev_info *rev, const char *cp, int is_tformat)
 +{
 +      free(user_format);
 +      user_format = xstrdup(cp);
 +      if (is_tformat)
 +              rev->use_terminator = 1;
 +      rev->commit_format = CMIT_FMT_USERFORMAT;
 +}
 +
  void get_commit_format(const char *arg, struct rev_info *rev)
  {
        int i;
                return;
        }
        if (!prefixcmp(arg, "format:") || !prefixcmp(arg, "tformat:")) {
 -              const char *cp = strchr(arg, ':') + 1;
 -              free(user_format);
 -              user_format = xstrdup(cp);
 -              if (arg[0] == 't')
 -                      rev->use_terminator = 1;
 -              rev->commit_format = CMIT_FMT_USERFORMAT;
 +              save_user_format(rev, strchr(arg, ':') + 1, arg[0] == 't');
                return;
        }
        for (i = 0; i < ARRAY_SIZE(cmt_fmts); i++) {
                        return;
                }
        }
 +      if (strchr(arg, '%')) {
 +              save_user_format(rev, arg, 1);
 +              return;
 +      }
  
        die("invalid --pretty format: %s", arg);
  }
@@@ -83,8 -75,7 +83,7 @@@ static int get_one_line(const char *msg
  /* High bit set, or ISO-2022-INT */
  int non_ascii(int ch)
  {
-       ch = (ch & 0xff);
-       return ((ch & 0x80) || (ch == 0x1b));
+       return !isascii(ch) || ch == '\033';
  }
  
  static int is_rfc2047_special(char ch)
@@@ -576,16 -567,16 +575,16 @@@ static size_t format_commit_item(struc
                        return end - placeholder + 1;
                }
                if (!prefixcmp(placeholder + 1, "red")) {
 -                      strbuf_addstr(sb, "\033[31m");
 +                      strbuf_addstr(sb, GIT_COLOR_RED);
                        return 4;
                } else if (!prefixcmp(placeholder + 1, "green")) {
 -                      strbuf_addstr(sb, "\033[32m");
 +                      strbuf_addstr(sb, GIT_COLOR_GREEN);
                        return 6;
                } else if (!prefixcmp(placeholder + 1, "blue")) {
 -                      strbuf_addstr(sb, "\033[34m");
 +                      strbuf_addstr(sb, GIT_COLOR_BLUE);
                        return 5;
                } else if (!prefixcmp(placeholder + 1, "reset")) {
 -                      strbuf_addstr(sb, "\033[m");
 +                      strbuf_addstr(sb, GIT_COLOR_RESET);
                        return 6;
                } else
                        return 0;