<commit_before>%YAML 1.2
---
# http://www.sublimetext.com/docs/3/syntax.html
name: GitSavvy Commit
hidden: true
scope: git-savvy.commit
contexts:
  main:
    - match: (?=^commit)
      push: commit-header

  commit-header:
    - meta_scope: meta.commit-info.header
    - match: ^(commit)(.+)$\n?
      comment: commit header
      scope: meta.commit-info.header.key-value
      captures:
        1: string.other.commit-info.header.key.git-savvy
        2: meta.commit-info.header.value.git-savvy meta.commit-info.header.sha.git-savvy

    - match: ^(Author|Date|Merge|AuthorDate|Commit|CommitDate)(:)(.+)$\n?
      comment: author and date info
      scope: meta.commit-info.header.key-value
      captures:
        1: string.other.commit-info.header.key.git-savvy
        2: string.other.commit-info.header.key.punctuation.git-savvy
        3: meta.commit-info.header.value.git-savvy

    - match: ^$
      set: commit-message

  commit-message:
    - meta_scope: meta.commit_message
    - match: ^\s*(?=\S+)
      set: commit-subject

  commit-subject:
    - meta_scope: meta.commit_message meta.subject.git.commit markup.heading.subject.git.commit
    - match: $\n?
      set: commit-message-body
    - include: make_commit.sublime-syntax#references

  commit-message-body:
    - match: ^
      push:
        - meta_scope: meta.commit_message
        - match: (?=^diff\s)
          set: "scope:git-savvy.diff"
        # Merge commits "just" start the diffstat without the "---" line
        - match: (?=^ \S)
          set: "scope:git-savvy.diff"
        - match: ^---$\n?
          scope: meta.commit-header-and-stat-splitter
          set: "scope:git-savvy.diff"
        - include: make_commit.sublime-syntax#references<commit_msg>Fix "show_commit" syntax to support multiple commits in a view<commit_after>%YAML 1.2
---
# http://www.sublimetext.com/docs/3/syntax.html
name: GitSavvy Commit
hidden: true
scope: git-savvy.commit
contexts:
  main:
    - match: (?=^commit)
      push: commit-header

  commit-header:
    - meta_scope: meta.commit-info.header
    - match: ^(commit)(.+)$\n?
      comment: commit header
      scope: meta.commit-info.header.key-value
      captures:
        1: string.other.commit-info.header.key.git-savvy
        2: meta.commit-info.header.value.git-savvy meta.commit-info.header.sha.git-savvy

    - match: ^(Author|Date|Merge|AuthorDate|Commit|CommitDate)(:)(.+)$\n?
      comment: author and date info
      scope: meta.commit-info.header.key-value
      captures:
        1: string.other.commit-info.header.key.git-savvy
        2: string.other.commit-info.header.key.punctuation.git-savvy
        3: meta.commit-info.header.value.git-savvy

    - match: ^$
      set: commit-message

  commit-message:
    - meta_scope: meta.commit_message
    - match: ^\s*(?=\S+)
      set: commit-subject

  commit-subject:
    - meta_scope: meta.commit_message meta.subject.git.commit markup.heading.subject.git.commit
    - match: $\n?
      set: commit-message-body
    - include: make_commit.sublime-syntax#references

  commit-message-body:
    - match: ^
      push:
        - meta_scope: meta.commit_message
        - match: (?=^commit \h{7,})
          set: main
        - match: (?=^diff\s)
          embed: "scope:git-savvy.diff"
          escape: (?=^commit \h{7,})
        # Merge commits "just" start the diffstat without the "---" line
        - match: (?=^ \S)
          embed: "scope:git-savvy.diff"
          escape: (?=^commit \h{7,})
        - match: ^---$\n?
          scope: meta.commit-header-and-stat-splitter
          embed: "scope:git-savvy.diff"
          escape: (?=^commit \h{7,})
        - include: make_commit.sublime-syntax#references
{'fraction_non_alphanumeric': 0.14997292907417434, 'fraction_numerical': 0.005414185165132647, 'mean_word_length': 2.3713503649635035, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4803367', 'n_tokens_mistral': 1315, 'n_tokens_neox': 1259, 'n_words': 220}