{"thread":{"id":"5420","subject":"What's in git.git","startedAt":"2006-08-28T07:19:36Z","lastAt":"2006-08-28T13:52:13Z","messageCount":2,"participants":["Junio C Hamano","Jonas Fonseca"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"26034","messageId":"7vodu5qqd3.fsf@assigned-by-dhcp.cox.net","threadId":"5420","inReplyTo":null,"subject":"What's in git.git","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-08-28T07:19:36Z","receivedAt":"2006-08-28T07:19:36Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"This is CC'ed to the kernel list as well because the \"master\"\nupdate is rather large.\n\nOn the \"maint\" front, I've been wanting to cut 1.4.2.1 for some\ntime, but various time constraints prevented me doing so so far.\nI have a vague suspicion that 1.4.3 might happen before that.\n\nAlso I have been sort-of waiting for the x86-32 machine at\nkernel.org to become available again so that I can do an RPM for\nend users, which unfortunately hasn't happened yet.\n\n* The 'maint' branch has these fixes since the last announcement.\n\n   Johannes Schindelin:\n      git-mv: special case destination \".\"\n      git-mv: fix off-by-one error\n      builtin-mv: readability patch\n\n* The 'master' branch has these since the last announcement.\n\n  - Johannes's reimplementation of merge-recursive in C is in\n    'master' for early adopter testing.  Currently it is called\n    'merge-recur', so you either (1) invoke it explicitly with\n    the -s option to 'git pull' and/or 'git merge', or (2) have\n    an environment variable GIT_USE_RECUR_FOR_RECURSIVE set to\n    non-empty string, in which case places that call\n    'git-merge-recursive' would use 'git-merge-recur' instead.\n\n    This has been tested in 'next' for some time, and Johannes\n    ran tests to reproduce all merges in post 2.6.12-rc2 kernel\n    history to validate it produces the same result as the\n    current merge-recursive.  The only difference is that it is\n    about 6x-10x faster and you do not have to have Python\n    installed.\n\n    I intend to retire the current merge-recursive.py and\n    replace it with merge-recur before 1.4.3 happens.\n\n  - Various calls to memcmp/memcpy/memset with length '20' to\n    compare, copy and clear object names have been abstracted\n    out to hashcmp/hashcpy/hashclr wrappers, spearheaded by\n    David Rientjes.  This would make it easier to migrate the\n    code to hashes of other lengths if it is ever needed.\n\n    Obviously migrating the existing data is another story.\n\n  - Updates to git-svn by Eric Wong.\n\n  - git-apply can be given --reject to produce *.rej files,\n    instead of failing the whole patch atomically.  It also can\n    be given --verbose to report what it is doing.\n\n  - Rene Scharfe helped git-tar-tree find its soulmate\n    git-zip-tree.\n\n  - Tilman Sauerbeck taught git-daemon to setuid/setgid before\n    serving the clients.\n\n  - Various small fixes and clean-ups by Haavard Skinnemoen, Jakub\n    Narebski, Jonas Fonseca, Pierre Habouzit, Rene Scharfe,\n    Shawn Pearce, and Tilman Sauerbeck.\n\n  - Various documentation clean-ups by Jonas Fonseca, and Rene\n    Scharfe.\n\n  - The internal is readied to be able to say \"32 hours ago\" in\n    \"git log\" and friends by Linus; we do not have an UI to\n    enable it yet.\n\n\n* The 'next' branch, in addition, has these.\n\n  - Various gitweb updates by Jakub Narebski with help from\n    Aneesh Kumar, Luben Tuikov, and Martin Waitz.  The most\n    attractive thing these updates have is that we finally got\n    rid of having to use temporary files to show diffs.\n\n    I'd like to push this out to \"master\" soonish.  You can get\n    a taste of how it works at the site Jakub maintains\n\n\thttp://front.fuw.edu.pl/cgi-bin/jnareb/gitweb.cgi\n\n  - Git.pm by Pasky with help from Dennis Stosberg, Eric Wong,\n    Johannes, and Pavel Roskin.  During the next round I'd like\n    to push this out to \"master\" to see who screams ;-).\n\n  - upload-pack has a bit of updates still held back.\n\n  - git-daemon is taught to optionally serve git-tar-tree\n    output.\n\n\n* In the 'pu' branch, I have my WIP of a library to walk the\n  index, the working tree, and zero or more tree objects in\n  parallel.  Its test program does something that vaguely looks\n  like diff-index with and without --cached in parallel, but it\n  is not polished enough for public testing/consumption yet.\n"},{"id":"26044","messageId":"20060828135213.GB32266@diku.dk","threadId":"5420","inReplyTo":"7vodu5qqd3.fsf@assigned-by-dhcp.cox.net","subject":"[PATCH] Add --relative-date option to the revision interface","fromName":"Jonas Fonseca","fromEmail":"fonseca@diku.dk","sentAt":"2006-08-28T13:52:13Z","receivedAt":"2006-08-28T13:52:13Z","isPatch":true,"sender":{"key":"fonseca@diku.dk","avatar":"https://gravatar.com/avatar/f82f3ad698717c51873b020c750a92438c820a24056dc39fe4d07baa10a92264?d=mp&s=160"},"body":"Exposes the infrastructure from 9a8e35e98793af086f05d1ca9643052df9b44a74.\n\nSigned-off-by: Jonas Fonseca <fonseca@diku.dk>\n---\n\nJunio C Hamano <junkio@cox.net> wrote Mon, Aug 28, 2006:\n>   - The internal is readied to be able to say \"32 hours ago\" in\n>     \"git log\" and friends by Linus; we do not have an UI to\n>     enable it yet.\n\nSince nobody else has posted a patch, here is one.\n\n Documentation/git-rev-list.txt |    5 +++++\n builtin-rev-list.c             |    2 +-\n builtin-show-branch.c          |    2 +-\n commit.c                       |   20 ++++++++++++++------\n commit.h                       |    2 +-\n log-tree.c                     |    4 +++-\n revision.c                     |    4 ++++\n revision.h                     |    3 ++-\n 8 files changed, 31 insertions(+), 11 deletions(-)\n\ndiff --git a/Documentation/git-rev-list.txt b/Documentation/git-rev-list.txt\nindex dd9fff1..a446a6b 100644\n--- a/Documentation/git-rev-list.txt\n+++ b/Documentation/git-rev-list.txt\n@@ -128,6 +128,11 @@ OPTIONS\n \tAfter a failed merge, show refs that touch files having a\n \tconflict and don't exist on all heads to merge.\n \n+--relative-date::\n+\tShow dates relative to the current time, e.g. \"2 hours ago\".\n+\tOnly takes effect for dates shown in human-readable format,\n+\tsuch as when using \"--pretty\".\n+\n Author\n ------\n Written by Linus Torvalds <torvalds@osdl.org>\ndiff --git a/builtin-rev-list.c b/builtin-rev-list.c\nindex bc48a3e..ac648e9 100644\n--- a/builtin-rev-list.c\n+++ b/builtin-rev-list.c\n@@ -85,7 +85,7 @@ static void show_commit(struct commit *c\n \t\tstatic char pretty_header[16384];\n \t\tpretty_print_commit(revs.commit_format, commit, ~0,\n \t\t\t\t    pretty_header, sizeof(pretty_header),\n-\t\t\t\t    revs.abbrev, NULL, NULL);\n+\t\t\t\t    revs.abbrev, NULL, NULL, revs.relative_date);\n \t\tprintf(\"%s%c\", pretty_header, hdr_termination);\n \t}\n \tfflush(stdout);\ndiff --git a/builtin-show-branch.c b/builtin-show-branch.c\nindex 18786f8..d7de18e 100644\n--- a/builtin-show-branch.c\n+++ b/builtin-show-branch.c\n@@ -261,7 +261,7 @@ static void show_one_commit(struct commi\n \tstruct commit_name *name = commit->util;\n \tif (commit->object.parsed)\n \t\tpretty_print_commit(CMIT_FMT_ONELINE, commit, ~0,\n-\t\t\t\t    pretty, sizeof(pretty), 0, NULL, NULL);\n+\t\t\t\t    pretty, sizeof(pretty), 0, NULL, NULL, 0);\n \telse\n \t\tstrcpy(pretty, \"(unavailable)\");\n \tif (!strncmp(pretty, \"[PATCH] \", 8))\ndiff --git a/commit.c b/commit.c\nindex 307883f..3f4bc31 100644\n--- a/commit.c\n+++ b/commit.c\n@@ -482,7 +482,8 @@ static int add_rfc2047(char *buf, const \n \treturn bp - buf;\n }\n \n-static int add_user_info(const char *what, enum cmit_fmt fmt, char *buf, const char *line)\n+static int add_user_info(const char *what, enum cmit_fmt fmt, char *buf,\n+\t\t\t const char *line, int relative_date)\n {\n \tchar *date;\n \tint namelen;\n@@ -522,14 +523,16 @@ static int add_user_info(const char *wha\n \t}\n \tswitch (fmt) {\n \tcase CMIT_FMT_MEDIUM:\n-\t\tret += sprintf(buf + ret, \"Date:   %s\\n\", show_date(time, tz, 0));\n+\t\tret += sprintf(buf + ret, \"Date:   %s\\n\",\n+\t\t\t       show_date(time, tz, relative_date));\n \t\tbreak;\n \tcase CMIT_FMT_EMAIL:\n \t\tret += sprintf(buf + ret, \"Date: %s\\n\",\n \t\t\t       show_rfc2822_date(time, tz));\n \t\tbreak;\n \tcase CMIT_FMT_FULLER:\n-\t\tret += sprintf(buf + ret, \"%sDate: %s\\n\", what, show_date(time, tz, 0));\n+\t\tret += sprintf(buf + ret, \"%sDate: %s\\n\", what,\n+\t\t\t       show_date(time, tz, relative_date));\n \t\tbreak;\n \tdefault:\n \t\t/* notin' */\n@@ -572,7 +575,10 @@ static int add_merge_info(enum cmit_fmt \n \treturn offset;\n }\n \n-unsigned long pretty_print_commit(enum cmit_fmt fmt, const struct commit *commit, unsigned long len, char *buf, unsigned long space, int abbrev, const char *subject, const char *after_subject)\n+unsigned long pretty_print_commit(enum cmit_fmt fmt, const struct commit *commit,\n+\t\t\t\t  unsigned long len, char *buf, unsigned long space,\n+\t\t\t\t  int abbrev, const char *subject,\n+\t\t\t\t  const char *after_subject, int relative_date)\n {\n \tint hdr = 1, body = 0;\n \tunsigned long offset = 0;\n@@ -661,12 +667,14 @@ unsigned long pretty_print_commit(enum c\n \t\t\tif (!memcmp(line, \"author \", 7))\n \t\t\t\toffset += add_user_info(\"Author\", fmt,\n \t\t\t\t\t\t\tbuf + offset,\n-\t\t\t\t\t\t\tline + 7);\n+\t\t\t\t\t\t\tline + 7,\n+\t\t\t\t\t\t\trelative_date);\n \t\t\tif (!memcmp(line, \"committer \", 10) &&\n \t\t\t    (fmt == CMIT_FMT_FULL || fmt == CMIT_FMT_FULLER))\n \t\t\t\toffset += add_user_info(\"Commit\", fmt,\n \t\t\t\t\t\t\tbuf + offset,\n-\t\t\t\t\t\t\tline + 10);\n+\t\t\t\t\t\t\tline + 10,\n+\t\t\t\t\t\t\trelative_date);\n \t\t\tcontinue;\n \t\t}\n \ndiff --git a/commit.h b/commit.h\nindex 779ed82..fc13de9 100644\n--- a/commit.h\n+++ b/commit.h\n@@ -52,7 +52,7 @@ enum cmit_fmt {\n };\n \n extern enum cmit_fmt get_commit_format(const char *arg);\n-extern unsigned long pretty_print_commit(enum cmit_fmt fmt, const struct commit *, unsigned long len, char *buf, unsigned long space, int abbrev, const char *subject, const char *after_subject);\n+extern unsigned long pretty_print_commit(enum cmit_fmt fmt, const struct commit *, unsigned long len, char *buf, unsigned long space, int abbrev, const char *subject, const char *after_subject, int relative_date);\n \n /** Removes the first commit from a list sorted by date, and adds all\n  * of its parents.\ndiff --git a/log-tree.c b/log-tree.c\nindex 031af88..54cdaa4 100644\n--- a/log-tree.c\n+++ b/log-tree.c\n@@ -194,7 +194,9 @@ void show_log(struct rev_info *opt, cons\n \t/*\n \t * And then the pretty-printed message itself\n \t */\n-\tlen = pretty_print_commit(opt->commit_format, commit, ~0u, this_header, sizeof(this_header), abbrev, subject, extra_headers);\n+\tlen = pretty_print_commit(opt->commit_format, commit, ~0u, this_header,\n+\t\t\t\t  sizeof(this_header), abbrev, subject,\n+\t\t\t\t  extra_headers, opt->relative_date);\n \n \tif (opt->add_signoff)\n \t\tlen = append_signoff(this_header, sizeof(this_header), len,\ndiff --git a/revision.c b/revision.c\nindex 1d89d72..b588f74 100644\n--- a/revision.c\n+++ b/revision.c\n@@ -816,6 +816,10 @@ int setup_revisions(int argc, const char\n \t\t\t\trevs->simplify_history = 0;\n \t\t\t\tcontinue;\n \t\t\t}\n+\t\t\tif (!strcmp(arg, \"--relative-date\")) {\n+\t\t\t\trevs->relative_date = 1;\n+\t\t\t\tcontinue;\n+\t\t\t}\n \t\t\topts = diff_opt_parse(&revs->diffopt, argv+i, argc-i);\n \t\t\tif (opts > 0) {\n \t\t\t\trevs->diff = 1;\ndiff --git a/revision.h b/revision.h\nindex 0c3b8d9..d289781 100644\n--- a/revision.h\n+++ b/revision.h\n@@ -55,7 +55,8 @@ struct rev_info {\n \n \t/* Format info */\n \tunsigned int\tshown_one:1,\n-\t\t\tabbrev_commit:1;\n+\t\t\tabbrev_commit:1,\n+\t\t\trelative_date:1;\n \tunsigned int\tabbrev;\n \tenum cmit_fmt\tcommit_format;\n \tstruct log_info *loginfo;\n-- \n1.4.2.g6e47-dirty\n\n-- \nJonas Fonseca\n"}]}