git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 0/2] [GSoC] userdiff: adding typescript pattern

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 29, 2026, 00:42 UTC
Message-ID
<xmqqtstzh3f1.fsf@gitster.g>
In-Reply-To
<pull.2251.git.git.1774734004.gitgitgadget@gmail.com>
"Dhruv Arora via GitGitGadget" <gitgitgadget@gmail.com> writes:
Show 13 quoted lines
> 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.
Show 14 quoted lines
>  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
Previous: Dhruv Arora via GitGitGadgetNext: Johannes Sixt
Message 4 of 6 in “[GSoC] userdiff: adding typescript pattern”
  1. 0/2 [GSoC] userdiff: adding typescript patternDhruv Arora via GitGitGadget, Mar 28, 2026
  2. 1/2 userdiff: adding typescript patternDhruv Arora via GitGitGadget, Mar 28, 2026
  3. 2/2 fix(userdiff): sorted pattern and testsDhruv Arora via GitGitGadget, Mar 28, 2026
  4. Junio C HamanoMar 29, 2026
  5. Johannes SixtMar 29, 2026
  6. Spelling JavaScript (was: Re: [PATCH 0/2] [GSoC] userdiff: adding typescript pattern)Ben Knoble, Mar 29, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.