Teach "approxidate" about weekday syntax

This allows people to use syntax like "last thursday" for the approxidate.

(Or, indeed, more complex "three thursdays ago", but I suspect that would
be pretty unusual).

NOTE! The parsing is strictly sequential, so if you do

	"one day before last thursday"

it will _not_ do what you think it does. It will take the current time,
subtract one day, and then go back to the thursday before that. So to get
what you want, you'd have to write it the other way around:

	"last thursday and one day before"

which is insane (it's usually the same as "last wednesday" _except_ if
today is Thursday, in which case "last wednesday" is yesterday, and "last
thursday and one day before" is eight days ago).

Similarly,

	"last thursday one month ago"

will first go back to last thursday, and then go back one month from
there, not the other way around.

I doubt anybody would ever use insane dates like that, but I thought I'd
point out that the approxidate parsing is not exactly "standard English".

Side note 2: if you want to avoid spaces (because of quoting issues), you
can use any non-alphanumberic character instead. So

	git log --since=2.days.ago

works without any quotes.

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
1 file changed
tree: 4f8b4f1c79fcf1cf4c57b05c74e19acb05cc2e88
  1. arm/
  2. compat/
  3. debian/
  4. Documentation/
  5. mozilla-sha1/
  6. ppc/
  7. t/
  8. templates/
  9. .gitignore
  10. apply.c
  11. blob.c
  12. blob.h
  13. cache.h
  14. cat-file.c
  15. check-ref-format.c
  16. checkout-index.c
  17. clone-pack.c
  18. cmd-rename.sh
  19. commit-tree.c
  20. commit.c
  21. commit.h
  22. config.c
  23. connect.c
  24. convert-objects.c
  25. copy.c
  26. COPYING
  27. count-delta.c
  28. count-delta.h
  29. csum-file.c
  30. csum-file.h
  31. ctype.c
  32. daemon.c
  33. date.c
  34. delta.h
  35. diff-delta.c
  36. diff-files.c
  37. diff-index.c
  38. diff-stages.c
  39. diff-tree.c
  40. diff.c
  41. diff.h
  42. diffcore-break.c
  43. diffcore-order.c
  44. diffcore-pathspec.c
  45. diffcore-pickaxe.c
  46. diffcore-rename.c
  47. diffcore.h
  48. entry.c
  49. environment.c
  50. epoch.c
  51. epoch.h
  52. fetch-pack.c
  53. fetch.c
  54. fetch.h
  55. fsck-objects.c
  56. get-tar-commit-id.c
  57. git-add.sh
  58. git-am.sh
  59. git-applymbox.sh
  60. git-applypatch.sh
  61. git-archimport.perl
  62. git-bisect.sh
  63. git-branch.sh
  64. git-checkout.sh
  65. git-cherry.sh
  66. git-clone.sh
  67. git-commit.sh
  68. git-count-objects.sh
  69. git-cvsexportcommit.perl
  70. git-cvsimport.perl
  71. git-diff.sh
  72. git-fetch.sh
  73. git-fmt-merge-msg.perl
  74. git-format-patch.sh
  75. git-grep.sh
  76. git-log.sh
  77. git-lost-found.sh
  78. git-ls-remote.sh
  79. git-merge-octopus.sh
  80. git-merge-one-file.sh
  81. git-merge-ours.sh
  82. git-merge-recursive.py
  83. git-merge-resolve.sh
  84. git-merge-stupid.sh
  85. git-merge.sh
  86. git-mv.perl
  87. git-octopus.sh
  88. git-parse-remote.sh
  89. git-prune.sh
  90. git-pull.sh
  91. git-push.sh
  92. git-rebase.sh
  93. git-relink.perl
  94. git-repack.sh
  95. git-request-pull.sh
  96. git-reset.sh
  97. git-resolve.sh
  98. git-revert.sh
  99. git-send-email.perl
  100. git-sh-setup.sh
  101. git-shortlog.perl
  102. git-status.sh
  103. git-svnimport.perl
  104. git-tag.sh
  105. git-verify-tag.sh
  106. git-whatchanged.sh
  107. git.c
  108. git.spec.in
  109. gitk
  110. gitMergeCommon.py
  111. hash-object.c
  112. http-fetch.c
  113. http-push.c
  114. ident.c
  115. index-pack.c
  116. index.c
  117. init-db.c
  118. INSTALL
  119. local-fetch.c
  120. ls-files.c
  121. ls-tree.c
  122. mailinfo.c
  123. mailsplit.c
  124. Makefile
  125. merge-base.c
  126. merge-index.c
  127. mktag.c
  128. name-rev.c
  129. object.c
  130. object.h
  131. pack-check.c
  132. pack-objects.c
  133. pack-redundant.c
  134. pack.h
  135. patch-delta.c
  136. patch-id.c
  137. path.c
  138. peek-remote.c
  139. pkt-line.c
  140. pkt-line.h
  141. prune-packed.c
  142. quote.c
  143. quote.h
  144. read-cache.c
  145. read-tree.c
  146. README
  147. receive-pack.c
  148. refs.c
  149. refs.h
  150. rev-list.c
  151. rev-parse.c
  152. rsh.c
  153. rsh.h
  154. run-command.c
  155. run-command.h
  156. send-pack.c
  157. server-info.c
  158. setup.c
  159. sha1_file.c
  160. sha1_name.c
  161. shell.c
  162. show-branch.c
  163. show-index.c
  164. ssh-fetch.c
  165. ssh-pull.c
  166. ssh-push.c
  167. ssh-upload.c
  168. strbuf.c
  169. strbuf.h
  170. stripspace.c
  171. symbolic-ref.c
  172. tag.c
  173. tag.h
  174. tar-tree.c
  175. test-date.c
  176. test-delta.c
  177. tree-diff.c
  178. tree.c
  179. tree.h
  180. unpack-file.c
  181. unpack-objects.c
  182. update-index.c
  183. update-ref.c
  184. update-server-info.c
  185. upload-pack.c
  186. usage.c
  187. var.c
  188. verify-pack.c
  189. write-tree.c