-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Test(git-authors): add unit test #1088
Comments
Is it relative to 47e9402? It is weird as BTW,
|
@spacewander Yes, it does look up the file in the current directory, because that was the behavior previously before I changed it. Maybe it's worth changing it to look up the file relative to the Git worktree root. I tested the command on Linux and it works, so maybe there is a difference From
> find -regextype help
find: Unknown regular expression type ‘help’; valid types are ‘findutils-default’, ‘ed’, ‘emacs’, ‘gnu-awk’, ‘grep’, ‘posix-awk’, ‘awk’, ‘posix-basic’, ‘posix-egrep’, ‘egrep’, ‘posix-extended’, ‘posix-minimal-basic’, ‘sed’. For example, it could be that the functionality for Emacs Regular Expressions is dynamically loaded, and the library is installed in most Linux distros, but not macOS, so on macOS maybe uses Extended Regular Expressions by default (which doesn't require escaping the end or close capture group syntax). |
Now that I think about it, I remember previously running into errors on macOS where Bash regular expressions behaved differently than compared to Linux. I don't know exactly which libraries or versions is used to interpret the regular expression (BRE, ERE). |
I wonder if changing the line to I didn't set |
alright, it looks a history here and I think there is no more bad effect for the user work with |
It doesn't work with the BSD find, which is the
|
@hyperupcall |
changelog="$(find -E . -mindepth 1 -maxdepth 1 -iregex '.*(change|history).*' | head -n1)" I'm actually thinking... it would be better not to use regular expressions. The -o expression is specified by POSIX even: find . -mindepth 1 -maxdepth 1 \( -iname '*change*' -o -iname '*history*' \) |
I have made #1094, which should fix this |
I recommand to transform the case 1 and 2 to below:
because the empty argument means update a file or output something to a file but the arguments else did not work with it. It does not make sense. |
Agree to provide an argument to specify the output manually is better. Also, we need to keep the compatibility with the old behavior. |
copy that. Finally, i can generate the usecases lol. |
File
git-authors
git-authors
has a weird behavior that invoke the command directly withoutAUTHORS
or target file and the result will be insert into thegit-authors
file, then open it via the default editor. Take a look here. I don't think it a good case to use the command.Testcases
AUTHORS
file with invoking directly.insert the authors information in the target file when invoking it with a parameter.update with another PR.There is no the function which open the authors file via the default editor any more.
References
The text was updated successfully, but these errors were encountered: