~emersion/mrsh-dev

Development discussion for mrsh.

You can setup your Git repository like so:

git config sendemail.to ~emersion/mrsh-dev@lists.sr.ht
1

Re: [PATCH] Add hash builtin.

Details
Message ID
<ImQHuszPupu9KzRmvbTamKE0YrTD1SIWhBQlMDsH4Qs1bJ_d5HrP8Q8cnQ2wXM3q-j2uJHYM8AaOHLXiJUHKg7dHF9GAL33_A2P3K-00Lpo=@emersion.fr>
Sender timestamp
1558196564
DKIM signature
pass
Download raw message
Gah, sorry for the long delay again. For unknown reasons I haven't
received this patch at all (Drew hasn't received it either).

Thanks for the patch! The main issue so far is that… hash isn't that
well-specified. For instance:

- The stdout format isn't specified
- A shell is free not to remember paths

So we need to be careful when writing tests.

Other than that, we need to reset the hashtable when PATH is set. We
also need to handle the case in which a previously remembered path
doesn't exist anymore. I wonder if there are more situations like this.

All in all, I wonder if it's worth it to support hash at all. We could
simply have a dumb implementation that always reports nothing (since
the format isn't specified, this is okay) and never saves anything.
Then we could do some benchmarks and see if it's really worth it to add
it.

What do you think?

Re: [PATCH] Add hash builtin.

Details
Message ID
<zq99R3Go1LGprrPaV3rfZRpQzMlCYtXhFcTWKFTJB9cKKCzvEz9YWCeWK0vB5IwsKB2DNOMA0hVdhWjHBACutMjMJNGfy09VHe9Y1u4nzbA=@protonmail.com>
In-Reply-To
<ImQHuszPupu9KzRmvbTamKE0YrTD1SIWhBQlMDsH4Qs1bJ_d5HrP8Q8cnQ2wXM3q-j2uJHYM8AaOHLXiJUHKg7dHF9GAL33_A2P3K-00Lpo=@emersion.fr> (view parent)
Sender timestamp
1558727771
DKIM signature
pass
Download raw message
On Saturday 18 May 2019 18:22, Simon Ser <contact@emersion.fr> wrote:
    

>     All in all, I wonder if it's worth it to support hash at all. We could
>     simply have a dumb implementation that always reports nothing (since
>     the format isn't specified, this is okay) and never saves anything.
>     Then we could do some benchmarks and see if it's really worth it to add
>     it.
>     

>     What do you think?
Maybe we can keep the output just to act like dash or others but
don't use it when we want to exec some command.
And if we have some valuable benchmarks and all the case are
handled we can use it.
But when I think about it I wonder if the speed we can gain
worth the trouble.