Skip to content

feat: add support for detached head#12

Merged
gbprod merged 4 commits intogbprod:mainfrom
thatlittleboy:support-commits
Jan 4, 2023
Merged

feat: add support for detached head#12
gbprod merged 4 commits intogbprod:mainfrom
thatlittleboy:support-commits

Conversation

@thatlittleboy
Copy link
Copy Markdown
Contributor

@thatlittleboy thatlittleboy commented Jan 1, 2023

This PR adds support back for detached head commits which takes this form (in English)

# HEAD detached at 2e87307

in the COMMIT_EDITMSG file. (this was originally supported by the-mikedavis/tree-sitter-git-commit, so most credits go to Mike).


Log:

  • I've not yet finished adding all the different locales. I've just done English, German and Chinese Simplified for now. As mentioned in List of languages supported by the parser #9, I've not worked out what languages are supported by your parser yet...).
  • Also, do you have any advice on obtaining the proper git messages for the different languages? At the moment, I'm just manually changing the locales on my laptop and copying what I see in the gitmessage, but I'm not sure if they are 100% right..
  • This is my first time contributing to a treesitter parser repo, I'm not sure if I've done all the necessary -- I did tree-sitter generate, tree-sitter test. Let me know if I missed out any files in my PR.

@gbprod
Copy link
Copy Markdown
Owner

gbprod commented Jan 2, 2023

For the moment, it seems great!

You can find all locales here : https://github.com/git/git/tree/master/po

To build and test, you also can use npm run build and npm run test.

Thanks!

@thatlittleboy
Copy link
Copy Markdown
Contributor Author

Got it, thanks for the feedback! I'll work on adding the other languages soon as well once we sort out #13.

@thatlittleboy
Copy link
Copy Markdown
Contributor Author

I've added support for the 17 languages in the README. (and ordered in the same order as the languages in the README.md, i.e. alphabetically except for English).

I've also added tests and ran npm run test successfully.


Note: I've only added the "HEAD detached at %s" variant, not the "HEAD detached from %s" variant. Two reasons: (1) I've not yet encountered "from" variant in my own tests, and (2) Mike's tree-sitter-git-commit also does not support this.

@thatlittleboy
Copy link
Copy Markdown
Contributor Author

I'll wait for your #17 to be merged in first, then I'll add the bg translation alongside this PR as well.

@thatlittleboy thatlittleboy marked this pull request as ready for review January 3, 2023 14:48
@gbprod
Copy link
Copy Markdown
Owner

gbprod commented Jan 4, 2023

Nice job!
Thanks

@gbprod gbprod merged commit a1db276 into gbprod:main Jan 4, 2023
@thatlittleboy thatlittleboy deleted the support-commits branch January 4, 2023 11:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants