prepare-commit-msg | Automatically prefix commit messages | Version Control System library

 by   janniks Shell Version: Current License: GPL-3.0

kandi X-RAY | prepare-commit-msg Summary

kandi X-RAY | prepare-commit-msg Summary

prepare-commit-msg is a Shell library typically used in Devops, Version Control System, Jira applications. prepare-commit-msg has no bugs, it has no vulnerabilities, it has a Strong Copyleft License and it has low support. You can download it from GitHub.

This git hook automatically prepends a parsed issue number (from the current branch) to your commit messages on every commit. (See Usage for examples and details). This git hook requires ruby to be installed (already pre-installed by default on macOS).
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              prepare-commit-msg has a low active ecosystem.
              It has 23 star(s) with 6 fork(s). There are 1 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              There are 0 open issues and 2 have been closed. On average issues are closed in 146 days. There are 1 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of prepare-commit-msg is current.

            kandi-Quality Quality

              prepare-commit-msg has 0 bugs and 0 code smells.

            kandi-Security Security

              prepare-commit-msg has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              prepare-commit-msg code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              prepare-commit-msg is licensed under the GPL-3.0 License. This license is Strong Copyleft.
              Strong Copyleft licenses enforce sharing, and you can use them when creating open source projects.

            kandi-Reuse Reuse

              prepare-commit-msg releases are not available. You will need to build from source code and install.
              Installation instructions, examples and code snippets are available.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of prepare-commit-msg
            Get all kandi verified functions for this library.

            prepare-commit-msg Key Features

            No Key Features are available at this moment for prepare-commit-msg.

            prepare-commit-msg Examples and Code Snippets

            No Code Snippets are available at this moment for prepare-commit-msg.

            Community Discussions

            QUESTION

            Why are git commands like push printing "\S Kernel on an" to the terminal each time i run them?
            Asked 2022-Feb-16 at 22:48

            When I run git, it is printing some odd text to the terminal that seems unrelated to the command. For example, with git push:

            ...

            ANSWER

            Answered 2022-Feb-16 at 19:45

            QUESTION

            How to automaticaly add global config variable in commit messge?
            Asked 2022-Jan-05 at 22:36

            I should like to add my team name in the commit message automatically, that I have registered in the global config with the following command:

            git config --global user.team "Seawolves"

            There are many teams working in same project and we share a template file that is specified in gitconfig file.

            ...

            ANSWER

            Answered 2022-Jan-05 at 22:36

            The best way to handle this is indeed to use the prepare-commit-msg hook. When you create one, you should take note of the arguments passed to it, and, unless you want to make your life needlessly difficult, avoid modifying it when you're using git commit --amend (such as when the second argument is commit).

            Note that the hook needs to modify the file that's the first argument in place, which is different from what many people expect. As such, you will often want to use something like the -i argument to Perl, Ruby, or sed, or a scriptable line editor like ed -s or ex -s with the w command.

            If you're trying to add a trailer, then git interpret-trailers may be helpful to add the entry you desire based on the config, and you can customize it to not add an entry if one is already present. It can't use user.team, but it can use other configuration options to set the trailer.

            An example where you're trying to simply replace a %(team) token from the template with the value of user.team looks like this:

            Source https://stackoverflow.com/questions/70584271

            QUESTION

            up-to-date commit message template after pre-commit hook
            Asked 2021-Aug-22 at 10:38

            I want to set up my git hooks so that when I commit something, an artifact is automatically produced if not up-to-date with the codebase, then staged and committed together with the rest of the manually staged files.

            I know it's not necessarily a best practice, but I'm still experimenting at this point and I would like to have this option; another option would be to make the pre-commit hook fail if the artifact is outdated and then manually stage it, but since the artifact is only needed by the CI pipeline this would be a probably useless additional step.

            I'm currently producing the artifact and staging it (by git add artifact) in the pre-commit hook. It's working.

            The issue is that the commit message template (the one that pops out when I edit a new commit message in my editor) does not reflect the updated index (after the pre-commit hook modified it by staging the new artifact).

            Any idea on how to keep that message up-to-date?

            I was looking into prepare-commit-msg: I can manipulate the outdated message there. Is there a command that output the whole content of the file COMMIT_EDITMSG? Maybe I could rerun it somehow and replace the file content...

            EDIT: I'm looking at the source code. It seems that the message is composed in the code, not by a command (inside the prepare_to_commit function, half hard-coded half output of status_printf and status_printf_ln). The pre-commit is called before the message is composed, but from the same function, which could explain why the message is outdated (my git add command does not modify that function state). This does not bode well.

            ...

            ANSWER

            Answered 2021-Aug-22 at 10:38

            Because of the way the initial commit message is produced, it seems there's no easy way to leverage directly that code (see my edit).

            A manual rewrite is needed, but as it turned out, it's not that difficult to achieve. This is a prepare-commit-msg hook that does what I wanted:

            Source https://stackoverflow.com/questions/68877105

            QUESTION

            Why do I have error when trying to do git push
            Asked 2021-Jul-01 at 12:14

            I run the following line git

            ...

            ANSWER

            Answered 2021-Jul-01 at 12:14

            From the looks of it, you have several hooks installed.

            The one that triggers on git push is pre-push.

            If you don't remember/don't know how it was installed and what it does, you can inspect its content by opening .git/hooks/pre-push in an editor.

            From the looks of it : it tries at least to run the typescript compiler on your project.

            The initial message you mention is just a warning message, and shouldn't be the cause of your failed job. You should inspect the errors mentioned after that to have a pointer to what is actually refused by the compiler.

            As said in the comments by @AlexeyLarionov : you should see the same errors from your ide, or by invoking tsc from the command line on your project.

            Source https://stackoverflow.com/questions/68207280

            QUESTION

            Jest and Commitizen: Commit works even if tests fail
            Asked 2021-Apr-07 at 15:42

            I am currently using Jest, Husky, Commitizen, and Vuepress. However, when jest tests or the build fails, the commit hook still works. How can I fix this to exit the commitizen hook when things fail? Here is the relevant lines in package.json:

            ...

            ANSWER

            Answered 2021-Apr-07 at 15:42

            Figured it out - it was simple. I needed to add the following to husky:

            Source https://stackoverflow.com/questions/66988555

            QUESTION

            WSL+samba+git: "error: insufficient permission for adding an object to repository database .git/objects" / git-clone / git-add permission errors
            Asked 2021-Jan-21 at 17:18

            I'm working on Win10 using the WSL1 (Windows Linux Subsystem) with Ubuntu 20.04.1 LTS. I have a Samba (1.0) Network Share on which I want to create my git repository via my Ubuntu Terminal.

            ...

            ANSWER

            Answered 2021-Jan-21 at 17:16
            Solution: Upgrade to WSL2

            As I found out, the solution was to Upgrade from WSL1 to WSL2, there mounting works correctly. I'm able to git-add or git-clone without permission errors now.

            Open a PowerShell to see your current version:

            Source https://stackoverflow.com/questions/65790476

            QUESTION

            Bash git-hook runs correctly on linux but fails on mac
            Asked 2020-Sep-04 at 00:21

            I'm trying to write my first git hook for prepare-commit-msg , I've put this together which behaves exactly as I want it on my Fedora box:

            ...

            ANSWER

            Answered 2020-Sep-04 at 00:21

            Write you script like that with the sh shebang and check it with https://www.shellcheck.net/

            If everything is ok with the sh shebang, it means the script will work ok with any version of bash, zsh, or whatever POSIX shell interpreter. MacOS's BSD type environment may have tools with different syntax or at least lacking the GNU CoreUtils specific features, so be cautious not to use these specific options when running commands.

            Source https://stackoverflow.com/questions/63731706

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install prepare-commit-msg

            To install simply run the following command. This requires curl to be installed. If you choose the option to install globally, you will have to reinitialize all your git repositories. The following helpful command reinitializes all repositories found in sub-directories of the current directory. find . -name .git -type d -prune -exec sh -c 'git --git-dir "{}" init' \;.
            If you prefer to install manually you can walk through the following steps:.
            Copy the scripts/prepare-commit-msg script into your local git repository inside .git/hooks
            Edit the placeholders at the beginning of the script
            Make sure the is script executable by running chmod +x prepare-commit-msg
            Enjoy! Test it by committing anything!

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/janniks/prepare-commit-msg.git

          • CLI

            gh repo clone janniks/prepare-commit-msg

          • sshUrl

            git@github.com:janniks/prepare-commit-msg.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Explore Related Topics

            Consider Popular Version Control System Libraries

            husky

            by typicode

            git-lfs

            by git-lfs

            go-git

            by src-d

            FastGithub

            by dotnetcore

            git-imerge

            by mhagger

            Try Top Libraries by janniks

            vue-notion

            by janniksJavaScript

            TitleRun

            by janniksHTML

            ogsupa

            by janniksJavaScript

            harmonic16

            by janniksJavaScript

            basetag

            by janniksJavaScript