3

I have generated Start Commit Hook in TortoiseGit which calls StartComit.bat file and option "Wait for the script to finish" is enabled.

The content of the bat file is

echo "Some more info...." >> %1

The script is getting called before Commit dialog opens but it's not working, I'm not getting any text in Message field.

What am I doing wrong here?

Edit: Just to make question more clear I'm trying to fallow this accepted answer https://stackoverflow.com/a/3967136/596935 and do a similar thing.

1 Answer 1

4

%1 is the path to a file containing all selected files when starting the commit dialog and not the path to the file for the message which is %2.

See https://tortoisegit.org/docs/tortoisegit/tgit-dug-settings.html#tgit-dug-settings-hooks for a manual regarding the parameters.

Thus,

echo Some more info.... >> %2

should solve this issue.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks for help, I started looking at different direction here with prepare-commit-msg hook which didn't worked either

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.