Skip to content

Instantly share code, notes, and snippets.

@turbq
Created August 13, 2024 13:04
Show Gist options
  • Save turbq/f538d17adf77a831c2c84e8d238f877b to your computer and use it in GitHub Desktop.
Save turbq/f538d17adf77a831c2c84e8d238f877b to your computer and use it in GitHub Desktop.

Revisions

  1. turbq created this gist Aug 13, 2024.
    11 changes: 11 additions & 0 deletions commit-hash.bat
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    rem to use as a command make precentage signs single

    git log -n 1 --pretty=format:^
    "^
    #ifndef GIT_COMMIT_H%%n^
    #define GIT_COMMIT_H%%n^
    %%n^
    static const char* GIT_INFO = \"[%%H, %%d]\r\n\";%%n^
    %%n^
    #endif%%n^
    " > ..\src\gitcommit.h