Merge branch 'lt/approxidate'
authorJunio C Hamano <gitster@pobox.com>
Tue, 1 Sep 2009 05:11:36 +0000 (22:11 -0700)
committerJunio C Hamano <gitster@pobox.com>
Tue, 1 Sep 2009 05:11:36 +0000 (22:11 -0700)
* lt/approxidate:
fix approxidate parsing of relative months and years
tests: add date printing and parsing tests
refactor test-date interface
Add date formatting and parsing functions relative to a given time
Further 'approxidate' improvements
Improve on 'approxidate'

Conflicts:
date.c

1  2 
cache.h
diff --combined cache.h
index 808dabacd6e2a4c083ed4af05f76985d9b3b4047,cd5aa89ca90c6405a9f4872d139b053880cff06b..5fad24ce219be746ad582d8432464753975f34fe
+++ b/cache.h
@@@ -330,7 -330,7 +330,7 @@@ static inline void remove_name_hash(str
  #define remove_file_from_cache(path) remove_file_from_index(&the_index, (path))
  #define add_to_cache(path, st, flags) add_to_index(&the_index, (path), (st), (flags))
  #define add_file_to_cache(path, flags) add_file_to_index(&the_index, (path), (flags))
 -#define refresh_cache(flags) refresh_index(&the_index, (flags), NULL, NULL)
 +#define refresh_cache(flags) refresh_index(&the_index, (flags), NULL, NULL, NULL)
  #define ce_match_stat(ce, st, options) ie_match_stat(&the_index, (ce), (st), (options))
  #define ce_modified(ce, st, options) ie_modified(&the_index, (ce), (st), (options))
  #define cache_name_exists(name, namelen, igncase) index_name_exists(&the_index, (name), (namelen), (igncase))
@@@ -469,15 -469,15 +469,15 @@@ extern int index_path(unsigned char *sh
  extern void fill_stat_cache_info(struct cache_entry *ce, struct stat *st);
  
  /* "careful lstat()" */
 -extern int check_path(const char *path, int len, struct stat *st);
 +extern int check_path(const char *path, int len, struct stat *st, int skiplen);
  
  #define REFRESH_REALLY                0x0001  /* ignore_valid */
  #define REFRESH_UNMERGED      0x0002  /* allow unmerged */
  #define REFRESH_QUIET         0x0004  /* be quiet about it */
  #define REFRESH_IGNORE_MISSING        0x0008  /* ignore non-existent */
  #define REFRESH_IGNORE_SUBMODULES     0x0010  /* ignore submodules */
 -#define REFRESH_SAY_CHANGED   0x0020  /* say "changed" not "needs update" */
 -extern int refresh_index(struct index_state *, unsigned int flags, const char **pathspec, char *seen);
 +#define REFRESH_IN_PORCELAIN  0x0020  /* user friendly output, not "needs update" */
 +extern int refresh_index(struct index_state *, unsigned int flags, const char **pathspec, char *seen, char *header_msg);
  
  struct lock_file {
        struct lock_file *next;
@@@ -731,9 -731,14 +731,14 @@@ enum date_mode 
  };
  
  const char *show_date(unsigned long time, int timezone, enum date_mode mode);
+ const char *show_date_relative(unsigned long time, int tz,
+                              const struct timeval *now,
+                              char *timebuf,
+                              size_t timebuf_size);
  int parse_date(const char *date, char *buf, int bufsize);
  void datestamp(char *buf, int bufsize);
  unsigned long approxidate(const char *);
+ unsigned long approxidate_relative(const char *date, const struct timeval *now);
  enum date_mode parse_date_format(const char *format);
  
  #define IDENT_WARN_ON_NO_NAME  1