* Re: [PATCH v19 00/10] imap-send: make it usable again and add OAuth2.0 support
From: Junio C Hamano @ 2025-06-23 16:27 UTC (permalink / raw)
To: Phillip Wood
Cc: Aditya Garg, git, Eric Sunshine, Zi Yao, brian m . carlson,
Jeff King, Ben Knoble
In-Reply-To: <c787a41c-97c6-437f-aae0-52132c79db7c@gmail.com>
Phillip Wood <phillip.wood123@gmail.com> writes:
> On 20/06/2025 16:50, Junio C Hamano wrote:
>> Aditya Garg <gargaditya08@live.com> writes:
>>
>>> v19: - Use xstrfmt() for OAuth2 strings and strbuf for PLAIN.
>>>
>>> Aditya Garg (10):
>>> imap-send: fix bug causing cfg->folder being set to NULL
>>> imap-send: fix memory leak in case auth_cram_md5 fails
>>> imap-send: gracefully fail if CRAM-MD5 authentication is requested
>>> without OpenSSL
>>> imap-send: add support for OAuth2.0 authentication
>>> imap-send: add PLAIN authentication method to OpenSSL
>>> imap-send: enable specifying the folder using the command line
>>> imap-send: add ability to list the available folders
>>> imap-send: display port alongwith host when git credential is invoked
>>> imap-send: display the destination mailbox when sending a message
>>> imap-send: fix minor mistakes in the logs
>>>
>>> Documentation/config/imap.adoc | 11 +-
>>> Documentation/git-imap-send.adoc | 68 +++++-
>>> imap-send.c | 405 ++++++++++++++++++++++++++-----
>>> 3 files changed, 407 insertions(+), 77 deletions(-)
>> Looking good. Will replace.
>> Should we declare victory and mark the topic for 'next' now?
>
> I think so, the range diff looks good. I've not reviewed each patch
> but I just had a quick scan of
>
> git diff origin/master origin/seen imap-send.c
>
> and it looked reasonable.
>
> Best Wishes
>
> Phillip
Thanks.
^ permalink raw reply
* Re: .clang-format: how useful, how often used, and how well maintained?
From: Junio C Hamano @ 2025-06-23 16:26 UTC (permalink / raw)
To: Karthik Nayak; +Cc: git, Patrick Steinhardt, René Scharfe
In-Reply-To: <CAOLa=ZSuEAwj==9+B-nYikyQtOxREf8ZEfJ9L_YxU8yU0ro-zA@mail.gmail.com>
Karthik Nayak <karthik.188@gmail.com> writes:
>> For that, there are a few things we'd probably need to do:
>>
>> - Improve our tooling so that the develper can check a range of
>> commits they made before running format-patch, and other
>> situations.
>>
>> - Improve .clang-format rules to reduce false positives.
>>
>
> I think the biggest issue for this is around line wrapping, I'm
> considering just removing it from the '.clang-format'. Perhaps we could
> add it to our '.editorconfig'?
I would not stop others from trying to improve the rules in such a
way that only an overly long lines (like >120 columns) are folded to
reasonable length (line ~72 columns) without doing anything else
(like not concatenating adjacent lines only because the result would
be shorter than 80 columns), but if it is more involved than we can
manage, removing it from .clang-format so that "make style" would
not use would be the best (or "the least bad") approach.
^ permalink raw reply
* [PATCH v2] coccicheck: fail "make" when it fails
From: Junio C Hamano @ 2025-06-23 16:14 UTC (permalink / raw)
To: git; +Cc: Jeff King, Carlo Marcelo Arenas Belón, Eric Sunshine
In-Reply-To: <xmqqwm97bv7c.fsf@gitster.g>
With "make coccicheck", we generate contrib/coccinelle/*.cocci.patch
files that contain changes suggested by semantic patches, but "make"
succeeds. Admittedly, not many developers may run "make coccicheck"
in the first place, but it makes it harder to notice when they do
run it after they introduced an iffy piece of code.
Check that the resulting cocci.patch files are all empty.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
Makefile | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
index 97e8385b66..8f1e9424a7 100644
--- a/Makefile
+++ b/Makefile
@@ -3422,11 +3422,14 @@ endif
coccicheck-test: $(COCCI_TEST_RES_GEN)
coccicheck: coccicheck-test
+
ifdef SPATCH_CONCAT_COCCI
-coccicheck: contrib/coccinelle/ALL.cocci.patch
+COCCICHECK_PATCH_MUST_BE_EMPTY_FILES = contrib/coccinelle/ALL.cocci.patch
else
-coccicheck: $(COCCICHECK_PATCHES_INTREE)
+COCCICHECK_PATCH_MUST_BE_EMPTY_FILES = $(COCCICHECK_PATCHES_INTREE)
endif
+coccicheck: $(COCCICHECK_PATCH_MUST_BE_EMPTY_FILES)
+ ! grep -q ^ $(COCCICHECK_PATCH_MUST_BE_EMPTY_FILES) /dev/null
# See contrib/coccinelle/README
coccicheck-pending: coccicheck-test
Range-diff against v1:
1: 163a63f2cf ! 1: dee873e931 coccicheck: fail "make" when it fails
@@ Commit message
Signed-off-by: Junio C Hamano <gitster@pobox.com>
## Makefile ##
-@@ Makefile: coccicheck-test: $(COCCI_TEST_RES_GEN)
+@@ Makefile: endif
+ coccicheck-test: $(COCCI_TEST_RES_GEN)
+
coccicheck: coccicheck-test
++
ifdef SPATCH_CONCAT_COCCI
- coccicheck: contrib/coccinelle/ALL.cocci.patch
-+ ! test -s contrib/coccinelle/ALL.cocci.patch
+-coccicheck: contrib/coccinelle/ALL.cocci.patch
++COCCICHECK_PATCH_MUST_BE_EMPTY_FILES = contrib/coccinelle/ALL.cocci.patch
else
- coccicheck: $(COCCICHECK_PATCHES_INTREE)
-+ test $$(cat $(COCCICHECK_PATCHES_INTREE) | wc -c) = 0
+-coccicheck: $(COCCICHECK_PATCHES_INTREE)
++COCCICHECK_PATCH_MUST_BE_EMPTY_FILES = $(COCCICHECK_PATCHES_INTREE)
endif
++coccicheck: $(COCCICHECK_PATCH_MUST_BE_EMPTY_FILES)
++ ! grep -q ^ $(COCCICHECK_PATCH_MUST_BE_EMPTY_FILES) /dev/null
# See contrib/coccinelle/README
+ coccicheck-pending: coccicheck-test
--
2.50.0-243-g67b26bc0ed
^ permalink raw reply related
* Re: [PATCH 2/2] test-lib: teach test_seq the -f option
From: Junio C Hamano @ 2025-06-23 16:10 UTC (permalink / raw)
To: Jeff King; +Cc: git
In-Reply-To: <20250623105625.GB654412@coredump.intra.peff.net>
Jeff King <peff@peff.net> writes:
> The "seq" tool has a "-f" option to produce printf-style formatted
> lines. Let's teach our test_seq helper the same trick. This lets us get
> rid of some shell loops in test snippets (which are particularly verbose
> in our test suite because we have to "|| return 1" to keep the &&-chain
> going).
>
> This converts a few call-sites I found by grepping around the test
> suite. A few notes on these:
>
> - In "seq", the format specifier is a "%g" float. Since test_seq only
> supports integers, I've kept the more natural "%d" (which is what
> these call sites were using already).
Yeah, that was the first thing I started wondering about after
learning that "seq --format" is a thing.
> - Like "seq", test_seq automatically adds a newline to the specified
> format. This is what all callers are doing already except for t0021,
> but there we do not care about the exact format. We are just trying
> to printf a large number of bytes to a file. It's not worth
> complicating other callers or adding an option to avoid the newline
> in that caller.
OK. Other than the newline, the update to t0021 changes the actual
payload used in the test, but it does not affect the characteristic
of the data (like how compressible the result is) all that much, I
think.
> - Most conversions are just replacing a shell loop (which does get rid
> of an extra fork, since $() requires a subshell). In t0612 we can
> replace an awk invocation, which I think makes the end result more
> readable, as there's less quoting.
;-)
> - In t7422 we can replace one loop, but sadly we have to leave the
> loop directly above it. This is because that earlier loop wants to
> include the seq value twice in the output, which test_seq does not
> support (nor does regular seq). If you run:
>
> test_seq -f "foo-%d %d" 10
>
> the second "%d" will always be the empty string. You might naively
> think that test_seq could add some extra arguments, like:
>
> # 3 ought to be enough for anyone...
> printf "$fmt\n" "$i "$i" $i"
>
> but that just triggers printf to format multiple lines, one per
> extra set of arguments.
>
> So we'd have to actually parse the format string, figure out how
> many "%" placeholders are there, and then feed it that many
> instances of the sequence number. The complexity isn't worth it.
And it would deviate from the normal "seq", which would contaminate
our developers' mind, which is not a direction worth going.
The changes look all good.
Thanks.
^ permalink raw reply
* Re: repository maintenance: git prints warning messages while cloning https://github.com/git/git.git
From: Junio C Hamano @ 2025-06-23 15:31 UTC (permalink / raw)
To: Jeff King; +Cc: kryzet, git
In-Reply-To: <20250623103550.GA649507@coredump.intra.peff.net>
Jeff King <peff@peff.net> writes:
> You can safely ignore them, but if you want to quiet the noise you can
> put:
>
> [fetch "fsck"]
> badFileMode = ignore
> missingTaggerEntry = ignore
>
> in your ~/.gitconfig file.
Very true for people who do not have much control in what objects
are added to the project, but for narrow audiences who hack on Git,
it is not advisable to use for in a repository where you are adding
new objects, using versions of Git you are experimenting with. With
these configuration, problems in these two classes in your new
objects will also be ignored.
Listing names of these objects in a file and pointing it with the
fsck.skiplist configuration variable is more involved but exempts
the listed old-and-known-to-have-known-kind-of-funnies while
noticing if you add more bad objects. If I am counting correctly,
we have only one bad tag, with 98 bad trees.
Curiously, "git ls-tree 10344b81045" (just picked a random tree
object from the list) does not show any bad modes, as the code
normalizes the mode bits while reading. "git cat-file -t tree"
can of course show the badness on the same object.
$ git config --set fsck.skiplist .git/objects/info/fsck-skip
$ cat <<\EOF >.git/objects/info/fsck-skip
0323c14ecfac54b060a52ef54b9ea38377adede0
0776ebe16d603a16a3540ae78504abe6b0920ac0
07c2d8f92d55b9ab885c10bfa862e652dcc40ee5
0965df45db7cf28dba93b554bdf26b61e8b950f7
09c369f30a7ec350dc98496c5cb752280f6dfe51
0ba51186089993112337d5b34a9ee23fe7cf4fdb
0e70cb482c7d76069b93da00d3fac97526b9aeee
0ff673eb3c120d8d2f2c327e7a772f2e4f902809
10344b81045df0a2cea3e76d325df5156c0294ab
10b554bd1513e33b7054c02eba9cda69bc29e187
18e4bb98e1e685dfdd798048ada57c925ee87aee
192f84588c8e47a2d8ca3d0c6e50641b7a2491b8
1e474a8671630eca49f3a94145045903a22ffed1
2031abe6fdaa115800eb0c5cd66ebf265d17b3c3
2660be985a85b5a96b9de69050375ac5e436c957
26f176413928139d69d2249c78f24d7be4b0d9fd
298e5d544d67bcc11e95aa6b04f1069a9cd959e6
2b5bfdf7798569e0b59b16eb9602d5fa572d6038
2ce9f0ac1f9d9035ec6ca90ec4f3922a127c6c02
314297184c51fc558a83b8701a83f28a0e740d7a
31f24db6e3e3f70191d95bbe7a06a2b1bb711d99
364de08062838733978d41da581fcdbb73c4f1b9
3d00c15360e1aea2a51558e5f56b95d11e9d7010
3f703cd0cd32a4aa9892bda84c664c36e40f7921
406548bda4dfb72566db6e515e38604a7641ec15
41bcaba0309c151fb38f82135d9b011e2066d130
41fa9643de0044c75ac654ab2dd2319f1bf3b640
420f7beb8c3b0e8b7a5e6e8dad92e1246e1dcfb3
426bfebd8064b754e1f6ab7ad6ab81801310043d
4cec02b6467ecc33662b8b691c604d1a80ac4a1b
4f856748145b27bc669a98cd4d66574dfd01b083
5319e4d609cdd282069cc4dce33c1db559539b03
53cbeeb5b30e9a9e0759fad94a9e2d24aaeff53d
5588456a03dc45bc5cc026a7e61ecb86bdd10c38
56763d1f057cdc4bf4e60cbec69b51593f9e3bd0
59c9ea857e563de5e3bb27f0cb6133a6f22c8964
5b009b1f6683c4e167d4d13816a7303a4d74fe1a
5b140cab879595232bb13fe3007cdb14ed267db6
5c9ee24e27939640e18088e56f40373fa2620b0c
5cc4753bc199ac4d595e416e61b7dfa2dfd50379
5d374ca6970d503b3d1a93170d65a02ec5d6d4ff
5f3fcd81f68f4031cbcfcadd5c368104ca0969a0
5f7966de3b4b60260db3b510e6efeab94e55f37a
60f9d89665bd7623ef43c2b2dec7645bbb08c778
6722a6e40e1edeeec7cd4c527a16a51553074130
6795adc096e36c7a7f8e6a407297727e61d4d083
67d4a7bf52c33e679b6e398d1113a33b072d942c
69bfdfa541c368a47a86482dfe66e488b152fe3d
6bb02c5dc7e827fd0fb0d36ae92d14e25318bffa
6c8b42ad4851c05a0a093af5468bdcec6367b7e8
6ce87c726d7f7724a6441a1a94f2fc18314c5cd4
6dfeb7c11933067d0517ee8f862430e83ae33d29
747fe6bdc82aff5407221eff645656932c66ae63
75a725933087584bb4de417b38588f2b3dcc2943
7ab8bf31e1f8df4e485bbf198c2579fc6b2b5cb9
7cb7710ccdcb867bf190b70d4586593bbad49499
8156e162365f85a1712373132bd8bb3ba0209537
8294109a769dc1f2ae9c4c622c2cf3f82531d80a
82e9dc75087c715ef4a9da6fc89674aa74efee1c
832c112baac6645c09b4b30f79c263c679e54994
83941fd0e146733198bcc5fe8c06d50dc9e6c225
8bd5667ce5588ab02c103c9aa8d8f1c6e90da56f
8caa89079f408d056c20ae13a2a62cb2148ccd2c
905781d15f6cb171e9c4360465905c7c27f835ee
928b601edc5e57a3998233b5593de63f90d24671
958b0946a5082fbc6797209fb225f5d7a786b786
9796e3ff820daee2ce8b2439f237dff900769db5
989bf717d47f36c9ba4c17a5e3ce1495c34ebf43
9999cff451d3a833ca39981d6868fdb452449f13
a2438d35e51d7bec87ca5231c0e8f7fb9039ba56
a384894f34b2360404231ed72b3beb136876e16b
a4944100a4832f8fce1494e2e8cbea74e349f731
a851ce1b68aad8616fd4eed75dc02c3de77b4802
a869cb0789d8ad87f04d28dd9b703f3ff343a4a7
ac0272a74f3bf08bdc6c403dd624048521c89021
b474d669fad6d037c18c0d232aef579a65ae101b
b65f86cddbb4086dc6b9b0a14ec8a935c45c6c3d
b9be893a0014c33d0b825cd9588566825c129a4b
c084af1ee14b234a73d47e2bb3fbf3617837e16d
c48c95c3b53b9a16518955e1271ee3dfeb093f80
c9a4eba919aaf1bd98209dfaad43776fae171951
cc2df043a780ba35f1ad458d4710a4ea42fc9c17
cc4cf7c0e5833fdfc4999d33d5b652afa4858bb9
ccba05512dc3b5f46c5fd5caadb40ce79ffb944b
cf88c1fea1b31ac3c7a9606681672c64d4140b79
d32ad1f96650d7da0d9b7043eeece8235da67b82
d4a96ba891017d0d26c15e509b4e6515e40d75ee
d64c721c31719eda098badb4a45913c7e61c9ef1
d6602ec5194c87b0fc87103ca4d67251c76f233a
db8e952afe1ad62c4bc5989ef3d2292ef4aa4d4f
dd229923a70e17998038996d66d4562df16f6d28
e022421aad3c90ef550eaa69b388df25ceb1686b
e03fa31365b953db15f3dec6810aac4a58678e6f
e31297f6bcdec878e0054ae10066e2aaa0495fcd
eeb0c5958781ed3ed29c42b488a556676cd71ab7
f2745cc464cc08214719d9f6ac71fdda9d6417a9
f403f5914294bd2769c9ebab7607d90abee915ab
f519f8e9742f9e2f37cecdf3e93338d843471580
fd8bcb6bf8499aca79300df577d2c9b8cc898f1b
EOF
^ permalink raw reply
* bug: Can't clone from "grafted" bundle: fatal: remote did not send all necessary objects
From: Andrey Butirsky @ 2025-06-23 15:23 UTC (permalink / raw)
To: git
Hi,
while I can clone from the "grafted" repo directly, I can't do the same
if I make a bundle first and try to clone from it.
To reproduce:
- prepare some shallow source repo, e.g.:
$ git clone --depth=1 <repo_URL> <repo>
- make sure it can be cloned fine directly:
$ git clone <repo> test_clone
- now create a bundle from the shallow source repo:
cd <repo>
$ git bundle create test_bundle --all
- try to clone the bundle - the error is produced:
$ git clone test_bundle bundle_clone_test
Receiving objects: 100% (183/183), 61.94 KiB | 6.19 MiB/s, done.
Resolving deltas: 100% (91/91), done.
error: Could not read 3541f044006078ac02f6a587ae87f682359efec0
fatal: Failed to traverse parents of commit
47f57af427b311c96e964b7ffc0500dc0aa64c4f
fatal: remote did not send all necessary objects
The commit 47f57af427b311c96e964b7ffc0500dc0aa64c4f is grafted.
^ permalink raw reply
* Bug: build is broken on FreeBSD if libsysinfo is installed
From: Renato Botelho @ 2025-06-23 14:09 UTC (permalink / raw)
To: git
FreeBSD has a libsysinfo package which contains GNU libc's sysinfo port.
Some users reported git 2.50.0 was failing to build when this port is
installed and it happened because configure script detected libsysinfo
but -lsysinfo was not added to LDFLAGS, ending up with following error:
scalar.o common-main.o libgit.a xdiff/lib.a reftable/libreftable.a
libgit.a -lz -pthread
ld: error: undefined symbol: sysinfo
This patch [1] was added to git port adding a user option to
enable/disable libsysinfo dependency and fix LDFLAGS when it's enabled.
I'm not sure about what is best approach for git project in this case.
[1]
https://github.com/freebsd/freebsd-ports/blob/main/devel/git/files/patch-configure.ac
--
Renato Botelho
^ permalink raw reply
* Re: [GSoC RFC PATCH v2 0/7] repo-info: add new command for retrieving repository info
From: Phillip Wood @ 2025-06-23 13:42 UTC (permalink / raw)
To: Lucas Seiki Oshiro, git; +Cc: ps, karthik.188, ben.knoble, gitster
In-Reply-To: <20250619225751.99699-1-lucasseikioshiro@gmail.com>
Hi Lucas
On 19/06/2025 23:57, Lucas Seiki Oshiro wrote:
> Hi!
>
> This is the second version of the repo-info RFC, and these are the main changes
> introduced since v1:
>
> - The plaintext format now returns its fields in a key=value format
I think that is a good idea. It also now quotes values that contain
control characters. In my experience quoting paths works well when one
is processing the output of one git command and feeding into the stdin
of another git command. In cases where the script itself wants to use
the path having to unquote them is a pain and it is much more convenient
to to read NUL terminated input "lines" that are not quoted. I think the
output from this command falls into that latter category and so I'm not
convinced that a LF terminated output is particularly useful. I think
using an output format generated by 'printf("%s\n%s\0", key, value)'
would be easier to parse. This format matches that used by 'git config
--list -z'.
As this is a plumbing command I think it would be clearer if the caller
was required to specify the output format and the information that they
require with an "--all" option for "show me everything" as Junio
suggested. If we were to set defaults for the format and keys now we
would be stuck with them forever.
I've not seen any discussion of how paths are going to be encoded in the
JSON output. As I understand it some JSON decoders only accept utf8
input but the paths reported by git are arbitrary NUL terminated byte
sequences. How is one expected to parse the output for a non utf8
encoded path using rust's JSON decoding for example?
On the subject of paths do you plan to support the equivalent of "git
rev-parse --git-path"? That is very useful in scripts as the script
author does not have to worry about the details of where exactly each
file lives and for paths like "index" or "hooks" it takes the relevant
environment variable or config setting into account. We should design
the output format so that it can accommodate keys with the requested
path. I think it would be reasonable to reject requests for paths
containing newlines which would be compatible with the output format
suggested above.
I'm not sure what the future plans for this command are but when I'm
scripting around git it would be nice to be able to a single process
that I could query for the things currently returned by "git rev-parse",
"git var" and "git config"
Best Wishes
Phillip
^ permalink raw reply
* [PATCH 2/2] test-lib: teach test_seq the -f option
From: Jeff King @ 2025-06-23 10:56 UTC (permalink / raw)
To: git
In-Reply-To: <20250623105516.GA654296@coredump.intra.peff.net>
The "seq" tool has a "-f" option to produce printf-style formatted
lines. Let's teach our test_seq helper the same trick. This lets us get
rid of some shell loops in test snippets (which are particularly verbose
in our test suite because we have to "|| return 1" to keep the &&-chain
going).
This converts a few call-sites I found by grepping around the test
suite. A few notes on these:
- In "seq", the format specifier is a "%g" float. Since test_seq only
supports integers, I've kept the more natural "%d" (which is what
these call sites were using already).
- Like "seq", test_seq automatically adds a newline to the specified
format. This is what all callers are doing already except for t0021,
but there we do not care about the exact format. We are just trying
to printf a large number of bytes to a file. It's not worth
complicating other callers or adding an option to avoid the newline
in that caller.
- Most conversions are just replacing a shell loop (which does get rid
of an extra fork, since $() requires a subshell). In t0612 we can
replace an awk invocation, which I think makes the end result more
readable, as there's less quoting.
- In t7422 we can replace one loop, but sadly we have to leave the
loop directly above it. This is because that earlier loop wants to
include the seq value twice in the output, which test_seq does not
support (nor does regular seq). If you run:
test_seq -f "foo-%d %d" 10
the second "%d" will always be the empty string. You might naively
think that test_seq could add some extra arguments, like:
# 3 ought to be enough for anyone...
printf "$fmt\n" "$i "$i" $i"
but that just triggers printf to format multiple lines, one per
extra set of arguments.
So we'd have to actually parse the format string, figure out how
many "%" placeholders are there, and then feed it that many
instances of the sequence number. The complexity isn't worth it.
Signed-off-by: Jeff King <peff@peff.net>
---
t/t0021-conversion.sh | 4 ++--
t/t0610-reftable-basics.sh | 6 +-----
t/t0612-reftable-jgit-compatibility.sh | 13 +++++--------
t/t0613-reftable-write-options.sh | 24 ++++--------------------
t/t1400-update-ref.sh | 10 ++--------
t/t5004-archive-corner-cases.sh | 5 +----
t/t6422-merge-rename-corner-cases.sh | 10 ++--------
t/t7422-submodule-output.sh | 6 +-----
t/test-lib-functions.sh | 9 ++++++++-
9 files changed, 26 insertions(+), 61 deletions(-)
diff --git a/t/t0021-conversion.sh b/t/t0021-conversion.sh
index bf10d253ec..f0d50d769e 100755
--- a/t/t0021-conversion.sh
+++ b/t/t0021-conversion.sh
@@ -281,7 +281,7 @@ test_expect_success 'required filter with absent smudge field' '
test_expect_success 'filtering large input to small output should use little memory' '
test_config filter.devnull.clean "cat >/dev/null" &&
test_config filter.devnull.required true &&
- for i in $(test_seq 1 30); do printf "%1048576d" 1 || return 1; done >30MB &&
+ test_seq -f "%1048576d" 1 30 >30MB &&
echo "30MB filter=devnull" >.gitattributes &&
GIT_MMAP_LIMIT=1m GIT_ALLOC_LIMIT=1m git add 30MB
'
@@ -299,7 +299,7 @@ test_expect_success 'filter that does not read is fine' '
test_expect_success EXPENSIVE 'filter large file' '
test_config filter.largefile.smudge cat &&
test_config filter.largefile.clean cat &&
- for i in $(test_seq 1 2048); do printf "%1048576d" 1 || return 1; done >2GB &&
+ test_seq -f "%1048576d" 1 2048 >2GB &&
echo "2GB filter=largefile" >.gitattributes &&
git add 2GB 2>err &&
test_must_be_empty err &&
diff --git a/t/t0610-reftable-basics.sh b/t/t0610-reftable-basics.sh
index 1be534a895..3ea5d51532 100755
--- a/t/t0610-reftable-basics.sh
+++ b/t/t0610-reftable-basics.sh
@@ -477,11 +477,7 @@ test_expect_success !CYGWIN 'ref transaction: many concurrent writers' '
test_commit --no-tag initial &&
head=$(git rev-parse HEAD) &&
- for i in $(test_seq 100)
- do
- printf "%s commit\trefs/heads/branch-%s\n" "$head" "$i" ||
- return 1
- done >expect &&
+ test_seq -f "$head commit\trefs/heads/branch-%d" 100 >expect &&
printf "%s commit\trefs/heads/main\n" "$head" >>expect &&
for i in $(test_seq 100)
diff --git a/t/t0612-reftable-jgit-compatibility.sh b/t/t0612-reftable-jgit-compatibility.sh
index d0d7e80b49..7df2ad5817 100755
--- a/t/t0612-reftable-jgit-compatibility.sh
+++ b/t/t0612-reftable-jgit-compatibility.sh
@@ -112,14 +112,11 @@ test_expect_success 'JGit can read multi-level index' '
cd repo &&
test_commit A &&
- awk "
- BEGIN {
- print \"start\";
- for (i = 0; i < 10000; i++)
- printf \"create refs/heads/branch-%d HEAD\n\", i;
- print \"commit\";
- }
- " >input &&
+ {
+ echo start &&
+ test_seq -f "create refs/heads/branch-%d HEAD" 10000 &&
+ echo commit
+ } >input &&
git update-ref --stdin <input &&
test_same_refs &&
diff --git a/t/t0613-reftable-write-options.sh b/t/t0613-reftable-write-options.sh
index 6447920c9b..d77e601111 100755
--- a/t/t0613-reftable-write-options.sh
+++ b/t/t0613-reftable-write-options.sh
@@ -66,11 +66,7 @@ test_expect_success 'many refs results in multiple blocks' '
(
cd repo &&
test_commit initial &&
- for i in $(test_seq 200)
- do
- printf "update refs/heads/branch-%d HEAD\n" "$i" ||
- return 1
- done >input &&
+ test_seq -f "update refs/heads/branch-%d HEAD" 200 >input &&
git update-ref --stdin <input &&
git pack-refs &&
@@ -180,11 +176,7 @@ test_expect_success 'restart interval at every single record' '
(
cd repo &&
test_commit initial &&
- for i in $(test_seq 10)
- do
- printf "update refs/heads/branch-%d HEAD\n" "$i" ||
- return 1
- done >input &&
+ test_seq -f "update refs/heads/branch-%d HEAD" 10 >input &&
git update-ref --stdin <input &&
git -c reftable.restartInterval=1 pack-refs &&
@@ -224,11 +216,7 @@ test_expect_success 'object index gets written by default with ref index' '
(
cd repo &&
test_commit initial &&
- for i in $(test_seq 5)
- do
- printf "update refs/heads/branch-%d HEAD\n" "$i" ||
- return 1
- done >input &&
+ test_seq -f "update refs/heads/branch-%d HEAD" 5 >input &&
git update-ref --stdin <input &&
git -c reftable.blockSize=100 pack-refs &&
@@ -263,11 +251,7 @@ test_expect_success 'object index can be disabled' '
(
cd repo &&
test_commit initial &&
- for i in $(test_seq 5)
- do
- printf "update refs/heads/branch-%d HEAD\n" "$i" ||
- return 1
- done >input &&
+ test_seq -f "update refs/heads/branch-%d HEAD" 5 >input &&
git update-ref --stdin <input &&
git -c reftable.blockSize=100 -c reftable.indexObjects=false pack-refs &&
diff --git a/t/t1400-update-ref.sh b/t/t1400-update-ref.sh
index d29d23cb89..e373d9108b 100755
--- a/t/t1400-update-ref.sh
+++ b/t/t1400-update-ref.sh
@@ -1380,21 +1380,15 @@ test_expect_success 'fails with duplicate ref update via symref' '
test_expect_success ULIMIT_FILE_DESCRIPTORS 'large transaction creating branches does not burst open file limit' '
(
- for i in $(test_seq 33)
- do
- echo "create refs/heads/$i HEAD" || exit 1
- done >large_input &&
+ test_seq -f "create refs/heads/%d HEAD" 33 >large_input &&
run_with_limited_open_files git update-ref --stdin <large_input &&
git rev-parse --verify -q refs/heads/33
)
'
test_expect_success ULIMIT_FILE_DESCRIPTORS 'large transaction deleting branches does not burst open file limit' '
(
- for i in $(test_seq 33)
- do
- echo "delete refs/heads/$i HEAD" || exit 1
- done >large_input &&
+ test_seq -f "delete refs/heads/%d HEAD" 33 >large_input &&
run_with_limited_open_files git update-ref --stdin <large_input &&
test_must_fail git rev-parse --verify -q refs/heads/33
)
diff --git a/t/t5004-archive-corner-cases.sh b/t/t5004-archive-corner-cases.sh
index 5174995191..027dedd976 100755
--- a/t/t5004-archive-corner-cases.sh
+++ b/t/t5004-archive-corner-cases.sh
@@ -176,10 +176,7 @@ test_expect_success EXPENSIVE,UNZIP,UNZIP_ZIP64_SUPPORT \
blob=$(echo $s | git hash-object -w --stdin) &&
# create tree containing 65500 entries of that blob
- for i in $(test_seq 1 65500)
- do
- echo "100644 blob $blob $i" || return 1
- done >tree &&
+ test_seq -f "100644 blob $blob\t%d" 1 65500 >tree &&
tree=$(git mktree <tree) &&
# zip it, creating an archive a bit bigger than 4GB
diff --git a/t/t6422-merge-rename-corner-cases.sh b/t/t6422-merge-rename-corner-cases.sh
index 9cbe7ca782..f14c0fb30e 100755
--- a/t/t6422-merge-rename-corner-cases.sh
+++ b/t/t6422-merge-rename-corner-cases.sh
@@ -1146,10 +1146,7 @@ test_conflicts_with_adds_and_renames() {
cd simple_${sideL}_${sideR} &&
# Create some related files now
- for i in $(test_seq 1 10)
- do
- echo Random base content line $i
- done >file_v1 &&
+ test_seq -f "Random base content line %d" 1 10 >file_v1 &&
cp file_v1 file_v2 &&
echo modification >>file_v2 &&
@@ -1293,10 +1290,7 @@ test_setup_nested_conflicts_from_rename_rename () {
cd nested_conflicts_from_rename_rename &&
# Create some related files now
- for i in $(test_seq 1 10)
- do
- echo Random base content line $i
- done >file_v1 &&
+ test_seq -f "Random base content line %d" 1 10 >file_v1 &&
cp file_v1 file_v2 &&
cp file_v1 file_v3 &&
diff --git a/t/t7422-submodule-output.sh b/t/t7422-submodule-output.sh
index ea67057f1a..aea1ddf117 100755
--- a/t/t7422-submodule-output.sh
+++ b/t/t7422-submodule-output.sh
@@ -187,11 +187,7 @@ test_expect_success !MINGW 'git submodule status --recursive propagates SIGPIPE'
BLOB=$(git hash-object -w --stdin <gitmodules) &&
printf "100644 blob $BLOB\t.gitmodules\n" >tree &&
- for i in $(test_seq 2000)
- do
- printf "160000 commit $COMMIT\trecursive-submodule-path-%d\n" "$i" ||
- return 1
- done >>tree &&
+ test_seq -f "160000 commit $COMMIT\trecursive-submodule-path-%d" 2000 >>tree &&
TREE=$(git mktree <tree) &&
COMMIT=$(git commit-tree "$TREE") &&
diff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh
index bee4a2ca34..8c176f4efc 100644
--- a/t/test-lib-functions.sh
+++ b/t/test-lib-functions.sh
@@ -1454,6 +1454,13 @@ test_cmp_fspath () {
# from 1.
test_seq () {
+ local fmt="%d"
+ case "$1" in
+ -f)
+ fmt="$2"
+ shift 2
+ ;;
+ esac
case $# in
1) set 1 "$@" ;;
2) ;;
@@ -1462,7 +1469,7 @@ test_seq () {
test_seq_counter__=$1
while test "$test_seq_counter__" -le "$2"
do
- echo "$test_seq_counter__"
+ printf "$fmt\n" "$test_seq_counter__"
test_seq_counter__=$(( $test_seq_counter__ + 1 ))
done
}
--
2.50.0.385.g2a828bf5b7
^ permalink raw reply related
* [PATCH 1/2] t7422: replace confusing printf with echo
From: Jeff King @ 2025-06-23 10:55 UTC (permalink / raw)
To: git
In-Reply-To: <20250623105516.GA654296@coredump.intra.peff.net>
While looping over a counter "i", we do:
printf "[submodule \"sm-$i\"]\npath = recursive-submodule-path-$i\n" "$i"
So we are passing "$i" as an argument to be filled in, but there is no
"%" placeholder in the format string, which is a bit confusing to read.
We could switch both instances of "$i" to "%d" (and pass $i twice). But
that makes the line even longer. Let's just keep interpolating the value
in the string, and drop the confusing extra "$i" argument.
And since we are not using any printf specifiers at all, it becomes
clear that we can swap it out for echo. We do use a "\n" in the middle
of the string, but breaking this into two separate echo statements
actually makes it easier to read.
Signed-off-by: Jeff King <peff@peff.net>
---
t/t7422-submodule-output.sh | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/t/t7422-submodule-output.sh b/t/t7422-submodule-output.sh
index 023a5cbdc4..ea67057f1a 100755
--- a/t/t7422-submodule-output.sh
+++ b/t/t7422-submodule-output.sh
@@ -180,7 +180,8 @@ test_expect_success !MINGW 'git submodule status --recursive propagates SIGPIPE'
COMMIT=$(git rev-parse HEAD) &&
for i in $(test_seq 2000)
do
- printf "[submodule \"sm-$i\"]\npath = recursive-submodule-path-$i\n" "$i" ||
+ echo "[submodule \"sm-$i\"]" &&
+ echo "path = recursive-submodule-path-$i" ||
return 1
done >gitmodules &&
BLOB=$(git hash-object -w --stdin <gitmodules) &&
--
2.50.0.385.g2a828bf5b7
^ permalink raw reply related
* [PATCH 0/2] test_seq format option
From: Jeff King @ 2025-06-23 10:55 UTC (permalink / raw)
To: git
This is a small quality of life improvement for our test suite, stemming
from this discussion:
https://lore.kernel.org/git/20240408172638.GB1629595@coredump.intra.peff.net/
But somehow it took me over a year to get back to it. :-/
The first patch is a small cleanup in nearby code; the second one is the
interesting part.
[1/2]: t7422: replace confusing printf with echo
[2/2]: test-lib: teach test_seq the -f option
t/t0021-conversion.sh | 4 ++--
t/t0610-reftable-basics.sh | 6 +-----
t/t0612-reftable-jgit-compatibility.sh | 13 +++++--------
t/t0613-reftable-write-options.sh | 24 ++++--------------------
t/t1400-update-ref.sh | 10 ++--------
t/t5004-archive-corner-cases.sh | 5 +----
t/t6422-merge-rename-corner-cases.sh | 10 ++--------
t/t7422-submodule-output.sh | 9 +++------
t/test-lib-functions.sh | 9 ++++++++-
9 files changed, 28 insertions(+), 62 deletions(-)
-Peff
^ permalink raw reply
* Re: repository maintenance: git prints warning messages while cloning https://github.com/git/git.git
From: Jeff King @ 2025-06-23 10:35 UTC (permalink / raw)
To: kryzet; +Cc: git
In-Reply-To: <CAB2ApcOds+SZszEHhMwG5YvxQcRE01jKgP1modo1WhcwWeGeYA@mail.gmail.com>
On Sun, Jun 22, 2025 at 07:00:49AM +0000, kryzet wrote:
> While cloning the source code repository from
> https://github.com/git/git.git, the following warnings are printed:
>
> warning: object d6602ec5194c87b0fc87103ca4d67251c76f233a:
> missingTaggerEntry: invalid format - expected 'tagger' line
> warning: object 2b5bfdf7798569e0b59b16eb9602d5fa572d6038: badFilemode:
> contains bad file modes
> [...]
These are fsck warnings. Presumably you've enabled transfer.fsckObjects
(or fetch.fsckObjects) in your config file.
These lines are expected for git.git. It's an old project, and there are
objects in the early part of the history that have some (mostly
harmless) quirks. In this case, the v0.99 tag doesn't have a "tagger"
field, and a number of old tree entries have mode "100664" rather than
"100644" (we later standardized on a few modes, since recording the
exact group mode on people's systems was prone to noise).
Since a git clone transmits the full history, those funny objects will
live on forever.
You can safely ignore them, but if you want to quiet the noise you can
put:
[fetch "fsck"]
badFileMode = ignore
missingTaggerEntry = ignore
in your ~/.gitconfig file.
-Peff
PS There's one other small oddity, which is that running "git fsck" in
the resulting clone will show only the tag warning. That's because
fsck doesn't check badFileMode unless you also pass "--strict". But
fetch/push checks are always done in strict mode. TBH I am not sure
that is wise, but the behavior here is mostly historical. I suspect
it would be good for somebody to take a careful look and clean up the
severity of the various warnings (some of which are security
relevant, and some of which are just mild misconfigurations or old
bugs).
^ permalink raw reply
* Re: [PATCH] Ensure restore_term works correctly with DUPLEX
From: Phillip Wood @ 2025-06-23 9:42 UTC (permalink / raw)
To: Carlo Marcelo Arenas Belón, James Duley
Cc: Junio C Hamano, James Duley via GitGitGadget, git,
Johannes Schindelin
In-Reply-To: <ckzjxolc5jthge62zcm5abnssefwntc3ryu6sumpvrdontmyyq@d4ahvg5umked>
On 19/06/2025 00:43, Carlo Marcelo Arenas Belón wrote:
> On Thu, Jun 19, 2025 at 08:38:29AM -0800, James Duley wrote:
>> On Wed, 18 Jun 2025 at 22:07, Carlo Marcelo Arenas Belón
>> <carenas@gmail.com> wrote:
>>>
>> I thought about something like that, but I figured:
>> * restore_term is only called if save_term is successful
>> * hconout is always invalid before save_term is called
>
> but it is not always set to invalid at the end of restore_term()
> so it can't be relied upon either.
Are you sure about that? It looks to me like the only time we don't
reset hconout is when we use stty in which case I think hconout is
already set to the invalid handle value.
>> * 0 might be a valid cmode_out that should be restored
>
> cmode_out == 0 is not a valid mode that should be restored,
cmode_out is a bitfield. The documentation for SetConsoleMode() says the
mode parameter "can be one or more of the following values" which
implies zero is not a valid mode. It seems very hacky to be relying on
that when we can just check if the output handle is valid though.
> and
> indeed the original code was (ab)using that fact to decide if
> SetConsoleMode(hcounout) would be called at all (as a proxy to
> know if DUPLEX was used or not), hence why it is a bug not to
> update it, as you pointed out and found unexpectally, sorry
> about that.
>
>> This is my first patch so I didn't realize git-for-windows had a
>> separate fork. That makes sense now because I couldn't find where
>> save_term was called from in this repo. To test this works I had
>> downloaded the artifacts from
>> https://github.com/git/git/actions/runs/15692373534/job/44210362705
>> but is that right? If I should submit this patch to the git-for-windows
>> fork, please let me know. Or, if someone, who knows what they're
>> doing, wants to pick this up, they're more than welcome.
>
> You are going to need to get the Git for Windows SDK installed to
> be able to apply this patch and build your own version of GfW.
>
> IMHO getting the change that makes "cmode_out" reliable again (which
> would include both our changes) should be a good start regardless,
> and at least that change could be submitted here.
Yes, this change should absolutely be submitted here as it is fixing
code that is upstream of git-for-windows.
Thanks
Phillip
>
> Carlo
>
^ permalink raw reply
* Re: [PATCH] Ensure restore_term works correctly with DUPLEX
From: Phillip Wood @ 2025-06-23 9:35 UTC (permalink / raw)
To: James Duley via GitGitGadget, git
Cc: James Duley, Carlo Marcelo Arenas Belón, Junio C Hamano
In-Reply-To: <pull.2000.git.git.1750186571037.gitgitgadget@gmail.com>
Hi James
On 17/06/2025 19:56, James Duley via GitGitGadget wrote:
> From: James Duley <jagduley@gmail.com>
>
> Previously, if save_term/restore_term was called with the DUPLEX flag
> and then without the flag, an assertion was hit.
>> Assertion failed: hconout != INVALID_HANDLE_VALUE,
>> file compat/terminal.c, line 283
>
> This is because save_term doesn't set cmode_out when not DUPLEX,
> so an old version of cmode_out was being used.
> Therefore, hconout is the correct thing for restore to check
> to decide whether to restore stdout console mode.
I found this paragraph (especially the first sentence) rather hard to
understand - it was only after I'd figured out what the problem was by
reading the code that I could understand what it was saying.
As I understand it the problem is caused by calling
save_term(SAVE_TERM_DUPLEX);
restore_term();
save_term(0);
restore_term();
The first call to save_term() sets hconout to a valid handle and
cmode_out to a non-zero value. The first call to restore_term() then
sets hconout to INVALID_HANDLE_VALUE but leaves cmode_out unchanged. The
second call to save_term does not touch hconout or cmode_out. The second
call to restore_term() then hits the assertion because cmode_out is
non-zero but hconout is an invalid handle.
I think it would be helpful to include an explanation like that in the
commit message.
I agree with you diagnosis and the proposed fix - using the filehandle
to tell whether we should restore the output settings is much cleaner
that looking at the mode. I would suggest that we should also set
hconout to INVALID_HANDLE_VALUE when save_term() is called without
SAVE_TERM_DUPLEX to avoid any problems with call sequences like
save_term(SAVE_TERM_DUPLEX);
save_term(0);
restore_term();
Thanks for reporting and working on this
Phillip
> I saw this on Windows with interactive.singleKey when doing `git add -p`.
> Specifically, after hitting `e` to edit in vim, once on to the prompt
> for the next hunk, pressing any key results in the assertion.
>
> Signed-off-by: James Duley <jagduley@gmail.com>
> ---
> Ensure restore_term works correctly with DUPLEX
>
> Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-2000%2Fparched%2Frestore-term-windows-fix-v1
> Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-2000/parched/restore-term-windows-fix-v1
> Pull-Request: https://github.com/git/git/pull/2000
>
> compat/terminal.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/compat/terminal.c b/compat/terminal.c
> index 584f27bf7e1..72b184555ff 100644
> --- a/compat/terminal.c
> +++ b/compat/terminal.c
> @@ -279,8 +279,7 @@ void restore_term(void)
>
> SetConsoleMode(hconin, cmode_in);
> CloseHandle(hconin);
> - if (cmode_out) {
> - assert(hconout != INVALID_HANDLE_VALUE);
> + if (hconout != INVALID_HANDLE_VALUE) {
> SetConsoleMode(hconout, cmode_out);
> CloseHandle(hconout);
> }
>
> base-commit: 16bd9f20a403117f2e0d9bcda6c6e621d3763e77
^ permalink raw reply
* Re: [GSoC RFC PATCH v2 4/7] repo-info: add the --allow-empty flag
From: Karthik Nayak @ 2025-06-23 9:26 UTC (permalink / raw)
To: Junio C Hamano, Lucas Seiki Oshiro; +Cc: git, ps, ben.knoble
In-Reply-To: <xmqq1pre14ae.fsf@gitster.g>
[-- Attachment #1: Type: text/plain, Size: 1063 bytes --]
Junio C Hamano <gitster@pobox.com> writes:
> Lucas Seiki Oshiro <lucasseikioshiro@gmail.com> writes:
>
>> Add a flag --allow-empty, which will force the output data to be empty
>> when no field is requested.
>
> I still think we should flip the polarity of the option and give "--all"
> to iterate over all variables, and by default show nothing.
>
I thought the idea was that we would show a subset of the fields by
default when no user input is provided. Which would mean we have the
following:
* `git repo-info` which would show a subset of all fields, giving
important repository information.
* `git repo-info --all` which would show all available fields.
* `git repo-info <fields>` which would only show the requested fields.
With this context, I'm not entirely sure where '--allow-empty' fits in.
If this is/not the case, it would be nice to talk about this in more
detail in the cover message and also in the individual patches.
This is also a good time to think about if we should make the default to
not show anything as Junio mentioned.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 690 bytes --]
^ permalink raw reply
* Re: [GSoC RFC PATCH v2 1/7] repo-info: declare the repo-info command
From: Karthik Nayak @ 2025-06-23 9:19 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Lucas Seiki Oshiro, git, ps, ben.knoble
In-Reply-To: <xmqq4iwa0xzz.fsf@gitster.g>
[-- Attachment #1: Type: text/plain, Size: 818 bytes --]
Junio C Hamano <gitster@pobox.com> writes:
> Karthik Nayak <karthik.188@gmail.com> writes:
>
>>> .gitignore | 1 +
>>> Makefile | 1 +
>>> builtin.h | 1 +
>>> builtin/repo-info.c | 21 +++++++++++++++++++++
>>> git.c | 1 +
>>> meson.build | 1 +
>>> 6 files changed, 26 insertions(+)
>>> create mode 100644 builtin/repo-info.c
>>>
>>
>> Something I mentioned in the previous review, but hasn't been addressed
>> is the addition of documentation for the new command. With each patch
>> modifying the command, it would be also nice to add the respective
>> documentation.
>
> Bsdies, the lack of Documentation/repo-info.adoc causes "make check-docs"
> fail.
More so the reason, I didn't know the target also checks for missing
documentation. That is great!
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 690 bytes --]
^ permalink raw reply
* Re: [PATCH v19 00/10] imap-send: make it usable again and add OAuth2.0 support
From: Phillip Wood @ 2025-06-23 9:09 UTC (permalink / raw)
To: Junio C Hamano, Aditya Garg
Cc: git, Eric Sunshine, Zi Yao, brian m . carlson, Jeff King,
Ben Knoble
In-Reply-To: <xmqqh60a4dk6.fsf@gitster.g>
On 20/06/2025 16:50, Junio C Hamano wrote:
> Aditya Garg <gargaditya08@live.com> writes:
>
>> v19: - Use xstrfmt() for OAuth2 strings and strbuf for PLAIN.
>>
>> Aditya Garg (10):
>> imap-send: fix bug causing cfg->folder being set to NULL
>> imap-send: fix memory leak in case auth_cram_md5 fails
>> imap-send: gracefully fail if CRAM-MD5 authentication is requested
>> without OpenSSL
>> imap-send: add support for OAuth2.0 authentication
>> imap-send: add PLAIN authentication method to OpenSSL
>> imap-send: enable specifying the folder using the command line
>> imap-send: add ability to list the available folders
>> imap-send: display port alongwith host when git credential is invoked
>> imap-send: display the destination mailbox when sending a message
>> imap-send: fix minor mistakes in the logs
>>
>> Documentation/config/imap.adoc | 11 +-
>> Documentation/git-imap-send.adoc | 68 +++++-
>> imap-send.c | 405 ++++++++++++++++++++++++++-----
>> 3 files changed, 407 insertions(+), 77 deletions(-)
>
> Looking good. Will replace.
>
> Should we declare victory and mark the topic for 'next' now?
I think so, the range diff looks good. I've not reviewed each patch but
I just had a quick scan of
git diff origin/master origin/seen imap-send.c
and it looked reasonable.
Best Wishes
Phillip
^ permalink raw reply
* [PATCH v2 4/4] t4018: add tests for javascript export type function declarations
From: Derick W. de M. Frias @ 2025-06-23 6:35 UTC (permalink / raw)
To: j6t; +Cc: derick.william.moraes, git
In-Reply-To: <20250623090538.154858-1-derick.william.moraes@gmail.com>
Add tests for javascript export function declarations as in ECMAScript ES6 and CommonJS.
Signed-off-by: Derick W. de M. Frias <derick.william.moraes@gmail.com>
---
t/t4018/javascript-dotexpors-async-anonymous-function | 3 +++
t/t4018/javascript-dotexports-anonymous-function | 3 +++
t/t4018/javascript-dotexports-arrow-function | 4 ++++
t/t4018/javascript-dotexports-arrow-function-2 | 4 ++++
t/t4018/javascript-dotexports-arrow-function-3 | 1 +
t/t4018/javascript-dotexports-assigned-function | 1 +
t/t4018/javascript-dotexports-async-arrow-function | 3 +++
t/t4018/javascript-dotexports-async-arrow-function-2 | 4 ++++
t/t4018/javascript-dotexports-async-arrow-function-3 | 1 +
t/t4018/javascript-dotexports-async-function | 4 ++++
...javascript-dotexports-async-generator-anonymous-function | 5 +++++
...vascript-dotexports-async-generator-anonymous-function-2 | 5 +++++
t/t4018/javascript-dotexports-async-generator-function | 5 +++++
t/t4018/javascript-dotexports-async-generator-function-2 | 5 +++++
t/t4018/javascript-dotexports-function | 4 ++++
t/t4018/javascript-dotexports-generator-anonymous-function | 5 +++++
.../javascript-dotexports-generator-anonymous-function-2 | 5 +++++
t/t4018/javascript-dotexports-generator-function | 5 +++++
t/t4018/javascript-dotexports-generator-function-2 | 5 +++++
t/t4018/javascript-export-arrow-function | 4 ++++
t/t4018/javascript-export-async-anonymous-assigned-function | 4 ++++
t/t4018/javascript-export-async-arrow-function | 4 ++++
t/t4018/javascript-export-async-function | 4 ++++
...cript-export-async-generator-anonymous-assigned-function | 4 ++++
...ipt-export-async-generator-anonymous-assigned-function-2 | 4 ++++
t/t4018/javascript-export-async-generator-assigned-function | 5 +++++
.../javascript-export-async-generator-assigned-function-2 | 5 +++++
t/t4018/javascript-export-async-generator-function | 5 +++++
t/t4018/javascript-export-async-generator-function-2 | 5 +++++
t/t4018/javascript-export-function | 4 ++++
t/t4018/javascript-export-generator-assigned-function | 6 ++++++
t/t4018/javascript-export-generator-assigned-function-2 | 6 ++++++
t/t4018/javascript-export-generator-function | 5 +++++
t/t4018/javascript-export-generator-function-2 | 5 +++++
t/t4018/javascript-module-dotexports-anonymous-function | 3 +++
t/t4018/javascript-module-dotexports-arrow-function | 4 ++++
t/t4018/javascript-module-dotexports-arrow-function-2 | 4 ++++
t/t4018/javascript-module-dotexports-arrow-function-3 | 1 +
t/t4018/javascript-module-dotexports-assigned-function | 1 +
t/t4018/javascript-module-dotexports-async-arrow-function | 3 +++
t/t4018/javascript-module-dotexports-async-arrow-function-2 | 4 ++++
t/t4018/javascript-module-dotexports-async-arrow-function-3 | 1 +
t/t4018/javascript-module-dotexports-async-function | 4 ++++
...ipt-module-dotexports-async-generator-anonymous-function | 5 +++++
...t-module-dotexports-async-generator-anonymous-function-2 | 5 +++++
.../javascript-module-dotexports-async-generator-function | 5 +++++
.../javascript-module-dotexports-async-generator-function-2 | 5 +++++
t/t4018/javascript-module-dotexports-function | 4 ++++
...avascript-module-dotexports-generator-anonymous-function | 5 +++++
...ascript-module-dotexports-generator-anonymous-function-2 | 5 +++++
t/t4018/javascript-module-dotexports-generator-function | 5 +++++
t/t4018/javascript-module-dotexports-generator-function-2 | 5 +++++
52 files changed, 211 insertions(+)
create mode 100644 t/t4018/javascript-dotexpors-async-anonymous-function
create mode 100644 t/t4018/javascript-dotexports-anonymous-function
create mode 100644 t/t4018/javascript-dotexports-arrow-function
create mode 100644 t/t4018/javascript-dotexports-arrow-function-2
create mode 100644 t/t4018/javascript-dotexports-arrow-function-3
create mode 100644 t/t4018/javascript-dotexports-assigned-function
create mode 100644 t/t4018/javascript-dotexports-async-arrow-function
create mode 100644 t/t4018/javascript-dotexports-async-arrow-function-2
create mode 100644 t/t4018/javascript-dotexports-async-arrow-function-3
create mode 100644 t/t4018/javascript-dotexports-async-function
create mode 100644 t/t4018/javascript-dotexports-async-generator-anonymous-function
create mode 100644 t/t4018/javascript-dotexports-async-generator-anonymous-function-2
create mode 100644 t/t4018/javascript-dotexports-async-generator-function
create mode 100644 t/t4018/javascript-dotexports-async-generator-function-2
create mode 100644 t/t4018/javascript-dotexports-function
create mode 100644 t/t4018/javascript-dotexports-generator-anonymous-function
create mode 100644 t/t4018/javascript-dotexports-generator-anonymous-function-2
create mode 100644 t/t4018/javascript-dotexports-generator-function
create mode 100644 t/t4018/javascript-dotexports-generator-function-2
create mode 100644 t/t4018/javascript-export-arrow-function
create mode 100644 t/t4018/javascript-export-async-anonymous-assigned-function
create mode 100644 t/t4018/javascript-export-async-arrow-function
create mode 100644 t/t4018/javascript-export-async-function
create mode 100644 t/t4018/javascript-export-async-generator-anonymous-assigned-function
create mode 100644 t/t4018/javascript-export-async-generator-anonymous-assigned-function-2
create mode 100644 t/t4018/javascript-export-async-generator-assigned-function
create mode 100644 t/t4018/javascript-export-async-generator-assigned-function-2
create mode 100644 t/t4018/javascript-export-async-generator-function
create mode 100644 t/t4018/javascript-export-async-generator-function-2
create mode 100644 t/t4018/javascript-export-function
create mode 100644 t/t4018/javascript-export-generator-assigned-function
create mode 100644 t/t4018/javascript-export-generator-assigned-function-2
create mode 100644 t/t4018/javascript-export-generator-function
create mode 100644 t/t4018/javascript-export-generator-function-2
create mode 100644 t/t4018/javascript-module-dotexports-anonymous-function
create mode 100644 t/t4018/javascript-module-dotexports-arrow-function
create mode 100644 t/t4018/javascript-module-dotexports-arrow-function-2
create mode 100644 t/t4018/javascript-module-dotexports-arrow-function-3
create mode 100644 t/t4018/javascript-module-dotexports-assigned-function
create mode 100644 t/t4018/javascript-module-dotexports-async-arrow-function
create mode 100644 t/t4018/javascript-module-dotexports-async-arrow-function-2
create mode 100644 t/t4018/javascript-module-dotexports-async-arrow-function-3
create mode 100644 t/t4018/javascript-module-dotexports-async-function
create mode 100644 t/t4018/javascript-module-dotexports-async-generator-anonymous-function
create mode 100644 t/t4018/javascript-module-dotexports-async-generator-anonymous-function-2
create mode 100644 t/t4018/javascript-module-dotexports-async-generator-function
create mode 100644 t/t4018/javascript-module-dotexports-async-generator-function-2
create mode 100644 t/t4018/javascript-module-dotexports-function
create mode 100644 t/t4018/javascript-module-dotexports-generator-anonymous-function
create mode 100644 t/t4018/javascript-module-dotexports-generator-anonymous-function-2
create mode 100644 t/t4018/javascript-module-dotexports-generator-function
create mode 100644 t/t4018/javascript-module-dotexports-generator-function-2
diff --git a/t/t4018/javascript-dotexpors-async-anonymous-function b/t/t4018/javascript-dotexpors-async-anonymous-function
new file mode 100644
index 0000000000..9f970a2343
--- /dev/null
+++ b/t/t4018/javascript-dotexpors-async-anonymous-function
@@ -0,0 +1,3 @@
+exports.RIGHT = async function(a, b) {
+ return a + b; // ChangeMe
+};
diff --git a/t/t4018/javascript-dotexports-anonymous-function b/t/t4018/javascript-dotexports-anonymous-function
new file mode 100644
index 0000000000..2fa9775c95
--- /dev/null
+++ b/t/t4018/javascript-dotexports-anonymous-function
@@ -0,0 +1,3 @@
+exports.RIGHT = function(a, b) {
+ return a + b; //ChangeMe
+};
diff --git a/t/t4018/javascript-dotexports-arrow-function b/t/t4018/javascript-dotexports-arrow-function
new file mode 100644
index 0000000000..a7d9741e90
--- /dev/null
+++ b/t/t4018/javascript-dotexports-arrow-function
@@ -0,0 +1,4 @@
+exports.RIGHT = (a, b) => {
+
+ return a+b; //ChangeMe
+};
diff --git a/t/t4018/javascript-dotexports-arrow-function-2 b/t/t4018/javascript-dotexports-arrow-function-2
new file mode 100644
index 0000000000..f9cd237bb8
--- /dev/null
+++ b/t/t4018/javascript-dotexports-arrow-function-2
@@ -0,0 +1,4 @@
+exports.RIGHT = a => {
+
+ return a+1; //ChangeMe
+};
diff --git a/t/t4018/javascript-dotexports-arrow-function-3 b/t/t4018/javascript-dotexports-arrow-function-3
new file mode 100644
index 0000000000..cc3f1ec017
--- /dev/null
+++ b/t/t4018/javascript-dotexports-arrow-function-3
@@ -0,0 +1 @@
+exports.RIGHT = a => a+1; //ChangeMe
diff --git a/t/t4018/javascript-dotexports-assigned-function b/t/t4018/javascript-dotexports-assigned-function
new file mode 100644
index 0000000000..308cc37095
--- /dev/null
+++ b/t/t4018/javascript-dotexports-assigned-function
@@ -0,0 +1 @@
+exports.RIGHT = PreviousFunction; //ChangeMe
diff --git a/t/t4018/javascript-dotexports-async-arrow-function b/t/t4018/javascript-dotexports-async-arrow-function
new file mode 100644
index 0000000000..01df800f19
--- /dev/null
+++ b/t/t4018/javascript-dotexports-async-arrow-function
@@ -0,0 +1,3 @@
+exports.RIGHT = async (a, b) => {
+ return a + b; // ChangeMe
+};
diff --git a/t/t4018/javascript-dotexports-async-arrow-function-2 b/t/t4018/javascript-dotexports-async-arrow-function-2
new file mode 100644
index 0000000000..453da8fcb4
--- /dev/null
+++ b/t/t4018/javascript-dotexports-async-arrow-function-2
@@ -0,0 +1,4 @@
+exports.RIGHT = async a => {
+
+ return a + 1; // ChangeMe
+};
diff --git a/t/t4018/javascript-dotexports-async-arrow-function-3 b/t/t4018/javascript-dotexports-async-arrow-function-3
new file mode 100644
index 0000000000..74b028cf1c
--- /dev/null
+++ b/t/t4018/javascript-dotexports-async-arrow-function-3
@@ -0,0 +1 @@
+exports.RIGHT = async a => a + 1; // ChangeMe
diff --git a/t/t4018/javascript-dotexports-async-function b/t/t4018/javascript-dotexports-async-function
new file mode 100644
index 0000000000..88b3539544
--- /dev/null
+++ b/t/t4018/javascript-dotexports-async-function
@@ -0,0 +1,4 @@
+exports.RIGHT = async function ChangeMe(a, b) {
+
+ return a + b; // ChangeMe
+}
diff --git a/t/t4018/javascript-dotexports-async-generator-anonymous-function b/t/t4018/javascript-dotexports-async-generator-anonymous-function
new file mode 100644
index 0000000000..9e90bdf489
--- /dev/null
+++ b/t/t4018/javascript-dotexports-async-generator-anonymous-function
@@ -0,0 +1,5 @@
+exports.RIGHT = async function* () {
+
+ yield 1;
+ yield 2; // ChangeMe
+};
diff --git a/t/t4018/javascript-dotexports-async-generator-anonymous-function-2 b/t/t4018/javascript-dotexports-async-generator-anonymous-function-2
new file mode 100644
index 0000000000..efe2abe4f7
--- /dev/null
+++ b/t/t4018/javascript-dotexports-async-generator-anonymous-function-2
@@ -0,0 +1,5 @@
+exports.RIGHT = async function *() {
+
+ yield 1;
+ yield 2; // ChangeMe
+};
diff --git a/t/t4018/javascript-dotexports-async-generator-function b/t/t4018/javascript-dotexports-async-generator-function
new file mode 100644
index 0000000000..5d352b5f29
--- /dev/null
+++ b/t/t4018/javascript-dotexports-async-generator-function
@@ -0,0 +1,5 @@
+exports.RIGHT = async function* ChangeMe() {
+
+ yield 1;
+ yield 2;
+}
diff --git a/t/t4018/javascript-dotexports-async-generator-function-2 b/t/t4018/javascript-dotexports-async-generator-function-2
new file mode 100644
index 0000000000..cddc4f9628
--- /dev/null
+++ b/t/t4018/javascript-dotexports-async-generator-function-2
@@ -0,0 +1,5 @@
+exports.RIGHT = async function *ChangeMe() {
+
+ yield 1;
+ yield 2;
+}
diff --git a/t/t4018/javascript-dotexports-function b/t/t4018/javascript-dotexports-function
new file mode 100644
index 0000000000..4c0c622d13
--- /dev/null
+++ b/t/t4018/javascript-dotexports-function
@@ -0,0 +1,4 @@
+exports.RIGHT = function ChangeMe(a, b) {
+
+ return a + b;
+};
diff --git a/t/t4018/javascript-dotexports-generator-anonymous-function b/t/t4018/javascript-dotexports-generator-anonymous-function
new file mode 100644
index 0000000000..4899abbb7b
--- /dev/null
+++ b/t/t4018/javascript-dotexports-generator-anonymous-function
@@ -0,0 +1,5 @@
+exports.RIGHT = function* () {
+
+ yield 1;
+ yield 2; // ChangeMe
+}
diff --git a/t/t4018/javascript-dotexports-generator-anonymous-function-2 b/t/t4018/javascript-dotexports-generator-anonymous-function-2
new file mode 100644
index 0000000000..1f1e9995b2
--- /dev/null
+++ b/t/t4018/javascript-dotexports-generator-anonymous-function-2
@@ -0,0 +1,5 @@
+exports.RIGHT = function *() {
+
+ yield 1;
+ yield 2; // ChangeMe
+};
diff --git a/t/t4018/javascript-dotexports-generator-function b/t/t4018/javascript-dotexports-generator-function
new file mode 100644
index 0000000000..837646cacc
--- /dev/null
+++ b/t/t4018/javascript-dotexports-generator-function
@@ -0,0 +1,5 @@
+exports.RIGHT = function* ChangeMe() {
+
+ yield 1;
+ yield 2;
+}
diff --git a/t/t4018/javascript-dotexports-generator-function-2 b/t/t4018/javascript-dotexports-generator-function-2
new file mode 100644
index 0000000000..0cc3729220
--- /dev/null
+++ b/t/t4018/javascript-dotexports-generator-function-2
@@ -0,0 +1,5 @@
+exports.RIGHT = function *ChangeMe() {
+
+ yield 1;
+ yield 2;
+}
diff --git a/t/t4018/javascript-export-arrow-function b/t/t4018/javascript-export-arrow-function
new file mode 100644
index 0000000000..098b457924
--- /dev/null
+++ b/t/t4018/javascript-export-arrow-function
@@ -0,0 +1,4 @@
+export const RIGHT = (a, b) => {
+
+ return a + b; // ChangeMe
+};
diff --git a/t/t4018/javascript-export-async-anonymous-assigned-function b/t/t4018/javascript-export-async-anonymous-assigned-function
new file mode 100644
index 0000000000..0a36b97838
--- /dev/null
+++ b/t/t4018/javascript-export-async-anonymous-assigned-function
@@ -0,0 +1,4 @@
+export const RIGHT = async function(a, b) {
+
+ return a + b; //ChangeMe
+};
diff --git a/t/t4018/javascript-export-async-arrow-function b/t/t4018/javascript-export-async-arrow-function
new file mode 100644
index 0000000000..557bcd1c23
--- /dev/null
+++ b/t/t4018/javascript-export-async-arrow-function
@@ -0,0 +1,4 @@
+export const RIGHT = async (a, b) => {
+
+ return a + b; // ChangeMe
+};
diff --git a/t/t4018/javascript-export-async-function b/t/t4018/javascript-export-async-function
new file mode 100644
index 0000000000..169f4eeed3
--- /dev/null
+++ b/t/t4018/javascript-export-async-function
@@ -0,0 +1,4 @@
+export async function RIGHT(a, b) {
+
+ return a + b; // ChangeMe
+}
\ No newline at end of file
diff --git a/t/t4018/javascript-export-async-generator-anonymous-assigned-function b/t/t4018/javascript-export-async-generator-anonymous-assigned-function
new file mode 100644
index 0000000000..11ee37b2bc
--- /dev/null
+++ b/t/t4018/javascript-export-async-generator-anonymous-assigned-function
@@ -0,0 +1,4 @@
+export const RIGHT = async function* () {
+ yield 1;
+ yield 2; // ChangeMe
+};
\ No newline at end of file
diff --git a/t/t4018/javascript-export-async-generator-anonymous-assigned-function-2 b/t/t4018/javascript-export-async-generator-anonymous-assigned-function-2
new file mode 100644
index 0000000000..6bff23ed2b
--- /dev/null
+++ b/t/t4018/javascript-export-async-generator-anonymous-assigned-function-2
@@ -0,0 +1,4 @@
+export const RIGHT = async function *() {
+ yield 1;
+ yield 2; // ChangeMe
+};
\ No newline at end of file
diff --git a/t/t4018/javascript-export-async-generator-assigned-function b/t/t4018/javascript-export-async-generator-assigned-function
new file mode 100644
index 0000000000..3d5b1e0879
--- /dev/null
+++ b/t/t4018/javascript-export-async-generator-assigned-function
@@ -0,0 +1,5 @@
+export const RIGHT = async function* ChangeMe() {
+
+ yield 1;
+ yield 2;
+};
diff --git a/t/t4018/javascript-export-async-generator-assigned-function-2 b/t/t4018/javascript-export-async-generator-assigned-function-2
new file mode 100644
index 0000000000..31c674f150
--- /dev/null
+++ b/t/t4018/javascript-export-async-generator-assigned-function-2
@@ -0,0 +1,5 @@
+export const RIGHT = async function *ChangeMe() {
+
+ yield 1;
+ yield 2;
+};
diff --git a/t/t4018/javascript-export-async-generator-function b/t/t4018/javascript-export-async-generator-function
new file mode 100644
index 0000000000..548589e597
--- /dev/null
+++ b/t/t4018/javascript-export-async-generator-function
@@ -0,0 +1,5 @@
+export async function* RIGHT() {
+
+ yield 1;
+ yield 2; // ChangeMe
+}
diff --git a/t/t4018/javascript-export-async-generator-function-2 b/t/t4018/javascript-export-async-generator-function-2
new file mode 100644
index 0000000000..99167142d7
--- /dev/null
+++ b/t/t4018/javascript-export-async-generator-function-2
@@ -0,0 +1,5 @@
+export async function *RIGHT() {
+
+ yield 1;
+ yield 2; // ChangeMe
+}
diff --git a/t/t4018/javascript-export-function b/t/t4018/javascript-export-function
new file mode 100644
index 0000000000..32f38c36c6
--- /dev/null
+++ b/t/t4018/javascript-export-function
@@ -0,0 +1,4 @@
+export function RIGHT(a, b) {
+
+ return a + b; // ChangeMe
+}
diff --git a/t/t4018/javascript-export-generator-assigned-function b/t/t4018/javascript-export-generator-assigned-function
new file mode 100644
index 0000000000..30398cd805
--- /dev/null
+++ b/t/t4018/javascript-export-generator-assigned-function
@@ -0,0 +1,6 @@
+export const RIGHT = function* () {
+
+ yield 1;
+ yield 2; // ChangeMe
+
+};
\ No newline at end of file
diff --git a/t/t4018/javascript-export-generator-assigned-function-2 b/t/t4018/javascript-export-generator-assigned-function-2
new file mode 100644
index 0000000000..04d2021af5
--- /dev/null
+++ b/t/t4018/javascript-export-generator-assigned-function-2
@@ -0,0 +1,6 @@
+export const RIGHT = function *() {
+
+ yield 1;
+ yield 2; // ChangeMe
+
+};
\ No newline at end of file
diff --git a/t/t4018/javascript-export-generator-function b/t/t4018/javascript-export-generator-function
new file mode 100644
index 0000000000..2ad38ff088
--- /dev/null
+++ b/t/t4018/javascript-export-generator-function
@@ -0,0 +1,5 @@
+export function* RIGHT() {
+
+ yield 1;
+ yield 2; // ChangeMe
+}
diff --git a/t/t4018/javascript-export-generator-function-2 b/t/t4018/javascript-export-generator-function-2
new file mode 100644
index 0000000000..56709a8ae9
--- /dev/null
+++ b/t/t4018/javascript-export-generator-function-2
@@ -0,0 +1,5 @@
+export function *RIGHT() {
+
+ yield 1;
+ yield 2; // ChangeMe
+}
diff --git a/t/t4018/javascript-module-dotexports-anonymous-function b/t/t4018/javascript-module-dotexports-anonymous-function
new file mode 100644
index 0000000000..56c1641edb
--- /dev/null
+++ b/t/t4018/javascript-module-dotexports-anonymous-function
@@ -0,0 +1,3 @@
+module.exports.RIGHT = function(a, b) {
+ return a + b; //ChangeMe
+};
diff --git a/t/t4018/javascript-module-dotexports-arrow-function b/t/t4018/javascript-module-dotexports-arrow-function
new file mode 100644
index 0000000000..32dc4f865d
--- /dev/null
+++ b/t/t4018/javascript-module-dotexports-arrow-function
@@ -0,0 +1,4 @@
+module.exports.RIGHT = (a, b) => {
+
+ return a+b; //ChangeMe
+};
diff --git a/t/t4018/javascript-module-dotexports-arrow-function-2 b/t/t4018/javascript-module-dotexports-arrow-function-2
new file mode 100644
index 0000000000..24d35f8d9e
--- /dev/null
+++ b/t/t4018/javascript-module-dotexports-arrow-function-2
@@ -0,0 +1,4 @@
+module.exports.RIGHT = a => {
+
+ return a+1; //ChangeMe
+};
diff --git a/t/t4018/javascript-module-dotexports-arrow-function-3 b/t/t4018/javascript-module-dotexports-arrow-function-3
new file mode 100644
index 0000000000..333b6c6ff4
--- /dev/null
+++ b/t/t4018/javascript-module-dotexports-arrow-function-3
@@ -0,0 +1 @@
+module.exports.RIGHT = a => a+1; //ChangeMe
diff --git a/t/t4018/javascript-module-dotexports-assigned-function b/t/t4018/javascript-module-dotexports-assigned-function
new file mode 100644
index 0000000000..fc43431c77
--- /dev/null
+++ b/t/t4018/javascript-module-dotexports-assigned-function
@@ -0,0 +1 @@
+module.exports.RIGHT = PreviousFunction; //ChangeMe
diff --git a/t/t4018/javascript-module-dotexports-async-arrow-function b/t/t4018/javascript-module-dotexports-async-arrow-function
new file mode 100644
index 0000000000..b7e3341c93
--- /dev/null
+++ b/t/t4018/javascript-module-dotexports-async-arrow-function
@@ -0,0 +1,3 @@
+module.exports.RIGHT = async (a, b) => {
+ return a + b; // ChangeMe
+};
diff --git a/t/t4018/javascript-module-dotexports-async-arrow-function-2 b/t/t4018/javascript-module-dotexports-async-arrow-function-2
new file mode 100644
index 0000000000..715d3e9560
--- /dev/null
+++ b/t/t4018/javascript-module-dotexports-async-arrow-function-2
@@ -0,0 +1,4 @@
+module.exports.RIGHT = async a => {
+
+ return a + 1; // ChangeMe
+};
diff --git a/t/t4018/javascript-module-dotexports-async-arrow-function-3 b/t/t4018/javascript-module-dotexports-async-arrow-function-3
new file mode 100644
index 0000000000..3a8ec728a9
--- /dev/null
+++ b/t/t4018/javascript-module-dotexports-async-arrow-function-3
@@ -0,0 +1 @@
+module.exports.RIGHT = async a => a + 1; // ChangeMe
diff --git a/t/t4018/javascript-module-dotexports-async-function b/t/t4018/javascript-module-dotexports-async-function
new file mode 100644
index 0000000000..b931331c1b
--- /dev/null
+++ b/t/t4018/javascript-module-dotexports-async-function
@@ -0,0 +1,4 @@
+module.exports.RIGHT = async function ChangeMe(a, b) {
+
+ return a + b; // ChangeMe
+}
diff --git a/t/t4018/javascript-module-dotexports-async-generator-anonymous-function b/t/t4018/javascript-module-dotexports-async-generator-anonymous-function
new file mode 100644
index 0000000000..66e0acf178
--- /dev/null
+++ b/t/t4018/javascript-module-dotexports-async-generator-anonymous-function
@@ -0,0 +1,5 @@
+module.exports.RIGHT = async function* () {
+
+ yield 1;
+ yield 2; // ChangeMe
+};
diff --git a/t/t4018/javascript-module-dotexports-async-generator-anonymous-function-2 b/t/t4018/javascript-module-dotexports-async-generator-anonymous-function-2
new file mode 100644
index 0000000000..c1cc0c1fce
--- /dev/null
+++ b/t/t4018/javascript-module-dotexports-async-generator-anonymous-function-2
@@ -0,0 +1,5 @@
+module.exports.RIGHT = async function *() {
+
+ yield 1;
+ yield 2; // ChangeMe
+};
diff --git a/t/t4018/javascript-module-dotexports-async-generator-function b/t/t4018/javascript-module-dotexports-async-generator-function
new file mode 100644
index 0000000000..9e1dbb5b65
--- /dev/null
+++ b/t/t4018/javascript-module-dotexports-async-generator-function
@@ -0,0 +1,5 @@
+module.exports.RIGHT = async function* ChangeMe() {
+
+ yield 1;
+ yield 2;
+}
diff --git a/t/t4018/javascript-module-dotexports-async-generator-function-2 b/t/t4018/javascript-module-dotexports-async-generator-function-2
new file mode 100644
index 0000000000..c886c6357b
--- /dev/null
+++ b/t/t4018/javascript-module-dotexports-async-generator-function-2
@@ -0,0 +1,5 @@
+module.exports.RIGHT = async function *ChangeMe() {
+
+ yield 1;
+ yield 2;
+}
diff --git a/t/t4018/javascript-module-dotexports-function b/t/t4018/javascript-module-dotexports-function
new file mode 100644
index 0000000000..6b30d5ea98
--- /dev/null
+++ b/t/t4018/javascript-module-dotexports-function
@@ -0,0 +1,4 @@
+module.exports.RIGHT = function ChangeMe(a, b) {
+
+ return a + b;
+};
diff --git a/t/t4018/javascript-module-dotexports-generator-anonymous-function b/t/t4018/javascript-module-dotexports-generator-anonymous-function
new file mode 100644
index 0000000000..c77f32ac64
--- /dev/null
+++ b/t/t4018/javascript-module-dotexports-generator-anonymous-function
@@ -0,0 +1,5 @@
+module.exports.RIGHT = function* () {
+
+ yield 1;
+ yield 2; // ChangeMe
+}
diff --git a/t/t4018/javascript-module-dotexports-generator-anonymous-function-2 b/t/t4018/javascript-module-dotexports-generator-anonymous-function-2
new file mode 100644
index 0000000000..318be0c172
--- /dev/null
+++ b/t/t4018/javascript-module-dotexports-generator-anonymous-function-2
@@ -0,0 +1,5 @@
+module.exports.RIGHT = function *() {
+
+ yield 1;
+ yield 2; // ChangeMe
+};
diff --git a/t/t4018/javascript-module-dotexports-generator-function b/t/t4018/javascript-module-dotexports-generator-function
new file mode 100644
index 0000000000..839a6f16dc
--- /dev/null
+++ b/t/t4018/javascript-module-dotexports-generator-function
@@ -0,0 +1,5 @@
+module.exports.RIGHT = function* ChangeMe() {
+
+ yield 1;
+ yield 2;
+}
\ No newline at end of file
diff --git a/t/t4018/javascript-module-dotexports-generator-function-2 b/t/t4018/javascript-module-dotexports-generator-function-2
new file mode 100644
index 0000000000..a70100a26b
--- /dev/null
+++ b/t/t4018/javascript-module-dotexports-generator-function-2
@@ -0,0 +1,5 @@
+module.exports.RIGHT = function *ChangeMe() {
+
+ yield 1;
+ yield 2;
+}
--
2.50.0.rc0.62.g658f0ae201.dirty
^ permalink raw reply related
* [PATCH v2 1/4] userdiff: add javascript diff driver
From: Derick W. de M. Frias @ 2025-06-23 6:35 UTC (permalink / raw)
To: j6t; +Cc: derick.william.moraes, git
In-Reply-To: <20250623090538.154858-1-derick.william.moraes@gmail.com>
Add diff pattern for JavaScript programming language and documentation.
Signed-off-by: Derick W. de M. Frias <derick.william.moraes@gmail.com>
---
Documentation/gitattributes.adoc | 2 ++
userdiff.c | 62 ++++++++++++++++++--------------
2 files changed, 38 insertions(+), 26 deletions(-)
diff --git a/Documentation/gitattributes.adoc b/Documentation/gitattributes.adoc
index f20041a323..b7075ccb29 100644
--- a/Documentation/gitattributes.adoc
+++ b/Documentation/gitattributes.adoc
@@ -891,6 +891,8 @@ patterns are available:
- `java` suitable for source code in the Java language.
+- `javascript` suitable for source code in the JavaScript language.
+
- `kotlin` suitable for source code in the Kotlin language.
- `markdown` suitable for Markdown documents.
diff --git a/userdiff.c b/userdiff.c
index 94134e5b09..0d352bc722 100644
--- a/userdiff.c
+++ b/userdiff.c
@@ -238,33 +238,43 @@ PATTERNS("java",
"|[-+*/<>%&^|=!]="
"|--|\\+\\+|<<=?|>>>?=?|&&|\\|\\|"),
PATTERNS("javascript",
- /* conventional named functions */
- "^[ \t]*(async[ \t]+)?function[ \t]*\\*?[ \t]*([$_a-zA-Z][$_a-zA-Z0-9]*)[ \t]*\\(.*$|"
- /* assigned functions */
- "^[ \t]*(const|let|var)[ \t]+([$_a-zA-Z][$_a-zA-Z0-9]*)[ \t]*="
- "[ \t]*(async[ \t]+)?function[ \t]*\\*?[ \t]*([$_a-zA-Z][$_a-zA-Z0-9]*)?[ \t]*\\(.*$|"
- /* arrow functions */
- "^[ \t]*(const|let|var)[ \t]+([$_a-zA-Z][$_a-zA-Z0-9]*)[ \t]*="
- "[ \t]*(\\([^\\)]*\\)|[$_a-zA-Z][$_a-zA-Z0-9]*)[ \t]*=>[ \t]*\\{?.*$|"
- /* functions declared inside classes and objects */
- "^[ \t]*(static[ \t]+)?(async[ \t]+)?(get[ \t]+|set[ \t]+)?\\*?[ \t]*"
- "([$_a-zA-Z][$_a-zA-Z0-9]*)[ \t]*\\([^)]*\\)[ \t]*\\{.*$",
- /* identifiers */
- "[$_A-Za-z][$_A-Za-z0-9]*|"
- /* hexadecimal and big hexadecimal */
- "0[xX](?:[0-9a-fA-F](?:_?[0-9a-fA-F])*)n?|"
- /* octa and big octa */
- "0[oO](?:[0-7](?:_?[0-7])*)n?|"
- /* binary and big binary */
- "0[bB](?:[01](?:_?[01])*)n?|"
- /* decimal, floting point and exponent notation (eE) */
- "(?:0|[1-9](?:_?[0-9])*)(?:\\.(?:[0-9](?:_?[0-9])*))?(?:[eE][+-]?(?:[0-9](?:_?[0-9])*))?|"
- /* big decimal */
- "(?:0|[1-9](?:_?[0-9])*)n|"
+ /* don't match reserved expressions that have function-like syntax */
+ "!^[ \t]*(if|do|while|for|with|switch|catch|import|return)\n"
+ /* matches conventional named functions, that can also be async and/or have export */
+ "^[ \t]*(export[ \t]+)?(async[ \t]+)?function[ \t]*\\*?[ \t]*"
+ "([$_a-zA-Z][$_a-zA-Z0-9]*)[ \t]*\\(.*$"
+ /* matches assigned exports */
+ "|^[ \t]*export[ \t]*(const|default)[ \t]*([$_a-zA-Z][$_a-zA-Z0-9]*)[ \t]*="
+ /* matches assigned functions */
+ "|^[ \t]*(const|let|var)[ \t]+([$_a-zA-Z][$_a-zA-Z0-9]*)[ \t]*=[ \t]*"
+ "(async[ \t]+)?function[ \t]*\\*?[ \t]*([$_a-zA-Z][$_a-zA-Z0-9]*)?[ \t]*\\(.*$"
+ /* arrow functions */
+ "|^[ \t]*(const|let|var)[ \t]+([$_a-zA-Z][$_a-zA-Z0-9]*)[ \t]*=[ \t]*"
+ "(\\([^\\)]*\\)|[$_a-zA-Z][$_a-zA-Z0-9]*)[ \t]*=>[ \t]*\\{?.*$"
+ /* matches functions declared inside classes and objects */
+ "|^[ \t]*(static[ \t]+)?(async[ \t]+)?(get[ \t]+|set[ \t]+)?\\*?[ \t]*"
+ "([$_a-zA-Z][$_a-zA-Z0-9]*)[ \t]*\\([^)]*\\)[ \t]*\\{.*$"
+ /* matches functions created or assigned in 'exports.' or 'module.exports.' context*/
+ "|^[ \t]*(module.)?exports.([$_a-zA-Z][$_a-zA-Z0-9]*)[ \t]*="
+ "([ \t]*(async[ \t]+)?(function)?[ \t]*\\*?[ \t]*"
+ "([$_a-zA-Z][$_a-zA-Z0-9]*)?[ \t]*\\(.*$"
+ "|[ \t]*([$_a-zA-Z][$_a-zA-Z0-9]*);"
+ "|[ \t]*(async[ \t]+)?([$_a-zA-Z][$_a-zA-Z0-9]*)[ \t]*=>)",
+ /* identifiers */
+ "[$_A-Za-z][$_A-Za-z0-9]*"
+ /* hexadecimal and big hexadecimal */
+ "|0[xX](?:[0-9a-fA-F](?:_?[0-9a-fA-F])*)n?"
+ /* octa and big octa */
+ "|0[oO](?:[0-7](?:_?[0-7])*)n?"
+ /* binary and big binary */
+ "|0[bB](?:[01](?:_?[01])*)n?"
+ /* decimal, floting point and exponent notation (eE) */
+ "|(?:0|[1-9](?:_?[0-9])*)(?:\\.(?:[0-9](?:_?[0-9])*))?(?:[eE][+-]?(?:[0-9](?:_?[0-9])*))?"
+ /* big decimal */
+ "|(?:0|[1-9](?:_?[0-9])*)n"
/* punctuation */
- "\\{|\\}|\\(|\\)|\\.|\\.{3}|;|,|<|>|<=|>=|==|!=|={3}|!==|\\+|-|\\*|/|%|\\*{2}|"
- "\\+{2}|--|<<|>>|>>>|&|\\||\\^|!|~|&&|\\|{2}|\\?{1,2}|:|=|\\+=|-=|\\*=|%=|\\*{2}=|"
- "<<=|>>=|>>>=|&=|\\|=|\\^=|&&=|\\|{2}=|\\?{2}=|=>"),
+ "|\\.{3}|<=|>=|==|!=|===|!==|\\*{2}|\\+{2}|--|<<|>>|>>>|&&|\\|{2}|\\?{2}|\\+=|-="
+ "|\\*=|%=|\\*{2}=|<<=|>>=|>>>=|&=|\\|=|\\^=|&&=|\\|{2}=|\\?{2}=|=>"),
PATTERNS("kotlin",
"^[ \t]*(([a-z]+[ \t]+)*(fun|class|interface)[ \t]+.*)$",
/* -- */
--
2.50.0.rc0.62.g658f0ae201.dirty
^ permalink raw reply related
* [PATCH v2 3/4] t4018: add tests for recognizing javascript function syntax
From: Derick W. de M. Frias @ 2025-06-23 6:35 UTC (permalink / raw)
To: j6t; +Cc: derick.william.moraes, git
In-Reply-To: <20250623090538.154858-1-derick.william.moraes@gmail.com>
Add tests for javascript function declarations as in ECMAScript ES5.1<
Signed-off-by: Derick W. de M. Frias <derick.william.moraes@gmail.com>
---
.../javascript-anonymous-assigned-function | 4 ++
t/t4018/javascript-arrow-assigned-function | 4 ++
t/t4018/javascript-arrow-assigned-function-2 | 5 +++
t/t4018/javascript-arrow-assigned-function-3 | 1 +
t/t4018/javascript-assigned-function | 4 ++
t/t4018/javascript-async-assigned-function | 4 ++
t/t4018/javascript-async-function | 4 +-
t/t4018/javascript-class-get-function | 5 +++
t/t4018/javascript-class-set-function | 5 +++
t/t4018/javascript-class-static-function | 5 +++
t/t4018/javascript-class-unprefixed-function | 6 +++
t/t4018/javascript-function | 4 +-
.../javascript-generator-assigned-function | 5 +++
.../javascript-generator-assigned-function-2 | 5 +++
t/t4018/javascript-generator-function | 4 +-
t/t4018/javascript-generator-function-2 | 4 +-
t/t4018/javascript-method-unprefixed-function | 6 +++
t/t4018/javascript-skip-function-calls | 7 ++++
t/t4018/javascript-skip-reserved-words | 38 +++++++++++++++++++
19 files changed, 112 insertions(+), 8 deletions(-)
create mode 100644 t/t4018/javascript-anonymous-assigned-function
create mode 100644 t/t4018/javascript-arrow-assigned-function
create mode 100644 t/t4018/javascript-arrow-assigned-function-2
create mode 100644 t/t4018/javascript-arrow-assigned-function-3
create mode 100644 t/t4018/javascript-assigned-function
create mode 100644 t/t4018/javascript-async-assigned-function
create mode 100644 t/t4018/javascript-class-get-function
create mode 100644 t/t4018/javascript-class-set-function
create mode 100644 t/t4018/javascript-class-static-function
create mode 100644 t/t4018/javascript-class-unprefixed-function
create mode 100644 t/t4018/javascript-generator-assigned-function
create mode 100644 t/t4018/javascript-generator-assigned-function-2
create mode 100644 t/t4018/javascript-method-unprefixed-function
create mode 100644 t/t4018/javascript-skip-function-calls
create mode 100644 t/t4018/javascript-skip-reserved-words
diff --git a/t/t4018/javascript-anonymous-assigned-function b/t/t4018/javascript-anonymous-assigned-function
new file mode 100644
index 0000000000..c9127e231d
--- /dev/null
+++ b/t/t4018/javascript-anonymous-assigned-function
@@ -0,0 +1,4 @@
+const RIGHT = function (a, b) {
+
+ return a + b; //ChangeMe
+};
diff --git a/t/t4018/javascript-arrow-assigned-function b/t/t4018/javascript-arrow-assigned-function
new file mode 100644
index 0000000000..3182197aee
--- /dev/null
+++ b/t/t4018/javascript-arrow-assigned-function
@@ -0,0 +1,4 @@
+const RIGHT = (a, b) => {
+
+ return a + b; //ChangeMe
+};
diff --git a/t/t4018/javascript-arrow-assigned-function-2 b/t/t4018/javascript-arrow-assigned-function-2
new file mode 100644
index 0000000000..b5732967c0
--- /dev/null
+++ b/t/t4018/javascript-arrow-assigned-function-2
@@ -0,0 +1,5 @@
+const RIGHT = a => {
+
+ return a + 1; //ChangeMe
+};
+
diff --git a/t/t4018/javascript-arrow-assigned-function-3 b/t/t4018/javascript-arrow-assigned-function-3
new file mode 100644
index 0000000000..98ee879dd2
--- /dev/null
+++ b/t/t4018/javascript-arrow-assigned-function-3
@@ -0,0 +1 @@
+const RIGHT = a => a+1; //ChangeMe
diff --git a/t/t4018/javascript-assigned-function b/t/t4018/javascript-assigned-function
new file mode 100644
index 0000000000..170d54db4f
--- /dev/null
+++ b/t/t4018/javascript-assigned-function
@@ -0,0 +1,4 @@
+const RIGHT = function test (a, b) {
+
+ return a + b; //ChangeMe
+};
diff --git a/t/t4018/javascript-async-assigned-function b/t/t4018/javascript-async-assigned-function
new file mode 100644
index 0000000000..1c1923b336
--- /dev/null
+++ b/t/t4018/javascript-async-assigned-function
@@ -0,0 +1,4 @@
+const RIGHT = async function (a, b) {
+
+ return a + b; //ChangeMe
+};
diff --git a/t/t4018/javascript-async-function b/t/t4018/javascript-async-function
index 7f99b8c89a..740e5304aa 100644
--- a/t/t4018/javascript-async-function
+++ b/t/t4018/javascript-async-function
@@ -1,4 +1,4 @@
async function RIGHT (a, b) {
- return a + b;
-};
\ No newline at end of file
+ return a + b; //ChangeMe
+};
diff --git a/t/t4018/javascript-class-get-function b/t/t4018/javascript-class-get-function
new file mode 100644
index 0000000000..e27fa81478
--- /dev/null
+++ b/t/t4018/javascript-class-get-function
@@ -0,0 +1,5 @@
+class ChangeMe {
+ get RIGHT() {
+ return 1;
+ }
+}
diff --git a/t/t4018/javascript-class-set-function b/t/t4018/javascript-class-set-function
new file mode 100644
index 0000000000..ba747db7c7
--- /dev/null
+++ b/t/t4018/javascript-class-set-function
@@ -0,0 +1,5 @@
+class ChangeMe {
+ set RIGHT() {
+ return 1;
+ }
+}
diff --git a/t/t4018/javascript-class-static-function b/t/t4018/javascript-class-static-function
new file mode 100644
index 0000000000..b3c8f1ff2a
--- /dev/null
+++ b/t/t4018/javascript-class-static-function
@@ -0,0 +1,5 @@
+class ChangeMe {
+ static RIGHT(a, b) {
+ return a + b;
+ }
+}
diff --git a/t/t4018/javascript-class-unprefixed-function b/t/t4018/javascript-class-unprefixed-function
new file mode 100644
index 0000000000..675c787995
--- /dev/null
+++ b/t/t4018/javascript-class-unprefixed-function
@@ -0,0 +1,6 @@
+class Test {
+ RIGHT() {
+ let a = 1;
+ let b = ChangeMe;
+ }
+}
diff --git a/t/t4018/javascript-function b/t/t4018/javascript-function
index d11ad34aff..bd7945ca2b 100644
--- a/t/t4018/javascript-function
+++ b/t/t4018/javascript-function
@@ -1,4 +1,4 @@
function RIGHT (a, b) {
- return a + b;
-};
\ No newline at end of file
+ return a + b; //ChangeMe
+};
diff --git a/t/t4018/javascript-generator-assigned-function b/t/t4018/javascript-generator-assigned-function
new file mode 100644
index 0000000000..c5ff9d89b5
--- /dev/null
+++ b/t/t4018/javascript-generator-assigned-function
@@ -0,0 +1,5 @@
+const RIGHT = function* (){
+
+ yield 1;
+ yield 2; //ChangeMe
+}
diff --git a/t/t4018/javascript-generator-assigned-function-2 b/t/t4018/javascript-generator-assigned-function-2
new file mode 100644
index 0000000000..8ce7567987
--- /dev/null
+++ b/t/t4018/javascript-generator-assigned-function-2
@@ -0,0 +1,5 @@
+const RIGHT = function *(){
+
+ yield 1;
+ yield 2; //ChangeMe
+}
diff --git a/t/t4018/javascript-generator-function b/t/t4018/javascript-generator-function
index af7cbb50a3..9a24ae7d08 100644
--- a/t/t4018/javascript-generator-function
+++ b/t/t4018/javascript-generator-function
@@ -1,5 +1,5 @@
function* RIGHT() {
yield 1;
- yield 2;
-}
\ No newline at end of file
+ yield 2; //ChangeMe
+}
diff --git a/t/t4018/javascript-generator-function-2 b/t/t4018/javascript-generator-function-2
index d40b395f5c..bac71e362c 100644
--- a/t/t4018/javascript-generator-function-2
+++ b/t/t4018/javascript-generator-function-2
@@ -1,5 +1,5 @@
function *RIGHT() {
yield 1;
- yield 2;
-}
\ No newline at end of file
+ yield 2; //ChangeMe
+}
diff --git a/t/t4018/javascript-method-unprefixed-function b/t/t4018/javascript-method-unprefixed-function
new file mode 100644
index 0000000000..eb6300dda3
--- /dev/null
+++ b/t/t4018/javascript-method-unprefixed-function
@@ -0,0 +1,6 @@
+const Test = {
+ RIGHT() {
+ let a = 1;
+ let b = ChangeMe;
+ }
+}
diff --git a/t/t4018/javascript-skip-function-calls b/t/t4018/javascript-skip-function-calls
new file mode 100644
index 0000000000..cc9699a9f5
--- /dev/null
+++ b/t/t4018/javascript-skip-function-calls
@@ -0,0 +1,7 @@
+class Test {
+ static RIGHT() {
+ call_to_skip();
+ call_to_skip2();
+ let a = ChangeMe;
+ }
+}
\ No newline at end of file
diff --git a/t/t4018/javascript-skip-reserved-words b/t/t4018/javascript-skip-reserved-words
new file mode 100644
index 0000000000..d12fe587a8
--- /dev/null
+++ b/t/t4018/javascript-skip-reserved-words
@@ -0,0 +1,38 @@
+function RIGHT(a, b) {
+ import("./async1")
+
+ if (a > 1) {
+ // ...
+ }
+ do {
+ // ...
+ }
+ while (i < 5){
+ //
+ };
+ for (const element of array1) {
+ console.log(element)
+ }
+ with(o) {
+ console.log(x)
+ }
+ switch (expr) {
+ case 'a':
+ // ...
+ break;
+ case 'b':
+ // ...
+ break;
+ default:
+ // ...
+ }
+ try {
+ // ...
+ return (a + c)
+ }
+ catch (error) {
+ // ...
+ }
+
+ return a + b; // ChangeMe
+}
--
2.50.0.rc0.62.g658f0ae201.dirty
^ permalink raw reply related
* [PATCH v2 2/4] t4034: add tests for javascript word literals
From: Derick W. de M. Frias @ 2025-06-23 6:35 UTC (permalink / raw)
To: j6t; +Cc: derick.william.moraes, git
In-Reply-To: <20250623090538.154858-1-derick.william.moraes@gmail.com>
Add tests for javascript word pattern.
Signed-off-by: Derick W. de M. Frias <derick.william.moraes@gmail.com>
---
t/t4034-diff-words.sh | 1 +
t/t4034/javascript/expect | 26 ++++++++++++++++++++++----
t/t4034/javascript/post | 16 ++++++++++++----
t/t4034/javascript/pre | 16 ++++++++++++----
4 files changed, 47 insertions(+), 12 deletions(-)
diff --git a/t/t4034-diff-words.sh b/t/t4034-diff-words.sh
index 0be647c2fb..5bf1294f27 100755
--- a/t/t4034-diff-words.sh
+++ b/t/t4034-diff-words.sh
@@ -328,6 +328,7 @@ test_language_driver dts
test_language_driver fortran
test_language_driver html
test_language_driver java
+test_language_driver javascript
test_language_driver kotlin
test_language_driver matlab
test_language_driver objc
diff --git a/t/t4034/javascript/expect b/t/t4034/javascript/expect
index cc5e1253f6..98b057c48a 100644
--- a/t/t4034/javascript/expect
+++ b/t/t4034/javascript/expect
@@ -43,12 +43,30 @@
<GREEN>0B0010<RESET>
<GREEN>0b0001_1101_0011<RESET>
<GREEN>0b11111111111111000011111111111111111n<RESET>
+// Floating point and exponent notation<RESET>
+<RED>3.14<RESET>
+<RED>0.5<RESET>
+<RED>1.23e3<RESET>
+<RED>4.56e-2<RESET>
+<RED>7.89E4<RESET>
+<RED>0.12E-1<RESET>
+<RED>5e2<RESET>
+<RED>7e-3<RESET>
+<RED>6E3<RESET>
+<RED>9E-3<RESET>
+<GREEN>3.15<RESET>
+<GREEN>0.75<RESET>
+<GREEN>1.23e4<RESET>
+<GREEN>4.96e-3<RESET>
+<GREEN>7.89E8<RESET>
+<GREEN>0.11E-2<RESET>
+<GREEN>6e3<RESET>
+<GREEN>8e-2<RESET>
+<GREEN>7E4<RESET>
+<GREEN>2E-6<RESET>
// punctuations<RESET>
-{<RED>a<RESET><GREEN>b<RESET>} (<RED>a<RESET><GREEN>b<RESET>)
-<RED>a<RESET><GREEN>b<RESET>;
-[<RED>1,<RESET>2<GREEN>,3<RESET>]
[<RED>1, 2,<RESET> ...<RED>params<RESET><GREEN>params_v2<RESET> ]
a<RED><=<RESET><GREEN>=<RESET>2 a<RED>>=<RESET><GREEN>=<RESET>2 a<RED>==<RESET><GREEN>=<RESET>2 a<RED>!=<RESET><GREEN>=<RESET>2 a<RED>===<RESET><GREEN>=<RESET>2 a<RED>!==<RESET><GREEN>=<RESET>2 a<RED>^=<RESET><GREEN>=<RESET>2 a<RED>=><RESET><GREEN>=<RESET>2
a<RED>+=<RESET><GREEN>-=<RESET>b a<RED>*=<RESET><GREEN>%=<RESET>b a<RED>**=<RESET><GREEN>&&=<RESET>b a<RED>||=<RESET><GREEN>|=<RESET>b
b<RED>+<RESET><GREEN>-<RESET>c a<RED>--<RESET><GREEN>++<RESET> a<RED>>><RESET><GREEN><<<RESET>b a<RED>>>><RESET><GREEN>>>>=<RESET>b a<RED>>>=<RESET><GREEN><<=<RESET>b
-a<RED>&&<RESET><GREEN>&<RESET>b a<RED>||<RESET><GREEN>|<RESET>b a<RED>&&=<RESET><GREEN>??=<RESET>b
\ No newline at end of file
+a<RED>&&<RESET><GREEN>&<RESET>b a<RED>||<RESET><GREEN>|<RESET>b a<RED>&&=<RESET><GREEN>??=<RESET>b
diff --git a/t/t4034/javascript/post b/t/t4034/javascript/post
index 9d66c9dc91..12165198ad 100644
--- a/t/t4034/javascript/post
+++ b/t/t4034/javascript/post
@@ -22,12 +22,20 @@
0B0010
0b0001_1101_0011
0b11111111111111000011111111111111111n
+// Floating point and exponent notation
+3.15
+0.75
+1.23e4
+4.96e-3
+7.89E8
+0.11E-2
+6e3
+8e-2
+7E4
+2E-6
// punctuations
-{b} (b)
-b;
-[2,3]
[ ...params_v2 ]
a=2 a=2 a=2 a=2 a=2 a=2 a=2 a=2
a-=b a%=b a&&=b a|=b
b-c a++ a<<b a>>>=b a<<=b
-a&b a|b a??=b
\ No newline at end of file
+a&b a|b a??=b
diff --git a/t/t4034/javascript/pre b/t/t4034/javascript/pre
index 9876514042..43d5908e09 100644
--- a/t/t4034/javascript/pre
+++ b/t/t4034/javascript/pre
@@ -22,12 +22,20 @@
0B0110
0b0001_1001_0011
0b1111111111111111111111111111111111111n
+// Floating point and exponent notation
+3.14
+0.5
+1.23e3
+4.56e-2
+7.89E4
+0.12E-1
+5e2
+7e-3
+6E3
+9E-3
// punctuations
-{a} (a)
-a;
-[1,2]
[ 1, 2, ...params ]
a<=2 a>=2 a==2 a!=2 a===2 a!==2 a^=2 a=>2
a+=b a*=b a**=b a||=b
b+c a-- a>>b a>>>b a>>=b
-a&&b a||b a&&=b
\ No newline at end of file
+a&&b a||b a&&=b
--
2.50.0.rc0.62.g658f0ae201.dirty
^ permalink raw reply related
* [PATCH v2 0/4] diff: create pattern for javascript language
From: Derick W. de M. Frias @ 2025-06-23 6:35 UTC (permalink / raw)
To: j6t; +Cc: derick.william.moraes, git
In-Reply-To: <4deb24c2-98f2-40f8-b50c-c74485ebc10d@kdbg.org>
I'm sending a new version of the diff driver. I tried to expand
recognition of functions to more possible cases, improved tests in
t4018 for function matching of the pattern and tried to add test
t4034 for the matching of words.
I added a lot more test for t4018, so much that I got caught up if I
was exaggerating. I was not trying to exhaust all possibilities, I just think
that javascript has a lot of different valid syntaxes for declaring
functions and I was trying to make a somewhat complete coverage of that.
Let me know if perhaps I'm going too far along this direction.
I also tried to incorporate your feedbacks, thanks!
> Thank you for your contribution. We have had a number of submissions for
> Javascript or Typescript drivers in the past, but none of them were
> followed through to be integrated.
> Typescript:
> https://lore.kernel.org/git/20240404163827.5855-1-utsavp0213@gmail.com/
> https://lore.kernel.org/git/pull.1746.git.git.1721061218993.gitgitgadget@gmail.com/
> Javascript:
> https://lore.kernel.org/git/20240301074048.188835-1-sergiusnyah@gmail.com/
> https://lore.kernel.org/git/20220403132508.28196-1-a97410985new@gmail.com/
> Please review these submission and the responses that they received.
> Perhaps you can find inspiration for improvement from them.
It has beeing great fun :)! I took a deep dive into the suggested
submissions. For clarity purposes, I'll be addressing them for the
following index, and sometimes for the contributor's name:
[1] Utsav Parmar: https://lore.kernel.org/git/20240404163827.5855-1-utsavp0213@gmail.com/
[2] Mattew Hughes: https://lore.kernel.org/git/pull.1746.git.git.1721061218993.gitgitgadget@gmail.com/
[3] Sergius Nyah: https://lore.kernel.org/git/20240301074048.188835-1-sergiusnyah@gmail.com/
[4] Xing Zhi Jiang: https://lore.kernel.org/git/20220403132508.28196-1-a97410985new@gmail.com/
From contributions [1], [2] and [3] I did not found many things that are
worth noting.
Previous to sending the v1, I had already searched through the lore and
stumbled across Xing Zhi Jiang's[4] contribution. He had a lot of things
worked out, including well recognized nested functions, that is
something still not supported here in v2. Also the discutions around it
brought up interesting points that I took into consideration:
- ESModules syntax for exporting functions (export function FUNCNAME...)
- 'exports.' and 'module.exports.' syntax from commonJS.
- What should and what should not be supported.
I called 'vanillaJS' javascript as it is defined by ECMAScript's specs,
or what you will find if you are working with JS without things like
React, Vue, jQuery, Axios. I noticed that I used this term in the last
submission but had not explained what I was talking about. There I said
I wanted to be "vanillaJS" first, as I believe ECMAs specs should be the
focal point of a tool like this one.
This is important, because some things that live outside 'vanillaJS', like
'commonJS' for example, which is a thing in Node, add syntax to valid
function declarations in their own context. Exhausting those syntaxes might
be impossible, and I belive it's not the way to go here. Also, it would be
huge work and I don't believe that I have JS knowledge extensive enough to
do so.
As it was pointed out inside [4] discutions, it would be nice if a
heavilly spread syntax like 'export.' and 'module.export.' from
'commonJS' were supported, even thought it is not ECMA, because it would
benefit users in more diverse situations, which I agree. That is why I
tried adding support to recognize them.
Xing tried to add in v3 patterns for supporting jQuery. As I don't have
experience working, it is not added here. Like in the above paragraph, I
think it would greatly benefit a lot of developers if jQuery was
supported, but that raised the discussion:
What this pattern should aim to give support to outside vanillaJS,
if it should? And if yes, where do we draw the line to define what is
widespread enough to be supported? I want to know your toughts on it.
> You do not have to include single-character punctuation; these are
> recognized as words automatically.
> Personally I prefer |===| over |={3}| (and similar for the others)
> because it is easier to understand.
In userdiff.c, I cleaned from the pattern the single character punctuation
identifiers and I improved the syntax of some other identifiers (Like ={3} --> ===).
For scaped punctuations, I kept the syntax with {} as I believe it reads
more clearly (Like \\.{3} instead of \\.\\.\\.}.
> I didn't see any test cases dealing with nested functions, which might
> add some value?
I agree it would add value. As I said, [4] had it working and for the moment
but I still could not understand the strategy and what part of the regex dealt
with it. In his v1, Xing talks about 3 negations rules he added
to the matching pattern. I think that this is the part responsible for
solving the problem, but I don't understand how. I would appreciate if
someone took a little time to maybe figure it out.
> We avoid incomplete last lines in this code base if it is not mandated
> for some reason.
I put a blank line at the end of all files in this submission.
> Here and in the later test cases, the word "ChangeMe" is missing. How
> did these ever pass the tests?
Here Johannes was reffering to the t4018 test cases which were missing
"ChangeMe", it was a mistake from my part. This time I added "ChangeMe"
to the t4018 tests.
Derick W. de M. Frias (4):
userdiff: add javascript diff driver
t4034: add tests for javascript word literals
t4018: add tests for recognizing javascript function syntax
t4018: add tests for javascript 'exports.', 'module.exports' and
'export' type functions
Documentation/gitattributes.adoc | 2 +
.../javascript-anonymous-assigned-function | 4 ++
t/t4018/javascript-arrow-assigned-function | 4 ++
t/t4018/javascript-arrow-assigned-function-2 | 5 ++
t/t4018/javascript-arrow-assigned-function-3 | 1 +
t/t4018/javascript-assigned-function | 4 ++
t/t4018/javascript-async-assigned-function | 4 ++
t/t4018/javascript-async-function | 4 +-
t/t4018/javascript-class-get-function | 5 ++
t/t4018/javascript-class-set-function | 5 ++
t/t4018/javascript-class-static-function | 5 ++
t/t4018/javascript-class-unprefixed-function | 6 ++
...ascript-dotexpors-async-anonymous-function | 3 +
.../javascript-dotexports-anonymous-function | 3 +
t/t4018/javascript-dotexports-arrow-function | 4 ++
.../javascript-dotexports-arrow-function-2 | 4 ++
.../javascript-dotexports-arrow-function-3 | 1 +
.../javascript-dotexports-assigned-function | 1 +
...javascript-dotexports-async-arrow-function | 3 +
...vascript-dotexports-async-arrow-function-2 | 4 ++
...vascript-dotexports-async-arrow-function-3 | 1 +
t/t4018/javascript-dotexports-async-function | 4 ++
...exports-async-generator-anonymous-function | 5 ++
...ports-async-generator-anonymous-function-2 | 5 ++
...script-dotexports-async-generator-function | 5 ++
...ript-dotexports-async-generator-function-2 | 5 ++
t/t4018/javascript-dotexports-function | 4 ++
...pt-dotexports-generator-anonymous-function | 5 ++
...-dotexports-generator-anonymous-function-2 | 5 ++
.../javascript-dotexports-generator-function | 5 ++
...javascript-dotexports-generator-function-2 | 5 ++
t/t4018/javascript-export-arrow-function | 4 ++
...t-export-async-anonymous-assigned-function | 4 ++
.../javascript-export-async-arrow-function | 4 ++
t/t4018/javascript-export-async-function | 4 ++
...sync-generator-anonymous-assigned-function | 4 ++
...nc-generator-anonymous-assigned-function-2 | 4 ++
...t-export-async-generator-assigned-function | 5 ++
...export-async-generator-assigned-function-2 | 5 ++
...javascript-export-async-generator-function | 5 ++
...vascript-export-async-generator-function-2 | 5 ++
t/t4018/javascript-export-function | 4 ++
...ascript-export-generator-assigned-function | 6 ++
...cript-export-generator-assigned-function-2 | 6 ++
t/t4018/javascript-export-generator-function | 5 ++
.../javascript-export-generator-function-2 | 5 ++
t/t4018/javascript-function | 4 +-
.../javascript-generator-assigned-function | 5 ++
.../javascript-generator-assigned-function-2 | 5 ++
t/t4018/javascript-generator-function | 4 +-
t/t4018/javascript-generator-function-2 | 4 +-
t/t4018/javascript-method-unprefixed-function | 6 ++
...cript-module-dotexports-anonymous-function | 3 +
...avascript-module-dotexports-arrow-function | 4 ++
...ascript-module-dotexports-arrow-function-2 | 4 ++
...ascript-module-dotexports-arrow-function-3 | 1 +
...script-module-dotexports-assigned-function | 1 +
...ipt-module-dotexports-async-arrow-function | 3 +
...t-module-dotexports-async-arrow-function-2 | 4 ++
...t-module-dotexports-async-arrow-function-3 | 1 +
...avascript-module-dotexports-async-function | 4 ++
...exports-async-generator-anonymous-function | 5 ++
...ports-async-generator-anonymous-function-2 | 5 ++
...module-dotexports-async-generator-function | 5 ++
...dule-dotexports-async-generator-function-2 | 5 ++
t/t4018/javascript-module-dotexports-function | 4 ++
...le-dotexports-generator-anonymous-function | 5 ++
...-dotexports-generator-anonymous-function-2 | 5 ++
...cript-module-dotexports-generator-function | 5 ++
...ipt-module-dotexports-generator-function-2 | 5 ++
t/t4018/javascript-skip-function-calls | 7 +++
t/t4018/javascript-skip-reserved-words | 38 ++++++++++++
t/t4034-diff-words.sh | 1 +
t/t4034/javascript/expect | 26 ++++++--
t/t4034/javascript/post | 16 +++--
t/t4034/javascript/pre | 16 +++--
userdiff.c | 62 +++++++++++--------
77 files changed, 408 insertions(+), 46 deletions(-)
create mode 100644 t/t4018/javascript-anonymous-assigned-function
create mode 100644 t/t4018/javascript-arrow-assigned-function
create mode 100644 t/t4018/javascript-arrow-assigned-function-2
create mode 100644 t/t4018/javascript-arrow-assigned-function-3
create mode 100644 t/t4018/javascript-assigned-function
create mode 100644 t/t4018/javascript-async-assigned-function
create mode 100644 t/t4018/javascript-class-get-function
create mode 100644 t/t4018/javascript-class-set-function
create mode 100644 t/t4018/javascript-class-static-function
create mode 100644 t/t4018/javascript-class-unprefixed-function
create mode 100644 t/t4018/javascript-dotexpors-async-anonymous-function
create mode 100644 t/t4018/javascript-dotexports-anonymous-function
create mode 100644 t/t4018/javascript-dotexports-arrow-function
create mode 100644 t/t4018/javascript-dotexports-arrow-function-2
create mode 100644 t/t4018/javascript-dotexports-arrow-function-3
create mode 100644 t/t4018/javascript-dotexports-assigned-function
create mode 100644 t/t4018/javascript-dotexports-async-arrow-function
create mode 100644 t/t4018/javascript-dotexports-async-arrow-function-2
create mode 100644 t/t4018/javascript-dotexports-async-arrow-function-3
create mode 100644 t/t4018/javascript-dotexports-async-function
create mode 100644 t/t4018/javascript-dotexports-async-generator-anonymous-function
create mode 100644 t/t4018/javascript-dotexports-async-generator-anonymous-function-2
create mode 100644 t/t4018/javascript-dotexports-async-generator-function
create mode 100644 t/t4018/javascript-dotexports-async-generator-function-2
create mode 100644 t/t4018/javascript-dotexports-function
create mode 100644 t/t4018/javascript-dotexports-generator-anonymous-function
create mode 100644 t/t4018/javascript-dotexports-generator-anonymous-function-2
create mode 100644 t/t4018/javascript-dotexports-generator-function
create mode 100644 t/t4018/javascript-dotexports-generator-function-2
create mode 100644 t/t4018/javascript-export-arrow-function
create mode 100644 t/t4018/javascript-export-async-anonymous-assigned-function
create mode 100644 t/t4018/javascript-export-async-arrow-function
create mode 100644 t/t4018/javascript-export-async-function
create mode 100644 t/t4018/javascript-export-async-generator-anonymous-assigned-function
create mode 100644 t/t4018/javascript-export-async-generator-anonymous-assigned-function-2
create mode 100644 t/t4018/javascript-export-async-generator-assigned-function
create mode 100644 t/t4018/javascript-export-async-generator-assigned-function-2
create mode 100644 t/t4018/javascript-export-async-generator-function
create mode 100644 t/t4018/javascript-export-async-generator-function-2
create mode 100644 t/t4018/javascript-export-function
create mode 100644 t/t4018/javascript-export-generator-assigned-function
create mode 100644 t/t4018/javascript-export-generator-assigned-function-2
create mode 100644 t/t4018/javascript-export-generator-function
create mode 100644 t/t4018/javascript-export-generator-function-2
create mode 100644 t/t4018/javascript-generator-assigned-function
create mode 100644 t/t4018/javascript-generator-assigned-function-2
create mode 100644 t/t4018/javascript-method-unprefixed-function
create mode 100644 t/t4018/javascript-module-dotexports-anonymous-function
create mode 100644 t/t4018/javascript-module-dotexports-arrow-function
create mode 100644 t/t4018/javascript-module-dotexports-arrow-function-2
create mode 100644 t/t4018/javascript-module-dotexports-arrow-function-3
create mode 100644 t/t4018/javascript-module-dotexports-assigned-function
create mode 100644 t/t4018/javascript-module-dotexports-async-arrow-function
create mode 100644 t/t4018/javascript-module-dotexports-async-arrow-function-2
create mode 100644 t/t4018/javascript-module-dotexports-async-arrow-function-3
create mode 100644 t/t4018/javascript-module-dotexports-async-function
create mode 100644 t/t4018/javascript-module-dotexports-async-generator-anonymous-function
create mode 100644 t/t4018/javascript-module-dotexports-async-generator-anonymous-function-2
create mode 100644 t/t4018/javascript-module-dotexports-async-generator-function
create mode 100644 t/t4018/javascript-module-dotexports-async-generator-function-2
create mode 100644 t/t4018/javascript-module-dotexports-function
create mode 100644 t/t4018/javascript-module-dotexports-generator-anonymous-function
create mode 100644 t/t4018/javascript-module-dotexports-generator-anonymous-function-2
create mode 100644 t/t4018/javascript-module-dotexports-generator-function
create mode 100644 t/t4018/javascript-module-dotexports-generator-function-2
create mode 100644 t/t4018/javascript-skip-function-calls
create mode 100644 t/t4018/javascript-skip-reserved-words
--
2.50.0.rc0.62.g658f0ae201.dirty
^ permalink raw reply
* Re: .clang-format: how useful, how often used, and how well maintained?
From: Karthik Nayak @ 2025-06-23 8:46 UTC (permalink / raw)
To: Junio C Hamano, git; +Cc: Patrick Steinhardt, René Scharfe
In-Reply-To: <xmqqmsa3adpw.fsf@gitster.g>
[-- Attachment #1: Type: text/plain, Size: 2344 bytes --]
Junio C Hamano <gitster@pobox.com> writes:
> Cc-list chosen from "git shortlog --since=12.months --no-merges .clang-format".
>
> I am wondering how often our developers use "make style" aka
>
> git clang-format --style file --diff --extensions c,h
>
> and also wondering if the suggested style fixes are really
> "improvements". For example, taking randomly the latest patch I
> just injested into my tree, i.e.
>
> $ git am a-single-patch-file.txt
> $ git reset --soft HEAD^
> $ make style
>
> I got the output attached at the end of the message. The result is
> a mixed bag (I commented on the "patch" as if it were a patch
> submission).
>
> I have this suspicion that nobody complained these sub-par
> suggestions the tool makes based on what we have in .clang-format
> because not many folks run "make style", and "make style" is not
> very easy to use after you record your changes into a commit. IOW,
> there is nothing packaged to help "I have four commits on top of the
> upstream, I want to run style checks before running format-patch",
> i.e.
>
> git clang-format --diff HEAD~4
>
> Even the output from the tool is of mixed quality, there are good
> pieces that can be used to improve your patches. So we may prefer
> to see the tool used more often, but not in a way to suggest its
> output is always better than what the human developer has written.
>
> For that, there are a few things we'd probably need to do:
>
> - Improve our tooling so that the develper can check a range of
> commits they made before running format-patch, and other
> situations.
>
> - Improve .clang-format rules to reduce false positives.
>
I think the biggest issue for this is around line wrapping, I'm
considering just removing it from the '.clang-format'. Perhaps we could
add it to our '.editorconfig'?
The issue itself is that we don't always wrap to 80 characters. We try
to wrap to 80 characters, but prioritize readability over this limit.
This is hard to do in '.clang-format' since it requires tuning the
penalties, which have arbitrary values. I did try to do that in
5e9fa0f9fa (clang-format: re-adjust line break penalties, 2024-10-18),
but as we see, that wasn't very successfull.
If that sounds okay, I can send in a patch to do that and also making
'RemoveBracesLLVM: true' a permanent rule.
[snip]
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 690 bytes --]
^ permalink raw reply
* Re: [PATCH 0/1] Resubmittimg Bulgarian translation of git-gui
From: Johannes Sixt @ 2025-06-23 6:18 UTC (permalink / raw)
To: Alexander Shopov; +Cc: git
In-Reply-To: <CAP6f5M=cYn_XBN=-zw0ezqFskOSjZiVQwQ60f8k4mb2dYqM-vQ@mail.gmail.com>
Am 22.06.25 um 19:11 schrieb Alexander Shopov:
>> not .. obvious, even with `git show --ignore-matching-lines='#:'
>> --color-moved`. Is there a way to enforce a stable order in the .pot
>> file and/or the merged .po files?
>
> Sadly no. The -s/--sort-output is deprecated (plus it is counter productive).
> https://www.gnu.org/software/gettext/manual/gettext.html#index-_002ds_002c-msgmerge-option
>
> The default is -F/--sort-by-file which is kind of saner.
> https://www.gnu.org/software/gettext/manual/gettext.html#index-_002dF_002c-msgmerge-option
>
> It may cause jumping around in case a translatable string that was
> available in one file, becomes available in a file sorted earlier
> than the format but nothing is 100% proof.
That is acceptable and is mitigated somewhat if the diff is viewed with
--color-moved.
As far as I can see, the order of files that are passed to xgettext is
stable. We use $(wildcard lib/*.tcl), which is specified to produce a
sorted list of file names. If xgettext doesn't do anything silly, this
should produce a stable .pot file.
> Sorting is not enough for sane diffs. As the location data also
> contains line numbers - adding a line before a message pushes its
> location down.
>
> The way I read your message:
> - you are OK with a translator choosing to submit po-files without
> location info. This will make commits and diffs shorter and more
> understandable and reduces the growth of the repo The info is not
> used during runtime and is easily recoverable - generate the pot and
> merge the translation.
> - you are at least interested in moving the infrastructure to this workflow.
All correct.
> In such a case next time I submit a gitk/git-gui translation I will
> voluntarily remove the locations.
An update of the Makefile rules would also be desirable, so that a
simple `make update-po` produces the new format.
-- Hannes
^ permalink raw reply
* Re: [PATCH] contrib: Honor symbolic port in git-credential-netrc.
From: Maxim Cournoyer @ 2025-06-23 3:34 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
In-Reply-To: <xmqqmsa27cdn.fsf@gitster.g>
Hi Junio,
tldr; all changes discussed implemented in posted v2.
Junio C Hamano <gitster@pobox.com> writes:
> Maxim Cournoyer <maxim@guixotic.coop> writes:
>
>> Subject: Re: [PATCH] contrib: Honor symbolic port in git-credential-netrc.
>
> Please downcase "Honor" and drop the final full stop, per convention
> (see "git shortlog --no-merges --since=2.months" for examples).
Done.
>> Symbolic ports were previously silently dropped, which made it
>> impossible to use them with git-credential-netrc.
>
> Wouldn't it make sense to issue a warning message when a defined
> $nentry->{port} is not unrecognized? Wouldn't it make sense to
> do so even before we add this new feature?
I agree it's subpar that the current code silently drops the port when
it doesn't match the expected form. Since port values aren't validated
in 'git-send-email' at the moment, a proper fix would be to have routine
to validate ports in a common library and applied everywhere a port is
read from the user or a config file, ideally, in git-send-email or
elsewhere. Maybe it could live in Git.pm ?
Edit: Done.
>> This is a supported
>> use case according to 'man git-send-email', for --smtp-server-port:
>>
>> [...] symbolic port names (e.g. "submission" instead of 587) are
>> also accepted.
>> ---
>
> Missing sign-off? See Documentation/SubmittingPatches
Done.
>> contrib/credential/netrc/git-credential-netrc.perl | 6 ++++--
>> 1 file changed, 4 insertions(+), 2 deletions(-)
>>
>> diff --git a/contrib/credential/netrc/git-credential-netrc.perl
>> b/contrib/credential/netrc/git-credential-netrc.perl
>> index 9fb998ae09..ad06000b9f 100755
>> --- a/contrib/credential/netrc/git-credential-netrc.perl
>> +++ b/contrib/credential/netrc/git-credential-netrc.perl
>> @@ -1,4 +1,4 @@
>> -#!/usr/bin/perl
>> +#!/usr/bin/env perl
>
> An unrelated change to introduce the use of /usr/bin/env in this
> patch is unwelcome. Besides, this is a source that is processed
> by the nearby Makefile, which uses the toplevel genererate-perl.sh
> to turn the "#!.../perl" line to name the correct $PERL_PATH before
> the build product gets installed, so I suspect that this change is
> totally unnecessary.
It was necessary on my system to test the uninstalled version, which I
simply symlinked to ~/.local/bin/git-credential-netrc for ease of
testing. I've split this small change in its own commit. Using env
in shebangs instead of hard-coded locations is good for portability in
general, and the generate-perl.sh substitution will work still.
>> @@ -267,7 +267,9 @@ sub load_netrc {
>> if (!defined $nentry->{machine}) {
>> next;
>> }
>> - if (defined $nentry->{port} && $nentry->{port} =~ m/^\d+$/) {
>> + if (defined $nentry->{port} && $nentry->{port} =~ m/^[[:alnum:]]+$/) {
>> + # Port may be either an integer or a symbolic
>> + # name, e.g. "smtps".
>
> Do we know symbolic port names are always limited to alnums? Or on
> some systems some byte values in the fringe, like "_" or "-", are
> also allowed?
Looking at /etc/services on my system, I see hyphens, indeed, e.g.:
're-mail-ck'. That's now handled by the `is_port' predicate, which uses
the getservbyname(3) call to determine if a non-numeric port is a
valid service/symbolic port name.
I've sent a v2 revision which hopefully addresses all of the above
suggestions/changes.
--
Maxim
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox