[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Wget-dev] wget2 | Refined commit-check (!375)
From: |
Tsukasa OI |
Subject: |
Re: [Wget-dev] wget2 | Refined commit-check (!375) |
Date: |
Fri, 04 May 2018 08:29:30 +0000 |
Tsukasa OI commented on a discussion on contrib/commit-check:
>
> AUTHOR=$(git log -n1 --format='%aN')
> EMAIL=$(git log -n1 --format='%aE')
> -EMAIL_PARSE=$(echo "$EMAIL" | sed 's/@/ \\[at\\] /g')
> +EMAIL_PARSE=$(echo "$EMAIL" | sed 's/@/ [at] /g')
> +EMAIL_PARSE_PAT=$(echo "$EMAIL_PARSE" | sed 's/\[/\\[/g;s/\]/\\]/g')
My first revision did like this:
```sh
EMAIL_PARSE=$(echo "$EMAIL" | sed 's/@/ \[at\] /g') # regex
EMAIL_PARSE2=$(echo "$EMAIL" | sed 's/@/ [at] /g') # plain string to display
```
but I thought making relation between string and regex (generate string then
create regex based on the generated string) would be better. This way, we can
easily understand that `$EMAIL_PARSE_PAT` is a regex based on `$EMAIL_PARSE`
(line to generate `$EMAIL_PARSE_PAT` becomes a bit obscure as you pointed out).
If we want to make email match pattern stricter (e.g. make `.` [string] to `\.`
[regex]), we only need to change line 9 (`EMAIL_PARSE_PAT=...`).
---
Reply to this email directly or view it on GitLab:
https://gitlab.com/gnuwget/wget2/merge_requests/375#note_71578902
You're receiving this email because of your account on gitlab.com.
Message not available
Message not available
Message not available
Message not available