I
I
Ivan2019-07-25 13:50:38
linux
Ivan, 2019-07-25 13:50:38

How to display the difference between two commits with a link to the post-land commit?

I would like to see what differences the new commit brings.
There is an example design:

git rev-list --ancestry-path $old_hash...$new_hash   --pretty=format:‘<li> %h %an $ai <a href=“https://bitbucket.org/api/commits/  view> commit </a> %s</li> ’ --reverse

What you want:
1. How to insert a link to the last commit? Write everything to a file and then write a variable?
2. Slack notification. How to insert the result into a date?
curl -X POST -H 'Content-type: application/json' --data '{"text":"link to commit"}' https://hooks.slack.com/services/

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Saboteur, 2019-07-25
@saboteur_kiev

It is not necessary to a file, you can directly to a variable

MYDATA=$(git rev-list --ancestry-path $old_hash...$new_hash   --pretty=format:‘<li> %h %an $ai <a href=“https://bitbucket.org/api/commits/  view> commit </a> %s</li> ’ --reverse)

echo "I got the following result: $MYDATA"

K
ky0, 2019-07-25
@ky0

Install some normal face for git like gitlab and set up integration with whatever you want, including slack. Why these crutches?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question