Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

_fzf_git_hashes depends on awk implementation #17

Closed
jpalus opened this issue Sep 28, 2022 · 1 comment · Fixed by #18
Closed

_fzf_git_hashes depends on awk implementation #17

jpalus opened this issue Sep 28, 2022 · 1 comment · Fixed by #18

Comments

@jpalus
Copy link
Contributor

jpalus commented Sep 28, 2022

It appears that interval expressions ({<n>,<m>} as in /[a-f0-9]{7,}/) in AWK's regular expressions are somewhat fuzzy subject. Newer versions of gawk support it by default, older versions of gawk require additional option, mawk does not support them. Also see: https://www.gnu.org/software/gawk/manual/html_node/Interval-Expressions.html

In my system awk points to mawk hence hashes do not work. Would it be possible to either:

  1. Replace this single regex with /[a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9]*/ so it's compatible with all awk implementations (preferably)
  2. Or use gawk command instead of awk and require gawk >= 4.0
pld-gitsync pushed a commit to pld-linux/fzf that referenced this issue Sep 29, 2022
@junegunn
Copy link
Owner

  1. Replace this single regex with /[a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9]*/ so it's compatible with all awk implementations (preferably)

I'm okay with this approach. Can you open a pull request?

jpalus added a commit to jpalus/fzf-git.sh that referenced this issue Sep 29, 2022
Improve compatibility with more awk implementations like mawk or nawk by
changing interval expression (not supported in those variants) with
repetition. Even gawk which does support interval expressions, required
additional option to enable such support until version 4.0.

Fixes junegunn#17
junegunn pushed a commit that referenced this issue Sep 30, 2022
Improve compatibility with more awk implementations like mawk or nawk by
changing interval expression (not supported in those variants) with
repetition. Even gawk which does support interval expressions, required
additional option to enable such support until version 4.0.

Fixes #17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants