[GSoC] userdiff: adding typescript pattern#2251
[GSoC] userdiff: adding typescript pattern#2251Dhruv-0-Arora wants to merge 2 commits intogit:masterfrom
Conversation
Welcome to GitGitGadgetHi @Dhruv-0-Arora, and welcome to GitGitGadget, the GitHub App to send patch series to the Git mailing list from GitHub Pull Requests. Please make sure that either:
You can CC potential reviewers by adding a footer to the PR description with the following syntax: NOTE: DO NOT copy/paste your CC list from a previous GGG PR's description, Also, it is a good idea to review the commit messages one last time, as the Git project expects them in a quite specific form:
It is in general a good idea to await the automated test ("Checks") in this Pull Request before contributing the patches, e.g. to avoid trivial issues such as unportable code. Contributing the patchesBefore you can contribute the patches, your GitHub username needs to be added to the list of permitted users. Any already-permitted user can do that, by adding a comment to your PR of the form Both the person who commented An alternative is the channel Once on the list of permitted usernames, you can contribute the patches to the Git mailing list by adding a PR comment If you want to see what email(s) would be sent for a After you submit, GitGitGadget will respond with another comment that contains the link to the cover letter mail in the Git mailing list archive. Please make sure to monitor the discussion in that thread and to address comments and suggestions (while the comments and suggestions will be mirrored into the PR by GitGitGadget, you will still want to reply via mail). If you do not want to subscribe to the Git mailing list just to be able to respond to a mail, you can download the mbox from the Git mailing list archive (click the curl -g --user "<EMailAddress>:<Password>" \
--url "imaps://imap.gmail.com/INBOX" -T /path/to/raw.txtTo iterate on your change, i.e. send a revised patch or patch series, you will first want to (force-)push to the same branch. You probably also want to modify your Pull Request description (or title). It is a good idea to summarize the revision by adding something like this to the cover letter (read: by editing the first comment on the PR, i.e. the PR description): To send a new iteration, just add another PR comment with the contents: Need help?New contributors who want advice are encouraged to join git-mentoring@googlegroups.com, where volunteers who regularly contribute to Git are willing to answer newbie questions, give advice, or otherwise provide mentoring to interested contributors. You must join in order to post or view messages, but anyone can join. You may also be able to find help in real time in the developer IRC channel, |
55f9b3c to
b12d2d7
Compare
|
There is a merge commit in this Pull Request: Please rebase the branch and force-push. |
Add builtin userdiff pattern for TypeScript files. Recognizes function declarations, class definitions, arrow functions, and method definitions. Handles common modifiers like export, async, static, etc.. Signed-off-by: Dhruv Arora <a_dhruv@outlook.com>
- Typescript pattern was not in alphabetical order, causing failing tests. - Added 3 new typescript tests. - Fixed pattern bug - incorrectly identifying const|let|var instead of function or class. Signed-off-by: Dhruv Arora <a_dhruv@outlook.com>
a258730 to
d684d93
Compare
|
@dscho could you /allow me? |
|
/allow |
|
User Dhruv-0-Arora is now allowed to use GitGitGadget. |
Thank you! |
|
/submit |
|
Error: Ignoring PR with empty title and/or body |
|
/submit |
|
Submitted as pull.2251.git.git.1774734004.gitgitgadget@gmail.com To fetch this version into To fetch this version to local tag |
|
Junio C Hamano wrote on the Git mailing list (how to reply to this email): "Dhruv Arora via GitGitGadget" <gitgitgadget@gmail.com> writes:
> Description
> ===========
>
> * Add builtin userdiff pattern for TypeScript files. Recognizes function
> declarations, class definitions, arrow functions, and method definitions.
>
> * Handles common modifiers like export, async, static, etc
>
> * Added tests for the typescript pattern in userdiff.
>
> Dhruv Arora (2):
> userdiff: adding typescript pattern
> fix(userdiff): sorted pattern and tests
We frown upon a patch series that makes mistakes in an earlier step,
only to fix them in a later step. The "git rebase -i" command helps
us pretend to be more perfect developers than we actually are,
whipping your patch series into a shape that builds one small step
on top of another in a logical succession. Such a patch series is
easier to understand than a history that faithfully records all the
stumbles the developer made until they reached the final solution.
Just have a single patch that adds the right pattern at the right
place and add necessary tests.
When/if your reviewers suggest further changes, the way you should
work on them is the same. Pretend as if you discarded everything
you did, started from scratch, and reached the ideal result without
making any mistakes or taking any detours along the way.
Thanks.
> t/t4018/typescript-class-method | 7 +++++++
> t/t4018/typescript-export-default-class | 7 +++++++
> t/t4018/typescript-export-function | 7 +++++++
> userdiff.c | 15 +++++++++++++++
> 4 files changed, 36 insertions(+)
> create mode 100644 t/t4018/typescript-class-method
> create mode 100644 t/t4018/typescript-export-default-class
> create mode 100644 t/t4018/typescript-export-function
>
>
> base-commit: ce74208c2fa13943fffa58f168ac27a76d0eb789
> Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-2251%2FDhruv-0-Arora%2Fuserdiff%2Ftypescript-pattern-v1
> Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-2251/Dhruv-0-Arora/userdiff/typescript-pattern-v1
> Pull-Request: https://github.com/git/git/pull/2251 |
|
Johannes Sixt wrote on the Git mailing list (how to reply to this email): Am 28.03.26 um 22:40 schrieb Dhruv Arora via GitGitGadget:
>
> Description
> ===========
>
> * Add builtin userdiff pattern for TypeScript files. Recognizes function
> declarations, class definitions, arrow functions, and method definitions.
>
> * Handles common modifiers like export, async, static, etc
>
> * Added tests for the typescript pattern in userdiff.
>
> Dhruv Arora (2):
> userdiff: adding typescript pattern
> fix(userdiff): sorted pattern and tests
>
> t/t4018/typescript-class-method | 7 +++++++
> t/t4018/typescript-export-default-class | 7 +++++++
> t/t4018/typescript-export-function | 7 +++++++
> userdiff.c | 15 +++++++++++++++
> 4 files changed, 36 insertions(+)
> create mode 100644 t/t4018/typescript-class-method
> create mode 100644 t/t4018/typescript-export-default-class
> create mode 100644 t/t4018/typescript-export-function
>
>
> base-commit: ce74208c2fa13943fffa58f168ac27a76d0eb789
> Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-2251%2FDhruv-0-Arora%2Fuserdiff%2Ftypescript-pattern-v1
> Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-2251/Dhruv-0-Arora/userdiff/typescript-pattern-v1
> Pull-Request: https://github.com/git/git/pull/2251
Javascript and Typescript are related languages, if I am not mistaken.
It would be appreciated if the new language driver could be used for
both. Then the driver's name should be the superset language and the
documentation (missing, BTW) should mention that the driver can be used
for both languages.
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/
https://lore.kernel.org/git/20250604094100.80598-1-derick.william.moraes@gmail.com/
Please review these submission and the responses that they received.
Perhaps you can find inspiration for improvement from them.
-- Hannes
|
|
User |
|
Ben Knoble wrote on the Git mailing list (how to reply to this email): > Le 29 mars 2026 à 05:32, Johannes Sixt <j6t@kdbg.org> a écrit :
>
> Javascript and Typescript are related languages, if I am not mistaken.
>
> -- Hannes
FWIW, I believe both languages are officially spelled with a capital S: “JavaScript”, “TypeScript”. At least that is how Wikipedia and official sites present them.
I knew what you meant of course, and will now take my pedant hat off ;) |
|
User |
|
Junio C Hamano wrote on the Git mailing list (how to reply to this email): "Dhruv Arora via GitGitGadget" <gitgitgadget@gmail.com> writes:
> Description
> ===========
>
> * Add builtin userdiff pattern for TypeScript files. Recognizes function
> declarations, class definitions, arrow functions, and method definitions.
>
> * Handles common modifiers like export, async, static, etc
>
> * Added tests for the typescript pattern in userdiff.
>
> Dhruv Arora (2):
> userdiff: adding typescript pattern
> fix(userdiff): sorted pattern and tests
We frown upon a patch series that makes mistakes in an earlier step,
only to fix them in a later step. The "git rebase -i" command helps
us pretend to be more perfect developers than we actually are,
whipping your patch series into a shape that builds one small step
on top of another in a logical succession. Such a patch series is
easier to understand than a history that faithfully records all the
stumbles the developer made until they reached the final solution.
Just have a single patch that adds the right pattern at the right
place and add necessary tests.
When/if your reviewers suggest further changes, the way you should
work on them is the same. Pretend as if you discarded everything
you did, started from scratch, and reached the ideal result without
making any mistakes or taking any detours along the way.
Thanks.
> t/t4018/typescript-class-method | 7 +++++++
> t/t4018/typescript-export-default-class | 7 +++++++
> t/t4018/typescript-export-function | 7 +++++++
> userdiff.c | 15 +++++++++++++++
> 4 files changed, 36 insertions(+)
> create mode 100644 t/t4018/typescript-class-method
> create mode 100644 t/t4018/typescript-export-default-class
> create mode 100644 t/t4018/typescript-export-function
>
>
> base-commit: ce74208c2fa13943fffa58f168ac27a76d0eb789
> Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-2251%2FDhruv-0-Arora%2Fuserdiff%2Ftypescript-pattern-v1
> Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-2251/Dhruv-0-Arora/userdiff/typescript-pattern-v1
> Pull-Request: https://github.com/git/git/pull/2251 |
|
Johannes Sixt wrote on the Git mailing list (how to reply to this email): Am 28.03.26 um 22:40 schrieb Dhruv Arora via GitGitGadget:
>
> Description
> ===========
>
> * Add builtin userdiff pattern for TypeScript files. Recognizes function
> declarations, class definitions, arrow functions, and method definitions.
>
> * Handles common modifiers like export, async, static, etc
>
> * Added tests for the typescript pattern in userdiff.
>
> Dhruv Arora (2):
> userdiff: adding typescript pattern
> fix(userdiff): sorted pattern and tests
>
> t/t4018/typescript-class-method | 7 +++++++
> t/t4018/typescript-export-default-class | 7 +++++++
> t/t4018/typescript-export-function | 7 +++++++
> userdiff.c | 15 +++++++++++++++
> 4 files changed, 36 insertions(+)
> create mode 100644 t/t4018/typescript-class-method
> create mode 100644 t/t4018/typescript-export-default-class
> create mode 100644 t/t4018/typescript-export-function
>
>
> base-commit: ce74208c2fa13943fffa58f168ac27a76d0eb789
> Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-2251%2FDhruv-0-Arora%2Fuserdiff%2Ftypescript-pattern-v1
> Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-2251/Dhruv-0-Arora/userdiff/typescript-pattern-v1
> Pull-Request: https://github.com/git/git/pull/2251
Javascript and Typescript are related languages, if I am not mistaken.
It would be appreciated if the new language driver could be used for
both. Then the driver's name should be the superset language and the
documentation (missing, BTW) should mention that the driver can be used
for both languages.
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/
https://lore.kernel.org/git/20250604094100.80598-1-derick.william.moraes@gmail.com/
Please review these submission and the responses that they received.
Perhaps you can find inspiration for improvement from them.
-- Hannes
|
|
Ben Knoble wrote on the Git mailing list (how to reply to this email): > Le 29 mars 2026 à 05:32, Johannes Sixt <j6t@kdbg.org> a écrit :
>
> Javascript and Typescript are related languages, if I am not mistaken.
>
> -- Hannes
FWIW, I believe both languages are officially spelled with a capital S: “JavaScript”, “TypeScript”. At least that is how Wikipedia and official sites present them.
I knew what you meant of course, and will now take my pedant hat off ;) |
Description
Add builtin userdiff pattern for TypeScript files. Recognizes function declarations, class definitions, arrow functions, and method definitions.
Added tests for the typescript pattern in userdiff.
cc: Johannes Sixt j6t@kdbg.org
cc: Ben Knoble ben.knoble@gmail.com