{"thread":{"id":"17967","subject":"[PATCH] adds --date=raw support to git blame and related documentation","startedAt":"2009-02-23T08:57:09Z","lastAt":"2009-02-24T01:35:20Z","messageCount":4,"participants":["eletuchy@gmail.com","Junio C Hamano","Eugene Letuchy"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"105885","messageId":"1235379429-20934-1-git-send-email-eletuchy@gmail.com","threadId":"17967","inReplyTo":null,"subject":"[PATCH] adds --date=raw support to git blame and related documentation","fromName":"","fromEmail":"eletuchy@gmail.com","sentAt":"2009-02-23T08:57:09Z","receivedAt":"2009-02-23T08:57:09Z","isPatch":true,"sender":{"key":"eletuchy@gmail.com","avatar":null},"body":"From: Eugene Letuchy <eugene@facebook.com>\n\nIn the wake of Linus' 7dff9b3, git blame --date support needs to\nincorporate --date=raw in addition to the previously supported\ndate formats.\n\nTest: > git grep relative | grep iso | grep -v raw\n      > git blame --date=raw builtin-blame.c\n\nSigned-off-by: Eugene Letuchy <eugene@facebook.com>\n---\n Documentation/blame-options.txt        |    4 ++--\n Documentation/config.txt               |    2 +-\n Documentation/git-rev-list.txt         |    2 +-\n builtin-blame.c                        |    6 +++++-\n contrib/completion/git-completion.bash |    2 +-\n 5 files changed, 10 insertions(+), 6 deletions(-)\n\ndiff --git a/Documentation/blame-options.txt b/Documentation/blame-options.txt\nindex e6717af..1316d4e 100644\n--- a/Documentation/blame-options.txt\n+++ b/Documentation/blame-options.txt\n@@ -36,7 +36,7 @@ of lines before or after the line given by <start>.\n \tShow long rev (Default: off).\n \n -t::\n-\tShow raw timestamp (Default: off).\n+\tSynomym for --date=raw (Default: off).\n \n -S <revs-file>::\n \tUse revs from revs-file instead of calling linkgit:git-rev-list[1].\n@@ -72,7 +72,7 @@ of lines before or after the line given by <start>.\n \n --date <format>::\n \tThe value is one of the following alternatives:\n-\t{relative,local,default,iso,rfc,short}. If --date is not\n+\t{relative,local,default,iso,rfc,short,raw}. If --date is not\n \tprovided, the value of the blame.date config variable is\n \tused. If the blame.date config variable is also not set, the\n \tiso format is used. For more information, See the discussion\ndiff --git a/Documentation/config.txt b/Documentation/config.txt\nindex f5152c5..f73d569 100644\n--- a/Documentation/config.txt\n+++ b/Documentation/config.txt\n@@ -1010,7 +1010,7 @@ interactive.singlekey::\n log.date::\n \tSet default date-time mode for the log command. Setting log.date\n \tvalue is similar to using 'git-log'\\'s --date option. The value is one of the\n-\tfollowing alternatives: {relative,local,default,iso,rfc,short}.\n+\tfollowing alternatives: {relative,local,default,iso,rfc,short,raw}.\n \tSee linkgit:git-log[1].\n \n log.showroot::\ndiff --git a/Documentation/git-rev-list.txt b/Documentation/git-rev-list.txt\nindex 1c9cc28..c226601 100644\n--- a/Documentation/git-rev-list.txt\n+++ b/Documentation/git-rev-list.txt\n@@ -35,7 +35,7 @@ SYNOPSIS\n \t     [ \\--regexp-ignore-case | -i ]\n \t     [ \\--extended-regexp | -E ]\n \t     [ \\--fixed-strings | -F ]\n-\t     [ \\--date={local|relative|default|iso|rfc|short} ]\n+\t     [ \\--date={local|relative|default|iso|rfc|short|raw} ]\n \t     [ [\\--objects | \\--objects-edge] [ \\--unpacked ] ]\n \t     [ \\--pretty | \\--header ]\n \t     [ \\--bisect ]\ndiff --git a/builtin-blame.c b/builtin-blame.c\nindex 48cedfd..bb0d20b 100644\n--- a/builtin-blame.c\n+++ b/builtin-blame.c\n@@ -2288,12 +2288,16 @@ parse_done:\n \tcase DATE_RELATIVE:\n \t\tblame_date_width = sizeof(\"14 minutes ago\");\n \t\tbreak;\n+\tcase DATE_RAW:\n+\t\tblame_date_width = sizeof(\"1235155266 -0800\");\n+\t\toutput_option |= OUTPUT_RAW_TIMESTAMP;\n+\t\tbreak;\n \tcase DATE_LOCAL:\n \tcase DATE_NORMAL:\n \t\tblame_date_width = sizeof(\"Thu Oct 19 16:00:04 2006 -0700\");\n \t\tbreak;\n \t}\n-\tblame_date_width -= 1; /* strip the null */\n+\tblame_date_width -= 1; /* strip the terminating null */\n \n \tif (DIFF_OPT_TST(&revs.diffopt, FIND_COPIES_HARDER))\n \t\topt |= (PICKAXE_BLAME_COPY | PICKAXE_BLAME_MOVE |\ndiff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\nindex 0a3092f..3454c1b 100755\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -1016,7 +1016,7 @@ _git_log ()\n \t\t;;\n \t--date=*)\n \t\t__gitcomp \"\n-\t\t\trelative iso8601 rfc2822 short local default\n+\t\t\trelative iso8601 rfc2822 short local default raw\n \t\t\" \"\" \"${cur##--date=}\"\n \t\treturn\n \t\t;;\n-- \n1.6.2.rc1.14.g07c3.dirty\n"},{"id":"105922","messageId":"7vprh9t6xt.fsf@gitster.siamese.dyndns.org","threadId":"17967","inReplyTo":"1235379429-20934-1-git-send-email-eletuchy@gmail.com","subject":"Re: [PATCH] adds --date=raw support to git blame and related documentation","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-02-23T17:10:54Z","receivedAt":"2009-02-23T17:10:54Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"eletuchy@gmail.com writes:\n\n> From: Eugene Letuchy <eugene@facebook.com>\n>\n> In the wake of Linus' 7dff9b3, git blame --date support needs to\n> incorporate --date=raw in addition to the previously supported\n> date formats.\n\nThanks, but I do not understand what you meant by the following two lines:\n\n> Test: > git grep relative | grep iso | grep -v raw\n>       > git blame --date=raw builtin-blame.c\n\nWith the patch to add --date=raw format already on 'master', I'd prefer a\nreroll of the original patch (it needs a fix for the config \"don't ignore\na misconfiguration\" bug Peff pointed out anyway) with this documentation\nupdate patch squashed in.\n\n> diff --git a/Documentation/blame-options.txt b/Documentation/blame-options.txt\n> index e6717af..1316d4e 100644\n> --- a/Documentation/blame-options.txt\n> +++ b/Documentation/blame-options.txt\n> @@ -36,7 +36,7 @@ of lines before or after the line given by <start>.\n>  \tShow long rev (Default: off).\n>  \n>  -t::\n> -\tShow raw timestamp (Default: off).\n> +\tSynomym for --date=raw (Default: off).\n\nThis is interesting.  It suggests that we should internally get rid of\nshow_raw_time variable (and need to error out when --date= and -t options\nare given at the same time, as they are mutually incompatible).\n\nBut do -t and --date=raw really behave identically?  I think they should\nbut I didn't check.\n\n> diff --git a/builtin-blame.c b/builtin-blame.c\n> index 48cedfd..bb0d20b 100644\n> --- a/builtin-blame.c\n> +++ b/builtin-blame.c\n> @@ -2288,12 +2288,16 @@ parse_done:\n>  \tcase DATE_RELATIVE:\n>  \t\tblame_date_width = sizeof(\"14 minutes ago\");\n>  \t\tbreak;\n> +\tcase DATE_RAW:\n> +\t\tblame_date_width = sizeof(\"1235155266 -0800\");\n> +\t\toutput_option |= OUTPUT_RAW_TIMESTAMP;\n> +\t\tbreak;\n\nI'd prefer it to see a same timestamp used consistently here.  You seem to\nhave used \"Thu, 19 Oct 2006 16:00:04 -0700\" for other case arms (I do not\nknow what significant things happened at that time) and what I queued in\n'pu' has sizeof(\"1161298804 -0700\") there instead.\n\n>  \tcase DATE_LOCAL:\n>  \tcase DATE_NORMAL:\n>  \t\tblame_date_width = sizeof(\"Thu Oct 19 16:00:04 2006 -0700\");\n>  \t\tbreak;\n>  \t}\n> -\tblame_date_width -= 1; /* strip the null */\n> +\tblame_date_width -= 1; /* strip the terminating null */\n\nThe character with byte value 0 is called NUL.\n\nThanks.\n"},{"id":"105925","messageId":"49A2E170.9030807@facebook.com","threadId":"17967","inReplyTo":"7vprh9t6xt.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] adds --date=raw support to git blame and related documentation","fromName":"Eugene Letuchy","fromEmail":"eletuchy@facebook.com","sentAt":"2009-02-23T17:48:32Z","receivedAt":"2009-02-23T17:48:32Z","isPatch":true,"sender":{"key":"eletuchy@facebook.com","avatar":null},"body":"On 2/23/09 9:10 AM, Junio C Hamano wrote:\n> eletuchy@gmail.com writes:\n>\n>> From: Eugene Letuchy<eugene@facebook.com>\n>>\n>> In the wake of Linus' 7dff9b3, git blame --date support needs to\n>> incorporate --date=raw in addition to the previously supported\n>> date formats.\n>\n> Thanks, but I do not understand what you meant by the following two lines:\n>\n>> Test:>  git grep relative | grep iso | grep -v raw\n>>        >  git blame --date=raw builtin-blame.c\n>\n> With the patch to add --date=raw format already on 'master', I'd prefer a\n> reroll of the original patch (it needs a fix for the config \"don't ignore\n> a misconfiguration\" bug Peff pointed out anyway) with this documentation\n> update patch squashed in.\n>\n\nYeah I can do that.\n\n>> diff --git a/Documentation/blame-options.txt b/Documentation/blame-options.txt\n>> index e6717af..1316d4e 100644\n>> --- a/Documentation/blame-options.txt\n>> +++ b/Documentation/blame-options.txt\n>> @@ -36,7 +36,7 @@ of lines before or after the line given by<start>.\n>>   \tShow long rev (Default: off).\n>>\n>>   -t::\n>> -\tShow raw timestamp (Default: off).\n>> +\tSynomym for --date=raw (Default: off).\n>\n> This is interesting.  It suggests that we should internally get rid of\n> show_raw_time variable (and need to error out when --date= and -t options\n> are given at the same time, as they are mutually incompatible).\n>\n> But do -t and --date=raw really behave identically?  I think they should\n> but I didn't check.\n>\n\nThe output of -t and --date=raw are exactly identical (well, after this patch \nthey are); for that reason, I think providing both is redundant but not an \nerror. However, I wanted to retain -t for \"git annotate\" compatibility, which \nhas -t as the sole date option. In git-annotate mode, no other --date mode \noptions can apply.\n\n>> diff --git a/builtin-blame.c b/builtin-blame.c\n>> index 48cedfd..bb0d20b 100644\n>> --- a/builtin-blame.c\n>> +++ b/builtin-blame.c\n>> @@ -2288,12 +2288,16 @@ parse_done:\n>>   \tcase DATE_RELATIVE:\n>>   \t\tblame_date_width = sizeof(\"14 minutes ago\");\n>>   \t\tbreak;\n>> +\tcase DATE_RAW:\n>> +\t\tblame_date_width = sizeof(\"1235155266 -0800\");\n>> +\t\toutput_option |= OUTPUT_RAW_TIMESTAMP;\n>> +\t\tbreak;\n>\n> I'd prefer it to see a same timestamp used consistently here.  You seem to\n> have used \"Thu, 19 Oct 2006 16:00:04 -0700\" for other case arms (I do not\n> know what significant things happened at that time) and what I queued in\n> 'pu' has sizeof(\"1161298804 -0700\") there instead.\n\nThu, 19 Oct 2006 16:00:04 -0700 is the date for the first line of builtin-blame.c\n1161298804 -0700 is fine by me.\n\n>\n>>   \tcase DATE_LOCAL:\n>>   \tcase DATE_NORMAL:\n>>   \t\tblame_date_width = sizeof(\"Thu Oct 19 16:00:04 2006 -0700\");\n>>   \t\tbreak;\n>>   \t}\n>> -\tblame_date_width -= 1; /* strip the null */\n>> +\tblame_date_width -= 1; /* strip the terminating null */\n>\n> The character with byte value 0 is called NUL.\n\nOK.\n\n>\n> Thanks.\n"},{"id":"105956","messageId":"7v3ae4pqg7.fsf@gitster.siamese.dyndns.org","threadId":"17967","inReplyTo":"49A2E170.9030807@facebook.com","subject":"Re: [PATCH] adds --date=raw support to git blame and related documentation","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-02-24T01:35:20Z","receivedAt":"2009-02-24T01:35:20Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Eugene Letuchy <eletuchy@facebook.com> writes:\n\n> On 2/23/09 9:10 AM, Junio C Hamano wrote:\n>> eletuchy@gmail.com writes:\n>>\n>>> From: Eugene Letuchy<eugene@facebook.com>\n>>>\n>>> In the wake of Linus' 7dff9b3, git blame --date support needs to\n>>> incorporate --date=raw in addition to the previously supported\n>>> date formats.\n>>\n>> Thanks, but I do not understand what you meant by the following two lines:\n>>\n>>> Test:>  git grep relative | grep iso | grep -v raw\n>>>        >  git blame --date=raw builtin-blame.c\n>>\n>> With the patch to add --date=raw format already on 'master', I'd prefer a\n>> reroll of the original patch (it needs a fix for the config \"don't ignore\n>> a misconfiguration\" bug Peff pointed out anyway) with this documentation\n>> update patch squashed in.\n>>\n>\n> Yeah I can do that.\n\nThanks.\n\n>>> diff --git a/Documentation/blame-options.txt b/Documentation/blame-options.txt\n>>> index e6717af..1316d4e 100644\n>>> --- a/Documentation/blame-options.txt\n>>> +++ b/Documentation/blame-options.txt\n>>> @@ -36,7 +36,7 @@ of lines before or after the line given by<start>.\n>>>   \tShow long rev (Default: off).\n>>>\n>>>   -t::\n>>> -\tShow raw timestamp (Default: off).\n>>> +\tSynomym for --date=raw (Default: off).\n>>\n>> This is interesting.  It suggests that we should internally get rid of\n>> show_raw_time variable (and need to error out when --date= and -t options\n>> are given at the same time, as they are mutually incompatible).\n>>\n>> But do -t and --date=raw really behave identically?  I think they should\n>> but I didn't check.\n>>\n>\n> The output of -t and --date=raw are exactly identical (well, after\n> this patch they are); for that reason, I think providing both is\n> redundant but not an error. However, I wanted to retain -t for \"git\n> annotate\" compatibility, which has -t as the sole date option. In\n> git-annotate mode, no other --date mode options can apply.\n\nOh, I didn't mean combination of -t and --date=raw.  Consider a\ncombination such as -t and --date=iso given together.\n\nThe removal of show_raw_time would be a good idea if -t and --date=raw\nare meant to be identical, right?\n"}]}