Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ We aim to support all the [locales supported by git](https://github.com/git/git/
The currently supported locales are listed below:

- `en`: English
- `bg`: Bulgarian
- `ca`: Catalan
- `de`: German
- `el`: Greek
Expand Down
97 changes: 92 additions & 5 deletions corpus/generated_comments.txt
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,93 @@ On branch
(text)
(branch)))

================================================================================
Detached HEAD
================================================================================

# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
#
# HEAD detached at f5d1c0b8
# Указателят „HEAD“ не е свързан и е при 0e87307
# HEAD separat a f3eb78257f38fc09e34efe4b134b72656205ef0f
# HEAD losgelöst bei 2e873072e87307
# Αποσυνδεδεμένο HEAD στο 2e87307
# HEAD desacoplada en 2e87307
# HEAD détachée sur 2e87307
# HEAD terlepas pada 2e87307
# HEAD scollegato su 2e87307
# HEAD가 다음 위치에서 분리: 2e87307
# HEAD odłączone na 2e87307
# HEAD desanexada em 2e87307
# Отсоединённый указатель HEAD указывает на 2e87307
# HEAD frånkopplad vid 2e87307
# HEAD şurada ayrıldı: 2e87307
# HEAD được tách rời tại 2e87307
# 头指针分离于 2e87307
# 開頭指標分離於 2e87307

--------------------------------------------------------------------------------

(source
(generated_comment)
(generated_comment)
(generated_comment)
(generated_comment
(text)
(commit))
(generated_comment
(text)
(commit))
(generated_comment
(text)
(commit))
(generated_comment
(text)
(commit))
(generated_comment
(text)
(commit))
(generated_comment
(text)
(commit))
(generated_comment
(text)
(commit))
(generated_comment
(text)
(commit))
(generated_comment
(text)
(commit))
(generated_comment
(text)
(commit))
(generated_comment
(text)
(commit))
(generated_comment
(text)
(commit))
(generated_comment
(text)
(commit))
(generated_comment
(text)
(commit))
(generated_comment
(text)
(commit))
(generated_comment
(text)
(commit))
(generated_comment
(text)
(commit))
(generated_comment
(text)
(commit)))

================================================================================
Up to date
================================================================================
Expand Down Expand Up @@ -186,7 +273,7 @@ Behind
================================================================================

# Por favor, introduz a mensagem de memória das tuas alterações.
#
#
# Your branch is behind 'origin/main' by 18 commit, and can be fast-forwarded.
# Your branch is behind 'origin/main' by 18 commits, and can be fast-forwarded.
# Votre branche est en retard sur 'origin/main' de 18 commit, et peut être mise à jour en avance rapide.
Expand Down Expand Up @@ -331,7 +418,7 @@ Ahead
================================================================================

# 请为您的变更输入提交说明。以 '%c' 开始的行将被保留,如果您愿意
#
#
# Your branch is ahead of 'origin/master' by 456 commit.
# Your branch is ahead of 'origin/master' by 456 commits.
# Votre branche est en avance sur 'origin/master' de 456 commit.
Expand Down Expand Up @@ -480,7 +567,7 @@ Rebasing
================================================================================

# Ange incheckningsmeddelandet för dina ändringar. Rader som inleds
#
#
# You are currently rebasing branch 'feat' on 'main'.
# Vous êtes en train de rebaser la branche 'feat' sur 'main'.
# 您在執行將分支 'feat' 重定基底到 'main' 的動作。
Expand Down Expand Up @@ -565,7 +652,7 @@ Interactive rebase
================================================================================

# Introduïu el missatge de comissió pels vostres canvis. Es mantindran
#
#
# interactive rebase in progress; onto master
# rebasage interactif en cours ; sur master
# извършвате интерактивно пребазиране върху master
Expand Down Expand Up @@ -632,7 +719,7 @@ Rebase command
================================================================================

# Παρακαλώ εισάγετε το μήνυμα υποβολής για τις αλλαγές σας. Οι γραμμές που αρχίζουν
#
#
# Dernières commandes effectuées (2 commandes effectuées) :
# pick d7e8984 gregreg
# edit 56f5d83 test
Expand Down
32 changes: 32 additions & 0 deletions grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const SUBJECT = /[^\n\r]{1,49}/;
const NOT_A_COMMENT = /[^#]/;
const SCISSORS = /# -+ >8 -+\r?\n/;
const BRANCH_NAME = /[^\s'”»"“]+/;
const COMMIT = /[0-9a-f]{7,40}/;
const FILEPATH = /\S+/;
const WHITESPACE = /[\f\v ]+/;
const CHANGE = /[^\n\r::]+[:\uff1a]/;
Expand Down Expand Up @@ -82,6 +83,7 @@ module.exports = grammar({
$._uptodate,
$._behind,
$._ahead,
$._detached_head,
$._rebasing,
$._interactive_rebasing,
seq(
Expand Down Expand Up @@ -123,6 +125,7 @@ module.exports = grammar({
),

branch: () => BRANCH_NAME,
commit: () => COMMIT,
number: () => NUMBER,

_generated_comment_separator: ($) =>
Expand Down Expand Up @@ -323,6 +326,35 @@ module.exports = grammar({
seq('Клонът ви е с ', $.number, ' подавания пред „', $.branch, '“.')
),

_detached_head: ($) =>
seq(
alias(
choice(
'HEAD detached at ',
'Указателят „HEAD“ не е свързан и е при ',
'HEAD separat a ',
'HEAD losgelöst bei ',
'Αποσυνδεδεμένο HEAD στο ',
'HEAD desacoplada en ',
'HEAD détachée sur ',
'HEAD terlepas pada ',
'HEAD scollegato su ',
'HEAD가 다음 위치에서 분리: ',
'HEAD odłączone na ',
'HEAD desanexada em ',
'Отсоединённый указатель HEAD указывает на ',
'HEAD frånkopplad vid ',
'HEAD şurada ayrıldı: ',
'HEAD được tách rời tại ',
'头指针分离于 ',
'開頭指標分離於 '
),
$.text
),
$.commit,
NEWLINE
),

_rebasing: ($) =>
// prettier-ignore
choice(
Expand Down
1 change: 1 addition & 0 deletions queries/highlights.scm
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
(title) @text.title
(text) @text
(branch) @text.reference
(commit) @text.reference
(change) @keyword
(filepath) @text.uri
(arrow) @punctuation.delimiter
Expand Down
103 changes: 103 additions & 0 deletions src/grammar.json
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,10 @@
"type": "SYMBOL",
"name": "_ahead"
},
{
"type": "SYMBOL",
"name": "_detached_head"
},
{
"type": "SYMBOL",
"name": "_rebasing"
Expand Down Expand Up @@ -612,6 +616,10 @@
"type": "PATTERN",
"value": "[^\\s'”»\"“]+"
},
"commit": {
"type": "PATTERN",
"value": "[0-9a-f]{7,40}"
},
"number": {
"type": "PATTERN",
"value": "\\d+"
Expand Down Expand Up @@ -3046,6 +3054,101 @@
}
]
},
"_detached_head": {
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "CHOICE",
"members": [
{
"type": "STRING",
"value": "HEAD detached at "
},
{
"type": "STRING",
"value": "Указателят „HEAD“ не е свързан и е при "
},
{
"type": "STRING",
"value": "HEAD separat a "
},
{
"type": "STRING",
"value": "HEAD losgelöst bei "
},
{
"type": "STRING",
"value": "Αποσυνδεδεμένο HEAD στο "
},
{
"type": "STRING",
"value": "HEAD desacoplada en "
},
{
"type": "STRING",
"value": "HEAD détachée sur "
},
{
"type": "STRING",
"value": "HEAD terlepas pada "
},
{
"type": "STRING",
"value": "HEAD scollegato su "
},
{
"type": "STRING",
"value": "HEAD가 다음 위치에서 분리: "
},
{
"type": "STRING",
"value": "HEAD odłączone na "
},
{
"type": "STRING",
"value": "HEAD desanexada em "
},
{
"type": "STRING",
"value": "Отсоединённый указатель HEAD указывает на "
},
{
"type": "STRING",
"value": "HEAD frånkopplad vid "
},
{
"type": "STRING",
"value": "HEAD şurada ayrıldı: "
},
{
"type": "STRING",
"value": "HEAD được tách rời tại "
},
{
"type": "STRING",
"value": "头指针分离于 "
},
{
"type": "STRING",
"value": "開頭指標分離於 "
}
]
},
"named": true,
"value": "text"
},
{
"type": "SYMBOL",
"name": "commit"
},
{
"type": "PATTERN",
"value": "\\r?\\n"
}
]
},
"_rebasing": {
"type": "CHOICE",
"members": [
Expand Down
8 changes: 8 additions & 0 deletions src/node-types.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@
"type": "change",
"named": true
},
{
"type": "commit",
"named": true
},
{
"type": "filepath",
"named": true
Expand Down Expand Up @@ -792,6 +796,10 @@
"type": "change",
"named": true
},
{
"type": "commit",
"named": true
},
{
"type": "drop",
"named": false
Expand Down
Loading