我正在编写一个用于验证url的钩子,它在git log的notes部分输入.我遍历每个提交以获取该特定提交的注释,并对该URL进行字符串比较.如果提交是新提交,则会弹出问题,因为新提交不包含注释.
例:-
git add sample
git commit -m "added sample"
git notes add -m "sample note" <commitID-of-sample>
git push origin master
git push origin refs/notes/*
Run Code Online (Sandbox Code Playgroud)
上面例子的问题是,首先我推送提交但是提交没有注释,因为git push origin refs/notes/*在master之后被推送.我基本上想要在预接收挂钩中访问提交的注释.
有什么建议?
git ×1