-
Notifications
You must be signed in to change notification settings - Fork 588
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Git Files] Add Git Files package #1126
Merged
Merged
Changes from 32 commits
Commits
Show all changes
106 commits
Select commit
Hold shift + click to select a range
b44fe8f
Add git package
ryboe d802d3a
[Git] Commit: rename source.gitcommit to source.git.commit
deathaxe 9ad0f06
[Git] Commit: Sort blocks by top-down
deathaxe ea2ac5a
[Git] Commit: Refactor commit message
deathaxe f257c68
[Git] Commit: Refactor changed files list
deathaxe 43e11f3
[Git] Commit: Refactor branch-line
deathaxe d97a1ab
[Git] Commit: Refactor date line
deathaxe 9404e60
[Git] Commit: Add scopes for username and issue references
deathaxe d01adf5
[Git] Commit: scope email addresses
deathaxe 2a119a9
[Git] Link: Add syntax for .git files
deathaxe f938bd1
[Git] Link: rename syntax file to achieve unique names
deathaxe ec509be
[Git] Commit: rename syntax file to achieve unique names
deathaxe 16cf43b
[Git] Commit: fix syntax_test file headers
deathaxe bff54a5
[Git] Rebase: Rename .gitrebase top-level scope to .git.rebase
deathaxe 9dc50fb
[Git] Rebase: Add illegal syntax check to commit command lines
deathaxe 98116c9
[Git] Rebase: Update rebase message to highlight commands
deathaxe 3863bf2
[Git] Rebase: Resort rebase code to put associated blocks together
deathaxe 27363ca
[Git] Rebase: Scope some rebase comment lines as headlines
deathaxe 1e6d44d
[Git] Rebase: Match comments at line start only
deathaxe 13897a1
[Git] Rebase: rename syntax file to achieve unique names
deathaxe 2ecbf9e
[Git] Rebase: Add issue/user/email reference highlighting
deathaxe 4752d69
[Git] Commit: Add support for git translations
deathaxe 28d8bb2
Add git package
ryboe a69b86d
Refactor [section] contexts
ryboe cacce71
[Git] Commit: Fix syntax tests to match translations
deathaxe 4d7b60e
[Git] Commit: Rename source.git.commit to text.git.commit
deathaxe 92763c4
[Git] Rebase: Rename source.git.rebase to text.git.rebase
deathaxe 52343d1
[Git] Link: Rename source.git.link to text.git.link
deathaxe f35380e
[Git] Commit: Remove text.plain.message scope
deathaxe 9596e7c
Refactor and simplify commit syntax
ryboe 86efdd6
[Git] Config: Sort sections from top-to down
deathaxe 940d1bf
[Git] Config: Merge some unique atomic sections with their parents
deathaxe c4d6758
[Git] Config: Disallow any string after section header
deathaxe 16fb208
[Git] Config: Reduce pattern repetitions
deathaxe a8be2f0
[Git] Config: Simplify constant patterns
deathaxe 0f5fd79
[Git] Commit: Add support for squashed commit messages.
deathaxe 9b22879
Refactor and simplify commit syntax
ryboe 9c6f12a
[Git] Commit: Rename syntax definition file
deathaxe f952391
[Git] Link: Rename git link.sublime-syntax to gitlink.sublime-syntax
deathaxe 99da69a
[Git] Rebase: rename git rebase.sublime-syntax to gitrebase.sublime-s…
deathaxe 937c7de
[Git] Commit: Add general purpose headline
deathaxe d4d952d
[Git] Commit: Merge squash into commit syntax tests
deathaxe 83f303b
[Git] Commit: Highlight recent commands in rebase commits
deathaxe 3cc7a7b
Merge branch 'pr/git-commit' into add_gitconfig_pkg
deathaxe 161b6a7
[Git] Rebase: Extend syntax name
deathaxe 437c532
[Git] Rebase: Simplify scopes of command help
deathaxe dda56a0
[Git] Commit: Update reference scope names
deathaxe ec25ba2
[Git] Commit: Remove path from SYNTAX TEST header
deathaxe 918e1de
[Git] Commit: Add Signed-off-by keyword and fix email-reference
deathaxe 01320be
[Git] Commit: Use entity.name.reference for references
deathaxe ce37d63
[Git] Commit: Less strict empty 2nd line checks
deathaxe a4d64f3
[Git] Commit: Improve re-usability
deathaxe 09c90ce
[Git] Commit: Support git diff
deathaxe d068d7d
Merge pull request #2 from deathaxe/pr/git-commit
4195122
[Git] Rebase: Reduce comment stack push/pops
deathaxe d1d2dd7
[Git] Rebase: Prepare for common reference scopes
deathaxe bf92620
[Git] Rebase: Use meta.subject to identify commit subject
deathaxe cbfbe7e
[Git] Rebase: Remove path from SYNTAX TEST header
deathaxe cc7df2f
Merge branch 'pr/git-rebase' into add_gitconfig_pkg
deathaxe c6a2a70
Merge pull request #1 from deathaxe/pr/git
b901cc8
[Git] Config: Highlight invalid escapes in section names
deathaxe a81f4e3
[Git] Rename git config base scope
deathaxe 25b3658
Resolve conflicts with add_gitconfig_pkg
deathaxe 1d17e49
Merge pull request #3 from deathaxe/pr/gitlink
689b737
Merge pull request #4 from deathaxe/pr/git-config
23e9200
[Git] Rename files to satisfy ST naming conventions
deathaxe bf103aa
[Git] Fix some scopes to satisfy new file names
deathaxe 1a920e1
[Git] Create a hidden file with common scopes
deathaxe 92dff27
[Git] Add Git Log syntax highlighting
deathaxe f97ebd3
[Git] Add .gitignore and .gitattributes syntax highlighting
deathaxe 1a077a3
[Git] Link: Tweak path scoping along the lines of fnmatch
deathaxe 942d62e
[Git] Config: Fix section snippet
deathaxe 462873a
[Git] Config: Rename Symbol List
deathaxe 7e2fd09
[Git] Rebase: Update comments
deathaxe 2d9b9f9
[Git] Rebase: Use common line-end rule
deathaxe 20445ee
[Git] Highlight fully qualified rebase message only
deathaxe aeb786b
[Git] Rebase: Rename commit-message to commit-section
deathaxe 965b015
[Git] Commit: Add some comments as separators
deathaxe 4896438
[Git] Commit: Typo
deathaxe b19e70c
[Git] Config: Don't mix escapes and trailing-slash
deathaxe 9a78289
[Git] Config: Use escaped quotation marks
deathaxe ed8c6e7
[Git] Config: Udate/fix some syntax tests
deathaxe 6bd9ada
Merge pull request #5 from deathaxe/pr/add_git_files
731e25f
[Git] Config: Remove format-escapes
deathaxe d30a0aa
Merge pull request #6 from deathaxe/pr/add_git_files
c8d8dee
[Git Files] Config: Allow single quoted value strings
deathaxe 7e41d5b
[Git Files] Config: embed ShellScript
deathaxe 0bcb500
[Git Files] Rebase: Scope all commit operations separately
deathaxe 26f8095
[Git Files] Config: Remove single-quoted strings
deathaxe 1701313
[Git Files] Config: Fix section header must not span multiple rows
deathaxe a8d5928
[Git Files] Config: Add support for legacy section headers
deathaxe 6af5bfe
[Git Files] Config: Flatten section header rules
deathaxe 0485882
[Git Files] Config: Add some divider comments
deathaxe c783cc9
[Git Files] Config: Increase performance by 13%
deathaxe 85116e0
[Git Files] Config: Simplify 'escape' rule
deathaxe a987aff
[Git Files] Config: Improve meta.mapping scopes
deathaxe 7aa5ffc
[Git Files] Config: Respect shellscript's line continuation
deathaxe b38ad96
[Git Files] Config: Hardening quoted shell script escape
deathaxe 4de96c7
[Git Files] Config: Fix typo
deathaxe 7c10705
Merge pull request #7 from deathaxe/add_gitconfig_pkg
00e10a8
[Git Files] Config: Capture eol if available
deathaxe bcd2798
[Git Files] Config: Add indention rules
deathaxe 065536f
[Git Files] Config: Fix multiline shellscript with double quotes
deathaxe c2fee71
Merge pull request #8 from deathaxe/add_gitconfig_pkg
a255364
[Git Files] Config: Move Indention Rules to correct path
deathaxe 758cc44
Merge pull request #9 from deathaxe/add_gitconfig_pkg
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>name</key> | ||
<string>Comments</string> | ||
<key>scope</key> | ||
<string>source.gitcommit, source.gitconfig, source.gitrebase</string> | ||
<key>settings</key> | ||
<dict> | ||
<key>shellVariables</key> | ||
<array> | ||
<dict> | ||
<key>name</key> | ||
<string>TM_COMMENT_START</string> | ||
<key>value</key> | ||
<string># </string> | ||
</dict> | ||
</array> | ||
</dict> | ||
</dict> | ||
</plist> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<snippet> | ||
<content><![CDATA[ | ||
[${1:section}] | ||
$0 | ||
]]></content> | ||
<tabTrigger>section</tabTrigger> | ||
<scope>source.gitconfig</scope> | ||
<description>[section]</description> | ||
</snippet> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>name</key> | ||
<string>Symbol List</string> | ||
<key>scope</key> | ||
<string>meta.brackets.gitconfig</string> | ||
<key>settings</key> | ||
<dict> | ||
<key>showInSymbolList</key> | ||
<integer>1</integer> | ||
</dict> | ||
</dict> | ||
</plist> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,204 @@ | ||
%YAML 1.2 | ||
--- | ||
# Highlight regular git commits, merge commits, and tags. | ||
|
||
name: Git Commit | ||
file_extensions: | ||
- COMMIT_EDITMSG | ||
- MERGE_MSG | ||
- TAG_EDITMSG | ||
scope: text.git.commit | ||
|
||
variables: | ||
hash: \b\h{7,}\b | ||
# Rebase operations | ||
shortcut: '[defprsx]' | ||
operator: \b(?:drop|edit|exec|fixup|pick|reword|squash|{{shortcut}})\b | ||
# The following variables are required to support highlighting of special phrases | ||
# in the git commit messages for all supported languages. | ||
# Source: https://github.com/git/git/tree/master/po | ||
# Languages: bg,ca,de,fr,is,it,ko,pt_PT,ru,sv,vi,zh_CH | ||
on_branch: On branch|На клон|En la branca|Auf Branch|Sur la branche|Sul branch|현재 브랜치|No ramo|На ветке|På grenen|Trên nhánh|位于分支 | ||
date: Date|Дата|Data|Datum|Date|@is.po|@it.po|시각|Data|Дата|Datum|Ngày tháng|日期 | ||
# file state variables | ||
# - @it.po , @is.po means no translation in the file found | ||
# - the order is used from the *.po files for easy multi cursor copy & paste | ||
both_deleted: both deleted|изтрити в двата случая|suprimit per ambdós|beide gelöscht|supprimé des deux côtés|@is.po|@it.po|양쪽에서 삭제|eliminado por ambos|оба удалены|borttaget av bägge|bị xóa bởi cả hai|双方删除 | ||
added_by_us: added by us|добавени от вас|afegit per nosaltres|von uns hinzugefügt|ajouté par nous|@is.po|@it.po|이 쪽에서 추가|adicionado por nós|добавлено нами|tillagt av oss|được thêm vào bởi chúng ta|由我们添加 | ||
deleted_by_them: deleted by them|изтрити от тях|suprimit per ells|von denen gelöscht|supprimé par eux|@is.po|@it.po|저 쪽에서 삭제|eliminado por eles|удалено ими|borttaget av dem|bị xóa đi bởi họ|由他们删除 | ||
added_by_them: added by them|добавени от тях|afegit per ells|von denen hinzugefügt|ajouté par eux|@is.po|@it.po|저 쪽에서 추가|adicionado por eles|добавлено ими|tillagt av dem|được thêm vào bởi họ|由他们添加 | ||
deleted_by_us: deleted by us|изтрити от вас|suprimit per nosaltres|von uns gelöscht|supprimé par nous|@is.po|@it.po|이 쪽에서 삭제|eliminado por nós|удалено нами|borttaget av oss|bị xóa bởi chúng ta|由我们删除 | ||
both_added: both added|добавени и в двата случая|afegit per ambdós|von beiden hinzugefügt|ajouté de deux côtés|@is.po|@it.po|양쪽에서 추가|adicionado por ambos|оба добавлены|tillagt av bägge|được thêm vào bởi cả hai|双方添加 | ||
both_modified: both modified|променени и в двата случая|modificat per ambdós|von beiden geändert|modifié des deux côtés|@is.po|@it.po|양쪽에서 수정|modificado por ambos|оба изменены|ändrat av bägge|bị sửa bởi cả hai|双方修改 | ||
new_file: new file|нов файл|fitxer nou|neue Datei|nouveau fichier|@is.po|nuovo file|새 파일|novo ficheiro|новый файл|ny fil|tập tin mới|新文件 | ||
copied: copied|копиран|copiat|kopiert|copié|@is.po|copiato|복사함|copiado|скопировано|kopierad|đã chép|拷贝 | ||
deleted: deleted|изтрит|suprimit|gelöscht|supprimé|@is.po|eliminato|삭제함|eliminado|удалено|borttagen|đã xóa|删除 | ||
modified: modified|променен|modificat|geändert|modifié|@is.po|modificato|수정함|modificado|изменено|ändrad|đã sửa|修改 | ||
renamed: renamed|преименуван|canviat de nom|umbenannt|renommé|@is.po|rinominato|이름 바꿈|nome mudado|переименовано|namnbytt|đã đổi tên|重命名 | ||
typechange: typechange|смяна на вида|canviat de tipus|Typänderung|modif. type|@is.po|typechange|종류 바뀜|tipo alterado|изменен тип|typbyte|đổi-kiểu|类型变更 | ||
unknown: unknown|непозната промяна|desconegut|unbekannt|inconnu|@is.po|sconosciuto|알 수 없음|desconhecido|неизвестно|okänd|không hiểu|未知 | ||
unmerged: unmerged|неслят|sense fusionar|nicht gemerged|non fusionné|@is.po|@it.po|병합하지 않음|não integrado|не слитые|osammanslagen|chưa hòa trộn|未合并 | ||
|
||
contexts: | ||
prototype: | ||
- include: dropped-content | ||
- include: comments | ||
|
||
main: | ||
- match: ^\s*(?=\S) | ||
set: commit-subject | ||
|
||
commit-subject: | ||
# first none empty none comment line is commit subject | ||
- meta_scope: meta.subject.git.commit markup.heading.subject.git.commit | ||
- match: $\n? | ||
set: commit-separator | ||
- include: references | ||
|
||
commit-separator: | ||
# empty line between subject and message | ||
- match: \n | ||
set: commit-message | ||
- match: \S.* | ||
scope: invalid.illegal.empty-line-expected.git.commit | ||
|
||
commit-message: | ||
# all none comment lines after subject belong to the message | ||
- match: ^ | ||
push: | ||
- meta_include_prototype: false | ||
- meta_scope: meta.message.git.commit | ||
- match: ^(?=#) | ||
pop: true | ||
- include: references | ||
- include: signed-off | ||
|
||
references: | ||
# issue reference | ||
# https://help.github.com/articles/closing-issues-using-keywords | ||
- match: |- | ||
(?x) | ||
# optional closing keyword | ||
(?i: | ||
( (?:close|fixe|resolve)[ds]? | fix ) # keyword | ||
\s* (:)? \s* # optional colon separator | ||
)? # keyword is optional | ||
# user/repo#issue | ||
( | ||
(?: | ||
\b(?: \w+ (/) )? \w+ # user (optional) / repo | ||
)? | ||
(\#)[0-9]+ # issue number | ||
)\b | ||
scope: meta.reference.issue.git.commit | ||
captures: | ||
1: keyword.other.resolved-issue.git.commit | ||
2: punctuation.separator.mapping.pair.resolved-issue.git.commit | ||
3: constant.other.reference.issue.git.commit | ||
4: punctuation.separator.reference.issue.git.commit | ||
5: punctuation.definition.reference.issue.git.commit | ||
# email reference | ||
- match: (<)(\S+(\@)\S+?(\.)\S+)(>) | ||
scope: meta.reference.email.git | ||
captures: | ||
1: punctuation.definition.reference.email.begin.git | ||
2: entity.name.reference.email.git | ||
3: punctuation.separator.email.git | ||
4: punctuation.separator.email.git | ||
5: punctuation.definition.reference.email.end.git | ||
# user reference | ||
- match: (\@)\w+\b | ||
scope: meta.reference.username.git entity.name.reference.username.git | ||
captures: | ||
1: punctuation.definition.reference.username.git | ||
|
||
signed-off: | ||
- match: ^\s*(Signed-off-by)\s*(:) | ||
captures: | ||
1: keyword.other.signed-off-by.git.commit | ||
2: punctuation.separator.mapping.pair.git.commit | ||
|
||
comments: | ||
- match: ^# | ||
scope: punctuation.definition.comment.git.commit | ||
push: | ||
- meta_include_prototype: false | ||
- meta_scope: comment.line.git.commit | ||
- match: $\n? | ||
pop: true | ||
- include: branch-line | ||
- include: change-list | ||
- include: commands-line | ||
- include: date-line | ||
- include: head-line | ||
|
||
branch-line: | ||
- match: \b({{on_branch}})\s+(.*) | ||
captures: | ||
1: markup.heading.on-branch.git.commit | ||
2: constant.language.branch-name.git.commit | ||
|
||
change-list: | ||
# list body | ||
- match: \b({{new_file}}|{{added_by_them}}|{{added_by_us}}|{{both_added}})\s*(:)\s*(.*) | ||
scope: meta.change-list.git.commit | ||
captures: | ||
1: keyword.other.change-list.git.commit | ||
2: punctuation.separator.mapping.pair.change-list.git.commit | ||
3: string.unquoted.git.commit markup.inserted.file.git.commit | ||
- match: \b({{copied}}|{{renamed}}|{{typechange}})\s*(:)\s*(.*) | ||
scope: meta.change-list.git.commit | ||
captures: | ||
1: keyword.other.change-list.git.commit | ||
2: punctuation.separator.mapping.pair.change-list.git.commit | ||
3: string.unquoted.git.commit markup.changed.file.name.git.commit | ||
- match: \b({{modified}}|{{both_modified}})\s*(:)\s*(.*) | ||
scope: meta.change-list.git.commit | ||
captures: | ||
1: keyword.other.change-list.git.commit | ||
2: punctuation.separator.mapping.pair.change-list.git.commit | ||
3: string.unquoted.git.commit markup.changed.file.content.git.commit | ||
- match: \b({{deleted}}|{{deleted_by_them}}|{{deleted_by_us}}|{{both_deleted}})\s*(:)\s*(.*) | ||
scope: meta.change-list.git.commit | ||
captures: | ||
1: keyword.other.change-list.git.commit | ||
2: punctuation.separator.mapping.pair.change-list.git.commit | ||
3: string.unquoted.git.commit markup.deleted.file.git.commit | ||
- match: \b({{unknown}}|{{unmerged}})\s*(:)\s*(.*) | ||
scope: meta.change-list.git.commit | ||
captures: | ||
1: keyword.other.change-list.git.commit | ||
2: punctuation.separator.mapping.pair.change-list.git.commit | ||
3: string.unquoted.git.commit markup.ignored.file.git.commit | ||
|
||
commands-line: | ||
# A rebase commit message's comment contains the list of the recent | ||
# operations to help understand the context of the current commit. | ||
- match: \s*({{operator}})\s+({{hash}})\s+(.+?)\s*$ | ||
scope: meta.command-list.git.commit | ||
captures: | ||
1: keyword.operator.git.commit | ||
2: constant.numeric.hex.hash.git.commit | ||
3: string.unquoted.subject.git.commit | ||
|
||
date-line: | ||
- match: \b({{date}})\s*(:)\s*(.*) | ||
captures: | ||
1: markup.heading.git.commit | ||
2: punctuation.separator.mapping.pair.date.git.commit | ||
3: constant.language.timestamp.git.commit | ||
|
||
head-line: | ||
# all comments ending with colon are scoped as headlines | ||
- match: \b\w.+(?=:\s*$) | ||
scope: markup.heading.git.commit | ||
|
||
dropped-content: | ||
# ------------------------ >8 ------------------------ | ||
- match: '# -{24} >8 -{24}\s*\n' | ||
scope: comment.line.git.commit markup.bold.commit | ||
set: | ||
- meta_content_scope: meta.dropped.git.commit | ||
- include: comments | ||
- match: ^(?=diff --git) | ||
set: [Packages/Diff/Diff.sublime-syntax] |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't those be removed from the variables below? Since they are the same for all the "sections", you can't differentiate between them.
Otoh, they probably won't be used and instead the original english text is shown, so it's not like it will hurt.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Those @it.po won't be added to a git generated comment and will therefore be ignored. We can use different placeholders if there are concerns about
@
being used as username reference, but I didn't see such in comments. too.Each variable has the same amount of "columns". Each column references a language / po-file. By removing those values we will loose this reference. If a single translation changes, you'll have to go through all translations and built up the list again. At the moment you now, bg.po belongs to the second column and so on. There are even duplicates in the columns, which I did not eliminate in order to keep this reference.
We can't use
(?x)
to split up in multiple lines and add a comment to each translation without adding dozens of[ ]
for whitespace and bloat the lists.