Re: [PATCH 0/4 v4] WIP: allow "-" as a shorthand for "previous branch"
- From
Siddharth Kannan <kannan.siddharth12@gmail.com>
- Date
- Feb 16, 2017, 19:43 UTC
- Message-ID
- <CAN-3Qhok0WVZHBc-tFgTCNebGKRH87jPGe-rbRwTrsh1qLTfDQ@mail.gmail.com>
- In-Reply-To
- <xmqqinoax96u.fsf@gitster.mtv.corp.google.com>
Hey Junio and Matthieu,
On 17 February 2017 at 00:19, Junio C Hamano <gitster@pobox.com> wrote:
Show 29 quoted lines
> Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> writes:
>
>> Siddharth Kannan <kannan.siddharth12@gmail.com> writes:
>>
>>> This is as per our discussion[1]. The patches and commit messages are based on
>>> Junio's patches that were posted as a reply to
>>> <20170212184132.12375-1-gitster@pobox.com>.
>>>
>>> As per Matthieu's comments, I have updated the tests, but there is still one
>>> thing that is not working: log -@{yesterday} or log -@{2.days.ago}
>>
>> Note that I did not request that these things work, just that they seem
>> to be relevant tests: IMHO it's OK to reject them, but for example we
>> don't want them to segfault. And having a test is a good hint that you
>> thought about what could happen and to document it.
>
> The branch we were on before would be a ref, and the ref may know
> where it was yesterday? If @{-1}@{1.day} works it would be natural
> to expect -@{1.day} to, too, but there probably is some disambiguity
> or other reasons that they cannot or should not work that way I am
> missing, in which case it is fine ("too much work for too obscure
> feature that is not expected to be used often" is also an acceptable
> reason) to punt or deliberately not support it, as long as it is
> explained in the log and/or doc (future developers need to know if
> we are simply punting, or if we found a case where it would hurt end
> user experience if we supported the feature), and as long as it does
> not do a wrong thing (dying with "we do not support it" is OK,
> segfaulting or doing random other things is not).
>Right now, these commands die with an "fatal: unrecognized argument: -@{yesterday}" or a "fatal: unrecognized argument: -@{2.days.ago}". So, it is definitely not doing anything "random" :)
I will wait for consensus on whether these should or should not be supported.
-- Best Regards, - Siddharth.