🐛 fix(config.ts): add missing new lines
🐛 fix(githook.ts): capitalize OpenCommit and fix grammar
The COMMANDS enum values were reordered to improve readability and consistency. In config.ts, missing new lines were added to improve code readability. In githook.ts, OpenCommit was capitalized and grammar was fixed to improve clarity.
feat(commit.ts): add support for pushing to selected remote instead of default remote
refactor(commit.ts): extract push command to a function and reuse it for both default and selected remote
* 🐛 fix(commit.ts): add --verbose flag to git push command
The --verbose flag is added to the git push command to provide more detailed output. This helps with debugging and identifying any issues that may arise during the push process.
The function getStagedFiles has been refactored to use git rev-parse to
get the root directory of the repository. This improves the reliability
of the function as it will work regardless of the current working
directory. The root directory is then passed to the git diff command to
get the list of staged files. With only the --relative flag, staged
diff(s) on files in a different same level directory as the current
working one would not be found by the command.
feat(api.ts): add function to get the latest version of opencommit from unpkg.com
feat(commit.ts): add support for pushing to multiple remotes and prompt user to choose which remote to push to
feat(i18n): add support for Portuguese (Brazil) language and translation for commit messages in pt_br.json
feat(utils): add checkIsLatestVersion function to check if the current version is the latest version
fix(git.ts): add --relative flag to getStagedFiles function to return relative paths
refactor(commit.ts): rename getStagedGitDiff to getChangedFiles and remove unused import of generateCommitMessageWithChatCompletion
refactor(commit.ts): reformat import statements for better readability
refactor(commit.ts): reformat code for better readability
feat(commit.ts): add support for selecting remote to push to when multiple remotes are available
refactor(commit.ts): remove unnecessary code and fix formatting
feat(commit.ts): add support for extraArgs parameter in generateCommitMessageFromGitDiff function
chore(checkIsLatestVersion.ts): update console message for clarity and readability
fix(git.ts): handle empty output from git command
fix(git.ts): add -- argument to git diff command to handle file names with leading hyphens
refactor(mergeStrings.ts): remove unnecessary whitespace and add missing semicolon
* 🔨 refactor(commit.ts): rename function to getGitRemotes and improve comments
This commit renames the function to getGitRemotes to better reflect its purpose. Additionally, the comments have been improved to better explain the function's behavior.
🚀 chore(commit.ts): add support for pushing to selected remote
This commit adds support for pushing to the selected remote. The user is prompted to choose a remote from the list of available remotes, and the selected remote is used to push the changes. The push command is run with the selected remote as an argument.
🐛 fix(commit.ts): fix formatting and add missing newline at end of file
This commit fixes the formatting of the code and adds a missing newline at the end of the file. The changes do not affect the functionality of the code.
* 🐛 fix(commit.ts): fix push command to include remote name
✨ feat(commit.ts): add support for multiple remotes
The push command was not including the remote name, which caused the push to fail. This has been fixed. Support for multiple remotes has been added, allowing the user to choose which remote to push to. If there is only one remote, the push command will automatically use that remote.
* ✨ feat(cli.ts): add checkIsLatestVersion function
This commit adds a new function that checks if the current version of OpenCommit is the latest version. The function uses the getOpenCommitLatestVersion function from the api module to get the latest version of OpenCommit. If the current version is not the latest version, a warning message is printed to the console, informing the user to update to the latest version to get the latest features and bug fixes.
The relative flag has been added to the git diff command in the
getStagedFiles function. This flag makes the output of the command
relative to the current working directory, which makes it easier to work
with the file paths and enables executing opencommit from anywhere in
the repository, not just from the root.
refactor(commit.ts): add types to commit function parameters
fix(git.ts): handle empty string returned from getStagedFiles function
refactor(mergeStrings.ts): remove unnecessary blank line and add missing semicolon
feat(git.ts): replace text prompt with outro prompt in showSomeFilesExcludedMessage function
feat(git.ts): add support for showing excluded files message in getStagedFiles, getChangedFiles, gitAdd and getDiff functions
feat(commit.ts): add support for staging all files and generating commit message when no files are staged
feat(commit.ts): add support for committing changes when no files are staged and some files are changed but not staged
* chore(package.json): add "@bdsqqq/try" dependency
* refactor(api.ts): remove unnecessary whitespace
* refactor(cli.ts): remove unused imports and variables
* refactor(commit.ts): rename getStagedGitDiff to getDif
* refactor(commit.ts): add getStagedFiles and getChangedFiles functions
* feat(commit.ts): add multiselect prompt to select files to stage
* feat(commit.ts): add gitAdd function to stage selected files
* feat(commit.ts): add trytm function to handle errors
* feat(commit.ts): add exitProgram function to exit the program with an error message if an error occurs during execution
* refactor(commit.ts): refactor commit function to handle unstaged files
* feat(commit.ts): add multiselect prompt to select files to add to commit when there are unstaged files
* feat(git.ts): add getStagedFiles function to get list of staged files
* feat(git.ts): add getChangedFiles function to get list of changed files
* feat(git.ts): add gitAdd function to add files to commit
* feat(git.ts): add getDif function to get diff of staged files
* refactor(commit.ts): replace exitProgram function with process.exit(1) to exit the program
* refactor(commit.ts): change message prompt to English in multiselect function
* chore(package.json): add prettier to format code
* refactor(api.ts): remove unnecessary whitespace and comments
* refactor(commit.ts): add missing semicolons and fix formatting
* feat(commit.ts): add support for selecting files to add to the commit when there are changed files but no staged files
* refactor(commit.ts): add isStageAllFlag parameter to commit function
* refactor(commit.ts): add whitespace to getDif function call
* refactor(commit.ts): add whitespace to generateCommitMessageFromGitDiff function call
* refactor(git.ts): reformat code for better readability
* chore(git.ts): add semicolons to the end of each statement
* chore(package.json): remove "@bdsqqq/try" dependency
* refactor(commit.ts): move trytm function to utils/trytm.ts
* refactor(commit.ts): add isStageAllFlag parameter to gitAdd function call in commit function
* refactor(commit.ts): remove getStagedGitDiff function call and use getStagedFiles function call instead
* refactor(commit.ts): add error handling to generateCommitMessageFromGitDiff function call in commit function
* refactor(prepare-commit-msg-hook.ts): rename getStagedGitDiff to getStagedFiles
* feat(prepare-commit-msg-hook.ts): add gitAdd function to stage changes before generating commit message
* refactor(prepare-commit-msg-hook.ts): use getDif function to get staged changes diff instead of staged.diff
* refactor(prepare-commit-msg-hook.ts): remove unnecessary if statement and return statement
* refactor(git.ts): remove StagedDiff interface and getStagedGitDiff function
* feat(git.ts): add support for untracked files in getChangedFiles function
* refactor(git.ts): rename stdout variable in getChangedFiles function
* refactor(git.ts): add excludeBigFilesFromDiff to getDif function
* feat(trytm.ts): add trytm utility function for handling promises with try-catch block
* fix(commit.ts): add missing function call parentheses in return statement
* refactor(commit.ts): remove unused variable generateCommitResponse
* refactor(commit.ts): exit process with code 0 after successful commit
* fix(commit.ts): add check for no changes detected before opening commit prompt
* fix(commit.ts): fix typo in function name from getDif to getDiff
* fix(prepare-commit-msg-hook.ts): fix typo in function name from getDif to getDiff
* refactor(git.ts): rename getDif function to getDiff for consistency and clarity
* chore(git.ts): add excludeBigFilesFromDiff option to getStagedFiles function
* chore(git.ts): import text function from @clack/prompts package
* refactor(git.ts): remove excludeBigFilesFromDiff constant and filter out .lock files from getStagedFiles and getChangedFiles functions
* feat(git.ts): add error message when all staged files are .lock files
* feat(git.ts): add error message when all changed files are .lock files
* feat(git.ts): add warning message when some files are .lock files and excluded from git add and git diff
* refactor(git.ts): add filter to remove empty strings from returned array in getStagedFiles and getChangedFiles functions
* refactor(commit.ts): pass isStageAllFlag to getChangedFiles function
* fix(commit.ts): handle errorStagedFiles and errorChangedFiles variables
* fix(git.ts): filter out empty strings from excludedFiles array
* feat(git.ts): add isStageAllFlag parameter to getChangedFiles function to handle git add --all command
* refactor(git.ts): remove console.log statement from getChangedFiles function and refactor code to improve readability
* refactor(commit.ts): remove unnecessary parameter from getChangedFiles function call
* refactor(git.ts): remove isStageAllFlag parameter from getChangedFiles function and add check for .lock files in the returned files list
* refactor(commit.ts): remove unnecessary line breaks and whitespace
* refactor(commit.ts): remove unnecessary parentheses in function calls
* feat(git.ts): add someFilesExcludedMessage function to display excluded files message
* refactor(git.ts): use someFilesExcludedMessage function instead of text function in getChangedFiles, gitAdd, and getDiff functions
* refactor(git.ts): extract someFilesExcludedMessage function to handle excluded files message
* fix(git.ts): use someFilesExcludedMessage function instead of throwing an error when all staged files are excluded files
* refactor(git.ts): pad excluded files list with 5 spaces
* refactor(git.ts): remove unnecessary padStart method call in someFilesExcludedMessage function
* chore(git.ts): update someFilesExcludedMessage function to improve readability
---------
Co-authored-by: Sukharev <57486732+di-sukharev@users.noreply.github.com>