diff --git a/.github/workflows/bin.yml b/.github/workflows/bin.yml new file mode 100644 index 0000000..ba9233f --- /dev/null +++ b/.github/workflows/bin.yml @@ -0,0 +1,25 @@ +name: Check bin/auto-commit + +on: + pull_request: + branches: [main] + +jobs: + validate-binary: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Check that bin/auto-commit exists + run: | + if [ ! -f "bin/auto-commit" ]; then + echo "[-] bin/auto-commit not found." + exit 1 + fi + echo "[+] bin/auto-commit exists." + + - name: (Optional) Run binary with --help or version + run: | + ./bin/auto-commit --help || echo "Help output not available (optional check)." diff --git a/.github/workflows/c-check.yml b/.github/workflows/c-check.yml new file mode 100644 index 0000000..b5e2e55 --- /dev/null +++ b/.github/workflows/c-check.yml @@ -0,0 +1,40 @@ +name: Static C Check + +on: + pull_request: + branches: [main] + +jobs: + c_check: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Cache apt dependencies + uses: actions/cache@v3 + with: + path: | + /var/cache/apt + /var/lib/apt/lists + key: ${{ runner.os }}-apt-${{ hashFiles('**/Makefile') }} + restore-keys: | + ${{ runner.os }}-apt- + + - name: Install tools + run: | + sudo apt-get update + sudo apt-get install -y cppcheck clang clang-tools flawfinder mingw-w64 + + - name: Cppcheck analysis + run: | + cppcheck --enable=all --inconclusive --force --quiet ./ + + - name: Clang static analysis + run: | + scan-build --use-cc=x86_64-w64-mingw32-gcc gcc -c ./*.c + + - name: Security audit with Flawfinder + run: | + flawfinder ./ diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7de5e60..112f4ec 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -149,7 +149,9 @@ jobs: [©thefuture-industries](https://github.com/thefuture-industries) files: | - ./git-auto-commit/git-auto-commit + ./bin/auto-commit + ./scripts/install-linux-auto-commit.sh + ./install-windows-auto-commit.ps1 - name: Create new branch for next version run: | diff --git a/Makefile b/Makefile index c9e6569..bcc80b9 100644 --- a/Makefile +++ b/Makefile @@ -11,10 +11,30 @@ BUILDIN_STRINGS = stdlib/strings.c MAIN_OUT = "$(bindir)/auto-commit" +UNAME_S := $(shell uname -s) + CC = gcc +ifeq ($(OS),Windows_NT) + MKDIR = mkdir $(bindir) || echo "Directory already exists" + REMOVE_EXT = mv $(MAIN_OUT).exe $(MAIN_OUT) +else + MKDIR = mkdir -p $(bindir) + OS_TYPE = $(shell uname -s) + REMOVE_EXT = true +endif + build: - @if not exist $(bindir) mkdir $(bindir) + $(MKDIR) + $(CC) $(BUILDIN_MAIN) -o $(MAIN_OUT) $(BUILDIN_COMMIT) \ + $(BUILDIN_DETECT) $(BUILDIN_DIFF) $(BUILDIN_FILE) \ + $(BUILDIN_GET_STAGED) $(BUILDIN_STRINGS) $(BUILDIN_GIT_ROOT) \ + $(BUILDIN_PARSER) + + $(REMOVE_EXT) + +buildt: + $(MKDIR) $(CC) $(BUILDIN_MAIN) -o $(MAIN_OUT) $(BUILDIN_COMMIT) \ $(BUILDIN_DETECT) $(BUILDIN_DIFF) $(BUILDIN_FILE) \ $(BUILDIN_GET_STAGED) $(BUILDIN_STRINGS) $(BUILDIN_GIT_ROOT) \ diff --git a/README.md b/README.md index b128315..c878206 100644 --- a/README.md +++ b/README.md @@ -1,23 +1,32 @@ -# Git auto-commit +# Git auto-commit - automatic commit generation tool -`git auto-commit` is a simple and powerful tool for automating commits in Git. With it, you will no longer have to think and write committees. `git auto-commit` will do it for you! +Git Auto-Commit is an extension for the Git version control system designed to automatically generate meaningful and context—sensitive commit messages based on changes made to the codebase. The tool simplifies developers' workflows by allowing them to focus on the content of edits rather than on the formulation of descriptions for commits. -This is an open source project, which is covered by the Mit License version 1 (some parts of it are released under other licenses compatible with GPLv2). +The development is conducted as an open source project and is distributed under the MIT license (or other compatible licensing, depending on the implementation). Git Auto-Commit can be integrated into CI/CD pipelines, hook scripts, or used manually via the command line. + +Main features: + +- Analysis of changes in the work tree and automatic generation of commit messages in natural language. +- Integration with Git via the `git auto` sub-command or configuration of user aliases. +- Support for templates and configurations for configuring the message structure in accordance with project standards (Conventional Commits, Semantic Commit Messages, etc.). +- Scalability: works both in small projects and in large monorepositories. ## Install -You will need two things for installation +### If you're on windows -- If you're on windows +Go to the root of the project and run the command. ```bash -iex ((New-Object Net.WebClient).DownloadString('https://github.com/thefuture-industries/git-auto-commit/blob/main/scripts/auto-commit.ps1?raw=true')) +iex ((New-Object Net.WebClient).DownloadString('https://github.com/thefuture-industries/git-auto-commit/blob/main/scripts/install-windows-auto-commit.ps1?raw=true')) ``` -- If you're on linux +### If you're on linux + +Go to the root of the project and run the command. ```bash -bash <(curl -s https://github.com/thefuture-industries/git-auto-commit/blob/main/scripts/auto-commit.sh?raw=true) +bash <(curl -s https://github.com/thefuture-industries/git-auto-commit/blob/main/scripts/install-linux-auto-commit.sh?raw=true) ``` ## Setting up @@ -28,6 +37,6 @@ Everything is ready now, after making changes to the code, just run: ```bash git add . -git ac +git auto git push ``` diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 0000000..1a3baf1 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,34 @@ +# Security Policy + +Thanks for helping make Litestar safe for everyone. + +## Security + +Litestar takes the security of our projects and services seriously, including all of the repositories managed by the [litestar organization](https://github.com/litestar-org). + +We will ensure that your finding gets escalated to the appropriate maintainer(s) for remediation. + +## Reporting Security Issues + +**Please do not report security vulnerabilities through public GitHub issues, discussions, or pull requests.** + +[Click to Open a Security Advisory Privately](https://github.com/litestar-org/litestar/security/advisories/new) + +If you believe you have found a security vulnerability in any Litestar-managed repository, please report it to us through coordinated disclosure: + +- In the affected repository, browse to the **Security** tab, select **Advisories**, select "Report a vulnerability" + - ![image](https://user-images.githubusercontent.com/45884264/217041010-8fd6b96b-329d-4d8e-8838-9b5bf4e1a78d.png) +- Please do **NOT** create an issue in the affected repository +- Please do **NOT** send a private message to and/or tag the "@maintainer" role on our [Discord server](https://discord.gg/MmcwxztmQb) + +Please include as much of the information listed below as you can to help us better understand and resolve the issue: + +- The type of issue (e.g., buffer overflow, SQL injection, or cross-site scripting) +- Full paths of source file(s) related to the manifestation of the issue +- The location of the affected source code (tag/branch/commit or direct URL) +- Any special configuration required to reproduce the issue +- Step-by-step instructions to reproduce the issue +- Proof-of-concept or exploit code (if possible) +- Impact of the issue, including how an attacker might exploit the issue + +This information will help us triage your report more quickly. diff --git a/bin/auto-commit b/bin/auto-commit index 4fa0a04..8b23b5c 100644 Binary files a/bin/auto-commit and b/bin/auto-commit differ diff --git a/commit.c b/commit.c index ecbfa2c..d3b5f9e 100644 --- a/commit.c +++ b/commit.c @@ -7,7 +7,7 @@ #include "define.h" #include "file.h" -char* build_commit(char funcs[][MAX_FUNC_NAME], int funcs_count) { +char* build_commit(char a_funcs[][MAX_FUNC_NAME], int a_funcs_count, char d_funcs[][MAX_FUNC_NAME], int d_funcs_count) { int add_count, del_count, rn_count, ch_count; char** added = ad_f(&add_count); @@ -20,18 +20,24 @@ char* build_commit(char funcs[][MAX_FUNC_NAME], int funcs_count) { commit_message[0] = '\0'; - if (funcs_count > 0) { - if (funcs_count == 1) { - strcat(commit_message, "| added "); - strcat(commit_message, funcs[0]); + if (a_funcs_count > 0) { + if (a_funcs_count == 1) { + // strcat(commit_message, "| added "); + if (commit_message[0] != '\0') { + strcat(commit_message, " | added "); + } else { + strcat(commit_message, "added "); + } + + strcat(commit_message, a_funcs[0]); strcat(commit_message, " functionality"); } else { char* funcs_ptr[MAX_FUNC_COUNT]; - for (int i = 0; i < funcs_count; ++i) { - funcs_ptr[i] = funcs[i]; + for (int i = 0; i < a_funcs_count; ++i) { + funcs_ptr[i] = a_funcs[i]; } - char* funcs_str = join_strings(funcs_ptr, funcs_count - 1, ", "); - char* last_func = funcs[funcs_count - 1]; + char* funcs_str = join_strings(funcs_ptr, a_funcs_count - 1, ", "); + char* last_func = a_funcs[a_funcs_count - 1]; strcat(commit_message, "added "); strcat(commit_message, funcs_str); @@ -45,7 +51,12 @@ char* build_commit(char funcs[][MAX_FUNC_NAME], int funcs_count) { if (add_count > 0) { char* added_str = join_strings(added, add_count, ", "); - strcat(commit_message, " | including "); + if (commit_message[0] != '\0') { + strcat(commit_message, " | including "); + } else { + strcat(commit_message, "including "); + } + strcat(commit_message, added_str); remove_all_spaces(added_str); @@ -54,7 +65,12 @@ char* build_commit(char funcs[][MAX_FUNC_NAME], int funcs_count) { if (del_count > 0) { char* deleted_str = join_strings(deleted, del_count, ", "); - strcat(commit_message, " | deleted "); + if (commit_message[0] != '\0') { + strcat(commit_message, " | deleted "); + } else { + strcat(commit_message, "deleted "); + } + strcat(commit_message, deleted_str); remove_all_spaces(deleted_str); @@ -63,7 +79,12 @@ char* build_commit(char funcs[][MAX_FUNC_NAME], int funcs_count) { if (rn_count > 0) { char* renamed_str = join_strings(renamed, rn_count, ", "); - strcat(commit_message, " | renamed "); + if (commit_message[0] != '\0') { + strcat(commit_message, " | renamed "); + } else { + strcat(commit_message, "renamed "); + } + strcat(commit_message, renamed_str); remove_all_spaces(renamed_str); @@ -72,7 +93,12 @@ char* build_commit(char funcs[][MAX_FUNC_NAME], int funcs_count) { if (ch_count > 0) { char* changed_str = join_strings(changed, ch_count, ", "); - strcat(commit_message, " | changed "); + if (commit_message[0] != '\0') { + strcat(commit_message, " | changed "); + } else { + strcat(commit_message, "changed "); + } + strcat(commit_message, changed_str); remove_all_spaces(changed_str); @@ -87,12 +113,12 @@ char* build_commit(char funcs[][MAX_FUNC_NAME], int funcs_count) { if (strlen(commit_message) > COMMIT_LENGTH) { free(commit_message); - if (funcs_count > 0) { + if (a_funcs_count > 0) { char* funcs_ptr[MAX_FUNC_COUNT]; - for (int i = 0; i < funcs_count; ++i) { - funcs_ptr[i] = funcs[i]; + for (int i = 0; i < a_funcs_count; ++i) { + funcs_ptr[i] = a_funcs[i]; } - char* funcs_str = join_strings(funcs_ptr, funcs_count, ", "); + char* funcs_str = join_strings(funcs_ptr, a_funcs_count, ", "); char* short_commit = malloc(strlen("added ") + strlen(funcs_str) + 12); if (!short_commit) return NULL; sprintf(short_commit, "added %s functionality", funcs_str); @@ -143,6 +169,24 @@ char* build_commit(char funcs[][MAX_FUNC_NAME], int funcs_count) { } } + if (d_funcs_count > 0) { + char* d_ptrs[MAX_FUNC_COUNT]; + for (int i = 0; i < d_funcs_count; ++i) { + d_ptrs[i] = d_funcs[i]; + } + + char* d_str = join_strings(d_ptrs, d_funcs_count, ", "); + const char* suffix = " | deleted functionality: "; + size_t extra_len = strlen(suffix) + strlen(d_str); + + if (strlen(commit_message) + extra_len < COMMIT_LENGTH) { + strcat(commit_message, suffix); + strcat(commit_message, d_str); + } + + free(d_str); + } + remove_all_spaces(commit_message); return commit_message; } diff --git a/commit.h b/commit.h index 3cfaf67..60c623f 100644 --- a/commit.h +++ b/commit.h @@ -1,7 +1,7 @@ #ifndef COMMIT_H #define COMMIT_H -char* build_commit(char funcs[][MAX_FUNC_NAME], int funcs_count); +char* build_commit(char a_funcs[][MAX_FUNC_NAME], int a_funcs_count, char d_funcs[][MAX_FUNC_NAME], int d_funcs_count); int git_commit(const char* message); diff --git a/diff.c b/diff.c index 47fd1f4..69c3372 100644 --- a/diff.c +++ b/diff.c @@ -25,7 +25,7 @@ char* get_diff(const char* file) { return buffer; } -void extract_functions(const char* diff, const char* lang, char funcs[][MAX_FUNC_NAME], int* func_count) { +void extract_added_functions(const char* diff, const char* lang, char a_funcs[][MAX_FUNC_NAME], int* a_func_count) { const char* line = diff; char buffer[1024]; @@ -38,8 +38,8 @@ void extract_functions(const char* diff, const char* lang, char funcs[][MAX_FUNC if (strcmp(lang, "c") == 0 || strcmp(lang, "cpp") == 0) { if (strchr(buffer, '(') && strchr(buffer, ')') && strchr(buffer, '{')) { if (sscanf(buffer, "+%*[^ ] %127[^ (]", fname) == 1) { - strcpy(funcs[*func_count], fname); - (*func_count)++; + strcpy(a_funcs[*a_func_count], fname); + (*a_func_count)++; } } } @@ -48,8 +48,8 @@ void extract_functions(const char* diff, const char* lang, char funcs[][MAX_FUNC else if (strcmp(lang, "golang") == 0) { if (strstr(buffer, "+func ")) { if (sscanf(buffer, "+func %127[^ (]", fname) == 1) { - strcpy(funcs[*func_count], fname); - (*func_count)++; + strcpy(a_funcs[*a_func_count], fname); + (*a_func_count)++; } } } @@ -58,8 +58,8 @@ void extract_functions(const char* diff, const char* lang, char funcs[][MAX_FUNC else if (strcmp(lang, "python") == 0 || strcmp(lang, "scala") == 0) { if (strstr(buffer, "+def ")) { if (sscanf(buffer, "+def %127[^ (]", fname) == 1) { - strcpy(funcs[*func_count], fname); - (*func_count)++; + strcpy(a_funcs[*a_func_count], fname); + (*a_func_count)++; } } } @@ -68,8 +68,8 @@ void extract_functions(const char* diff, const char* lang, char funcs[][MAX_FUNC else if (strcmp(lang, "java") == 0 || strcmp(lang, "csharp") == 0) { if (strchr(buffer, '(') && strstr(buffer, "+public") || strstr(buffer, "+private") || strstr(buffer, "+protected")) { if (sscanf(buffer, "+%*s %*s %127[^ (]", fname) == 1) { - strcpy(funcs[*func_count], fname); - (*func_count)++; + strcpy(a_funcs[*a_func_count], fname); + (*a_func_count)++; } } } @@ -78,8 +78,8 @@ void extract_functions(const char* diff, const char* lang, char funcs[][MAX_FUNC else if (strcmp(lang, "rust") == 0) { if (strstr(buffer, "+fn ")) { if (sscanf(buffer, "+fn %127[^ (]", fname) == 1) { - strcpy(funcs[*func_count], fname); - (*func_count)++; + strcpy(a_funcs[*a_func_count], fname); + (*a_func_count)++; } } } @@ -88,14 +88,95 @@ void extract_functions(const char* diff, const char* lang, char funcs[][MAX_FUNC else if (strcmp(lang, "javascript") == 0 || strcmp(lang, "typescript") == 0) { if (strstr(buffer, "+function ")) { if (sscanf(buffer, "+function %127[^ (]", fname) == 1) { - strcpy(funcs[*func_count], fname); - (*func_count)++; + strcpy(a_funcs[*a_func_count], fname); + (*a_func_count)++; } } else { if (sscanf(buffer, "+%127[^ =:(]", fname) == 1 && strchr(buffer, '(') && strchr(buffer, ')')) { - strcpy(funcs[*func_count], fname); - (*func_count)++; + strcpy(a_funcs[*a_func_count], fname); + (*a_func_count)++; + } + } + } + } + + line += strlen(buffer); + while (*line == '\n' || *line == '\r') line++; + } +} + +void extract_deleted_functions(const char* diff, const char* lang, char d_funcs[][MAX_FUNC_NAME], int* d_func_count) { + const char* line = diff; + char buffer[1024]; + + while (*line) { + sscanf(line, "%[^\n]\n", buffer); + if (strncmp(buffer, "-", 1) == 0) { + char fname[128]; + + // --- C / C++ --- + if (strcmp(lang, "c") == 0 || strcmp(lang, "cpp") == 0) { + if (strchr(buffer, '(') && strchr(buffer, ')') && strchr(buffer, '{')) { + if (sscanf(buffer, "+%*[^ ] %127[^ (]", fname) == 1) { + strcpy(d_funcs[*d_func_count], fname); + (*d_func_count)++; + } + } + } + + // --- Golang --- + else if (strcmp(lang, "golang") == 0) { + if (strstr(buffer, "+func ")) { + if (sscanf(buffer, "+func %127[^ (]", fname) == 1) { + strcpy(d_funcs[*d_func_count], fname); + (*d_func_count)++; + } + } + } + + // --- Python / Scala --- + else if (strcmp(lang, "python") == 0 || strcmp(lang, "scala") == 0) { + if (strstr(buffer, "+def ")) { + if (sscanf(buffer, "+def %127[^ (]", fname) == 1) { + strcpy(d_funcs[*d_func_count], fname); + (*d_func_count)++; + } + } + } + + // --- Java / C# --- + else if (strcmp(lang, "java") == 0 || strcmp(lang, "csharp") == 0) { + if (strchr(buffer, '(') && strstr(buffer, "+public") || strstr(buffer, "+private") || strstr(buffer, "+protected")) { + if (sscanf(buffer, "+%*s %*s %127[^ (]", fname) == 1) { + strcpy(d_funcs[*d_func_count], fname); + (*d_func_count)++; + } + } + } + + // --- Rust --- + else if (strcmp(lang, "rust") == 0) { + if (strstr(buffer, "+fn ")) { + if (sscanf(buffer, "+fn %127[^ (]", fname) == 1) { + strcpy(d_funcs[*d_func_count], fname); + (*d_func_count)++; + } + } + } + + // --- JavaScript / TypeScript --- + else if (strcmp(lang, "javascript") == 0 || strcmp(lang, "typescript") == 0) { + if (strstr(buffer, "+function ")) { + if (sscanf(buffer, "+function %127[^ (]", fname) == 1) { + strcpy(d_funcs[*d_func_count], fname); + (*d_func_count)++; + } + } else { + if (sscanf(buffer, "+%127[^ =:(]", fname) == 1 && + strchr(buffer, '(') && strchr(buffer, ')')) { + strcpy(d_funcs[*d_func_count], fname); + (*d_func_count)++; } } } diff --git a/diff.h b/diff.h index 90c6511..d5e83ec 100644 --- a/diff.h +++ b/diff.h @@ -3,7 +3,9 @@ char* get_diff(const char* file); -void extract_functions(const char* diff, const char* lang, char funcs[][MAX_FUNC_NAME], int* func_count); +void extract_added_functions(const char* diff, const char* lang, char a_funcs[][MAX_FUNC_NAME], int* a_func_count); + +void extract_deleted_functions(const char* diff, const char* lang, char d_funcs[][MAX_FUNC_NAME], int* d_func_count); char** get_staged_files(int* count); diff --git a/main.c b/main.c index 1bdf165..a0a7414 100644 --- a/main.c +++ b/main.c @@ -18,8 +18,11 @@ int main() { return 0; } - char funcs[MAX_FUNC_COUNT][MAX_FUNC_NAME]; - int func_count = 0; + char a_funcs[MAX_FUNC_COUNT][MAX_FUNC_NAME]; + int a_func_count = 0; + + char d_funcs[MAX_FUNC_COUNT][MAX_FUNC_NAME]; + int d_func_count = 0; for (int i = 0; i < file_count; i++) { const char* lang = detect_language(files[i]); @@ -27,20 +30,21 @@ int main() { char* diff = get_diff(files[i]); if (diff != NULL) { - extract_functions(diff, lang, funcs, &func_count); + extract_added_functions(diff, lang, a_funcs, &a_func_count); + extract_deleted_functions(diff, lang, d_funcs, &d_func_count); free(diff); } } - char* p_commit_msg = tb_keywords(funcs, file_count); + char* p_commit_msg = tb_keywords(a_funcs, file_count); if (p_commit_msg && strlen(p_commit_msg) > 0) { printf("[git auto-commit] commit is: %s\n", p_commit_msg); int result = git_commit(p_commit_msg); free(p_commit_msg); } else { - char* commit_msg = build_commit(funcs, func_count); - printf("[git auto-commit] commit is: %s\n", commit_msg); + char* commit_msg = build_commit(a_funcs, a_func_count, d_funcs, d_func_count); + printf("\033[0;34m[git auto-commit] commit is: %s\033[0m\n", commit_msg); int result = git_commit(commit_msg); free(commit_msg); diff --git a/parser.h b/parser.h index 8f75ce0..ccbbcf7 100644 --- a/parser.h +++ b/parser.h @@ -1,7 +1,7 @@ #ifndef PARSER_H #define PARSER_H -static const char* keywords[] = {"test", "tests", "testing", "http", "https", "struct", "class"}; +static const char* keywords[] = {"test", "tests", "testing", "http", "https", "image", "resource"}; static const size_t keyword_count = sizeof(keywords) / sizeof(keywords[0]); typedef struct { diff --git a/scripts/auto-commit.sh b/scripts/auto-commit.sh deleted file mode 100644 index 415605e..0000000 --- a/scripts/auto-commit.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash - -set -e - -HOME="$(git rev-parse --show-toplevel)" -cd "$HOME" - -BINARY_NAME="git-auto-commit" -HOOKS_DIR=".git/hooks" -TARGET="$HOOKS_DIR/auto-commit" - -if [ ! -d .git ]; then - echo "[!] There is no .git. Run it in the root of the Git repository." - exit 1 -fi - -cp "$BINARY_NAME" "$TARGET" -chmod +x "$TARGET" -echo "[+] The binary is copied to $TARGET" - -git config alias.ac '!f() { .git/hooks/auto-commit "$@"; }; f' - -echo "[+] Git alias 'git ac' is configured. Now you can run: git ac" diff --git a/scripts/install-linux-auto-commit.sh b/scripts/install-linux-auto-commit.sh new file mode 100644 index 0000000..c28034d --- /dev/null +++ b/scripts/install-linux-auto-commit.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +set -e + +HOME="$(git rev-parse --show-toplevel)" +cd "$HOME" + +BINARY_NAME="auto-commit" +HOOKS_DIR=".git/hooks" +HOOK_PATH="$HOOKS_DIR/$BINARY_NAME" + +URL="https://github.com/thefuture-industries/git-auto-commit/blob/main/bin/auto-commit?raw=true" + +if [ ! -d .git ]; then + echo "[!] There is no .git. Run it in the root of the Git repository." + exit 1 +fi + +echo "Installing $URL..." +if curl -fsSL "$URL" -o "$HOOK_PATH"; then + chmod +x "$HOOK_PATH" + echo "File saved as $HOOK_PATH" +else + echo "Error: Failed to download the hook script." + exit 1 +fi + +git config --local alias.auto "!$HOOK_PATH" +echo "[+] Git alias 'git auto' is configured. Now you can run: git auto" diff --git a/scripts/auto-commit.ps1 b/scripts/install-windows-auto-commit.ps1 similarity index 82% rename from scripts/auto-commit.ps1 rename to scripts/install-windows-auto-commit.ps1 index f33dc65..d8e3145 100644 --- a/scripts/auto-commit.ps1 +++ b/scripts/install-windows-auto-commit.ps1 @@ -24,5 +24,5 @@ try { return } -git config --local alias.ac "!./.git/hooks/auto-commit" -Write-Host "[+] Git alias 'git ac' configured. Now you can run: git ac" +git config --local alias.auto "!./.git/hooks/auto-commit" +Write-Host "[+] Git alias 'git auto' configured. Now you can run: git auto"