Skip to content

git

The community/apps/git directory provides a set of Talon scripts for interacting with Git from the command line. It defines commands, arguments, and convenience functions to make common Git operations faster and easier to use with voice.

The directory contains the following key files:

  • git_add_patch.talon: This file defines a set of commands to navigate the interactive git add --patch interface. It uses single-letter mnemonics common in the git add --patch interface (y, n, q, d, a). This provides voice equivalents for common interactive patch selection operations.
  • git.talon: This file provides the core Talon commands for interacting with git. It defines a generic git command that takes a command name from the user.git_command list and a variable number of arguments from the user.git_argument list. It also defines specific commands, such as git commit and git stash, that can take a spoken message. It also includes commonly used commands, like git status, git add patch, git show head, and git diff to be executed using the $, meaning they require no arguments. Finally, it provides a set of convenience commands using the clipboard or the current selection, such as git clone clipboard, git diff highlighted, and git add clipboard.
  • git_argument.talon-list: This file defines the user.git_argument list used in git.talon. This list provides named arguments such as --amend or --force, as well as branch names that can be used with git commands.
  • git.py: This file defines the user.git_command and user.git_argument lists used in git.talon, and a capture rule to allow multiple arguments, so that the command "git commit amend message foo bar" is interpreted as "git commit --amend --message "foo bar"".
  • git_command.talon-list: This file defines the user.git_command list used in git.talon. It contains most git commands, such as add, commit, push, and fetch, etc.

These files work together to provide a comprehensive voice interface for Git. The git_command.talon-list and git_argument.talon-list files define the vocabulary of git commands and options. The git.talon file uses these lists to create a flexible system to execute any git command. The git_add_patch.talon file uses single-letter mnemonics to make common interactive patch selection operations faster with voice. The git.py provides the necessary infrastructure to allow the use of user defined lists and arguments to be used in git.talon.