Merge branch 'jk/mailmap-from-blob'
authorJunio C Hamano <gitster@pobox.com>
Sun, 6 Jan 2013 07:41:42 +0000 (23:41 -0800)
committerJunio C Hamano <gitster@pobox.com>
Sun, 6 Jan 2013 07:41:42 +0000 (23:41 -0800)
Allow us to read, and default to read, mailmap files from the tip
of the history in bare repositories. This will help running tools
like shortlog in server settings.

* jk/mailmap-from-blob:
mailmap: default mailmap.blob in bare repositories
mailmap: fix some documentation loose-ends for mailmap.blob
mailmap: clean up read_mailmap error handling
mailmap: support reading mailmap from blobs
mailmap: refactor mailmap parsing for non-file sources

1  2 
Documentation/config.txt
Documentation/mailmap.txt
cache.h
diff --combined Documentation/config.txt
index 50a228899974ea5dc98623647a5bd9f591452fd0,1a3c554dbfbb35901855f3b8e6410c3d4154a262..0e206759fd3dcd6c1dd600cf0532676222d52642
@@@ -140,11 -140,10 +140,11 @@@ advice.*:
        can tell Git that you do not need help by setting these to 'false':
  +
  --
 -      pushNonFastForward::
 +      pushUpdateRejected::
                Set this variable to 'false' if you want to disable
 -              'pushNonFFCurrent', 'pushNonFFDefault', and
 -              'pushNonFFMatching' simultaneously.
 +              'pushNonFFCurrent', 'pushNonFFDefault',
 +              'pushNonFFMatching', and 'pushAlreadyExists'
 +              simultaneously.
        pushNonFFCurrent::
                Advice shown when linkgit:git-push[1] fails due to a
                non-fast-forward update to the current branch.
                'matching refs' explicitly (i.e. you used ':', or
                specified a refspec that isn't your current branch) and
                it resulted in a non-fast-forward error.
 +      pushAlreadyExists::
 +              Shown when linkgit:git-push[1] rejects an update that
 +              does not qualify for fast-forwarding (e.g., a tag.)
        statusHints::
                Show directions on how to proceed from the current
                state in the output of linkgit:git-status[1], in
@@@ -1521,6 -1517,14 +1521,14 @@@ mailmap.file:
        subdirectory, or somewhere outside of the repository itself.
        See linkgit:git-shortlog[1] and linkgit:git-blame[1].
  
+ mailmap.blob::
+       Like `mailmap.file`, but consider the value as a reference to a
+       blob in the repository. If both `mailmap.file` and
+       `mailmap.blob` are given, both are parsed, with entries from
+       `mailmap.file` taking precedence. In a bare repository, this
+       defaults to `HEAD:.mailmap`. In a non-bare repository, it
+       defaults to empty.
  man.viewer::
        Specify the programs that may be used to display help in the
        'man' format. See linkgit:git-help[1].
index dd89fca3f8996e119ce9d0cec0a6d9fc6616525d,bb349c2db3d4f48bdf9ff6ee09ae2344a06c680a..4a8c276529a574355185adf3c77dede6fbd94267
@@@ -1,5 -1,6 +1,6 @@@
  If the file `.mailmap` exists at the toplevel of the repository, or at
- the location pointed to by the mailmap.file configuration option, it
+ the location pointed to by the mailmap.file or mailmap.blob
+ configuration options, it
  is used to map author and committer names and email addresses to
  canonical real names and email addresses.
  
@@@ -46,7 -47,7 +47,7 @@@ Jane Doe         <jane@desktop.(none)
  Joe R. Developer <joe@example.com>
  ------------
  
 -Note how there is no need for an entry for <jane@laptop.(none)>, because the
 +Note how there is no need for an entry for `<jane@laptop.(none)>`, because the
  real name of that author is already correct.
  
  Example 2: Your repository contains commits from the following
diff --combined cache.h
index 8f89f17a0c3be6520921cf98256bb6e202b2c345,a65f6d141f311477e17177d6007f8a4131973c3a..8ceb6b8e8d4a51bcbe3bc165bf7dd745788ee095
+++ b/cache.h
@@@ -473,8 -473,6 +473,8 @@@ extern int index_name_is_other(const st
  extern int ie_match_stat(const struct index_state *, struct cache_entry *, struct stat *, unsigned int);
  extern int ie_modified(const struct index_state *, struct cache_entry *, struct stat *, unsigned int);
  
 +#define PATHSPEC_ONESTAR 1    /* the pathspec pattern sastisfies GFNM_ONESTAR */
 +
  struct pathspec {
        const char **raw; /* get_pathspec() result, not freed by free_pathspec() */
        int nr;
        struct pathspec_item {
                const char *match;
                int len;
 -              unsigned int use_wildcard:1;
 +              int nowildcard_len;
 +              int flags;
        } *items;
  };
  
@@@ -717,11 -714,10 +717,11 @@@ static inline int is_absolute_path(cons
  }
  int is_directory(const char *);
  const char *real_path(const char *path);
 +const char *real_path_if_valid(const char *path);
  const char *absolute_path(const char *path);
  const char *relative_path(const char *abs, const char *base);
  int normalize_path_copy(char *dst, const char *src);
 -int longest_ancestor_length(const char *path, const char *prefix_list);
 +int longest_ancestor_length(const char *path, struct string_list *prefixes);
  char *strip_path_suffix(const char *path, const char *suffix);
  int daemon_avoid_alias(const char *path);
  int offset_1st_component(const char *path);
@@@ -1003,19 -999,14 +1003,19 @@@ struct ref 
        unsigned char old_sha1[20];
        unsigned char new_sha1[20];
        char *symref;
 -      unsigned int force:1,
 +      unsigned int
 +              force:1,
 +              requires_force:1,
                merge:1,
                nonfastforward:1,
 +              not_forwardable:1,
 +              update:1,
                deletion:1;
        enum {
                REF_STATUS_NONE = 0,
                REF_STATUS_OK,
                REF_STATUS_REJECT_NONFASTFORWARD,
 +              REF_STATUS_REJECT_ALREADY_EXISTS,
                REF_STATUS_REJECT_NODELETE,
                REF_STATUS_UPTODATE,
                REF_STATUS_REMOTE_REJECT,
@@@ -1164,6 -1155,7 +1164,7 @@@ extern int author_ident_sufficiently_gi
  extern const char *git_commit_encoding;
  extern const char *git_log_output_encoding;
  extern const char *git_mailmap_file;
+ extern const char *git_mailmap_blob;
  
  /* IO helper functions */
  extern void maybe_flush_or_die(FILE *, const char *);