Re: git reflog --date

2014-11-04 Thread Phil Hord
On Tue, Oct 21, 2014 at 1:24 PM, Junio C Hamano  wrote:
> John Tapsell  writes:
>
>> Hi all,
>>
>>   Could we add a default to "--date" so that:
>>
>> git reflog --date
>>
>> just works?  (Currently you need to do:   git reflog --date=iso)  It
>> should probably obey the default in log.date?
>
> Hmph.  "--date=

Re: git reflog --date

2014-10-21 Thread Junio C Hamano
John Tapsell  writes:

> On 21 October 2014 19:06, Junio C Hamano  wrote:
>> John Tapsell  writes:
>>
>>> For me, writing "git reflog @{now}"  is a lot less intuitive than "git
>>> reflog --date"
>>>
>>> Currently the top google search for this question is here:
>>>
>>> http://stackoverflow.com/questions/17369254/is-there-a-way-to-cause-git-reflog-to-show-a-date-alongside-each-entry
>>>
>>> Which doesn't mention "@{now}"   at all.
>>
>> I would say that a site where cluelesses attempt to lead other
>> cluelesses is not the best source of information ;-), but that tells
>> us that either our docs are not read by people or they do not give
>> necessary information to them clearly enough.
>>
>>> My opinion:
>>>
>>> 1. Add --date   as an option to reflog.  Perhaps using the log.date
>>> format as the default.
>>> 2. Document --date in the man page for "git reflog"
>>> 3. Document @{now}  in the man page for "git reflog"
>>>
>>> Sound good?
>>
>> The order of changes is questionable, but other than that, I think
>> that would be a good way forward.
>
> Great - now I just need to persuade someone very nice nicely.. :-)

You should note that #1 is unworkable, as it would make:

$ git log -g --date default

ambiguous.  Is it asking the timed reflog output using log.date
format on the "default" branch, or is it asking the timed reflog
output using the "default" time format on the HEAD?

You would need to disambiguate by

$ git log -g --date -- default ;# on default branch
$ git log -g --date default -- ;# using default time format

or something, which means --date can be the last dashed option on
the command line, and also you close the door for us to ever add
another dashed command line option that takes an optional argument.

So the best you could do is

1. Add document commit@{timestamp} vs commit@{count} notation
   we have for "git log" also to "git reflog", perhaps?

2. Document --date=

Re: git reflog --date

2014-10-21 Thread Junio C Hamano
Junio C Hamano  writes:

> John Tapsell  writes:
>
>> For me, writing "git reflog @{now}"  is a lot less intuitive than "git
>> reflog --date"
>>
>> Currently the top google search for this question is here:
>>
>> http://stackoverflow.com/questions/17369254/is-there-a-way-to-cause-git-reflog-to-show-a-date-alongside-each-entry
>>
>> Which doesn't mention "@{now}"   at all.
>
> I would say that a site where cluelesses attempt to lead other
> cluelesses is not the best source of information ;-), but that tells
> us that either our docs are not read by people or they do not give
> necessary information to them clearly enough.

And it turns out it is a little bit of both.  We have this shown in
"git log --help":

-g::
--walk-reflogs::
...
By default, 'commit@\{Nth}' notation is
used in the output.  When the starting commit is specified as
'commit@\{now}', output also uses 'commit@\{timestamp}' notation
instead.

and "git reflog --help" says that "It is an alias for git log -g
--abbrev-commit --pretty=oneline; see git-log(1)." in fairly early
part of its description.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: git reflog --date

2014-10-21 Thread John Tapsell
Great - now I just need to persuade someone very nice nicely.. :-)

On 21 October 2014 19:06, Junio C Hamano  wrote:
> John Tapsell  writes:
>
>> For me, writing "git reflog @{now}"  is a lot less intuitive than "git
>> reflog --date"
>>
>> Currently the top google search for this question is here:
>>
>> http://stackoverflow.com/questions/17369254/is-there-a-way-to-cause-git-reflog-to-show-a-date-alongside-each-entry
>>
>> Which doesn't mention "@{now}"   at all.
>
> I would say that a site where cluelesses attempt to lead other
> cluelesses is not the best source of information ;-), but that tells
> us that either our docs are not read by people or they do not give
> necessary information to them clearly enough.
>
>> My opinion:
>>
>> 1. Add --date   as an option to reflog.  Perhaps using the log.date
>> format as the default.
>> 2. Document --date in the man page for "git reflog"
>> 3. Document @{now}  in the man page for "git reflog"
>>
>> Sound good?
>
> The order of changes is questionable, but other than that, I think
> that would be a good way forward.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: git reflog --date

2014-10-21 Thread Junio C Hamano
John Tapsell  writes:

> For me, writing "git reflog @{now}"  is a lot less intuitive than "git
> reflog --date"
>
> Currently the top google search for this question is here:
>
> http://stackoverflow.com/questions/17369254/is-there-a-way-to-cause-git-reflog-to-show-a-date-alongside-each-entry
>
> Which doesn't mention "@{now}"   at all.

I would say that a site where cluelesses attempt to lead other
cluelesses is not the best source of information ;-), but that tells
us that either our docs are not read by people or they do not give
necessary information to them clearly enough.

> My opinion:
>
> 1. Add --date   as an option to reflog.  Perhaps using the log.date
> format as the default.
> 2. Document --date in the man page for "git reflog"
> 3. Document @{now}  in the man page for "git reflog"
>
> Sound good?

The order of changes is questionable, but other than that, I think
that would be a good way forward.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: git reflog --date

2014-10-21 Thread John Tapsell
For me, writing "git reflog @{now}"  is a lot less intuitive than "git
reflog --date"

Currently the top google search for this question is here:

http://stackoverflow.com/questions/17369254/is-there-a-way-to-cause-git-reflog-to-show-a-date-alongside-each-entry

Which doesn't mention "@{now}"   at all.

My opinion:

1. Add --date   as an option to reflog.  Perhaps using the log.date
format as the default.
2. Document --date in the man page for "git reflog"
3. Document @{now}  in the man page for "git reflog"

Sound good?

John

On 21 October 2014 18:24, Junio C Hamano  wrote:
> John Tapsell  writes:
>
>> Hi all,
>>
>>   Could we add a default to "--date" so that:
>>
>> git reflog --date
>>
>> just works?  (Currently you need to do:   git reflog --date=iso)  It
>> should probably obey the default in log.date?
>
> Hmph.  "--date=

Re: git reflog --date

2014-10-21 Thread Junio C Hamano
John Tapsell  writes:

> Hi all,
>
>   Could we add a default to "--date" so that:
>
> git reflog --date
>
> just works?  (Currently you need to do:   git reflog --date=iso)  It
> should probably obey the default in log.date?

Hmph.  "--date=

git reflog --date

2014-10-21 Thread John Tapsell
Hi all,

  Could we add a default to "--date" so that:

git reflog --date

just works?  (Currently you need to do:   git reflog --date=iso)  It
should probably obey the default in log.date?

Also, could we add this "--date" option to the man page please?  It's
an extremely useful option to know.  At the moment you have to notice
the comment that "all normal log options" are there, and then try to
work it out from there etc.

Thank you,

John

John
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html