Git: How to find when a commit was merged into master?
up vote
2
down vote
favorite
I want to create a metric in my project that measures how long does a commit take from its creation till to get into the master branch?
Is it possible? It looks like for fast-forwarded commits I can't get this info from the git log.
If I can get a snapshot of the repository X days ago, maybe I can calculate it. Another option is to get a log that registers when a branch HEAD was modified.
Update: If you create an annotated tag at each release, you can just see the date of the tag that included the commit. Here is how to list the commits included in a tag
git git-log
add a comment |
up vote
2
down vote
favorite
I want to create a metric in my project that measures how long does a commit take from its creation till to get into the master branch?
Is it possible? It looks like for fast-forwarded commits I can't get this info from the git log.
If I can get a snapshot of the repository X days ago, maybe I can calculate it. Another option is to get a log that registers when a branch HEAD was modified.
Update: If you create an annotated tag at each release, you can just see the date of the tag that included the commit. Here is how to list the commits included in a tag
git git-log
using git show --pretty=fuller SHA1 you could look at author date and commit date; BTW when using gerrit, a commit-id is added to track commits between branches, could maybe be done the same way in your project
– OznOg
Nov 21 at 18:43
See this helps: stackoverflow.com/questions/10585874/… and stackoverflow.com/questions/42897660/…
– Rishabh Agarwal
Nov 21 at 18:54
add a comment |
up vote
2
down vote
favorite
up vote
2
down vote
favorite
I want to create a metric in my project that measures how long does a commit take from its creation till to get into the master branch?
Is it possible? It looks like for fast-forwarded commits I can't get this info from the git log.
If I can get a snapshot of the repository X days ago, maybe I can calculate it. Another option is to get a log that registers when a branch HEAD was modified.
Update: If you create an annotated tag at each release, you can just see the date of the tag that included the commit. Here is how to list the commits included in a tag
git git-log
I want to create a metric in my project that measures how long does a commit take from its creation till to get into the master branch?
Is it possible? It looks like for fast-forwarded commits I can't get this info from the git log.
If I can get a snapshot of the repository X days ago, maybe I can calculate it. Another option is to get a log that registers when a branch HEAD was modified.
Update: If you create an annotated tag at each release, you can just see the date of the tag that included the commit. Here is how to list the commits included in a tag
git git-log
git git-log
edited Nov 22 at 14:37
asked Nov 21 at 18:26
neves
8,432106489
8,432106489
using git show --pretty=fuller SHA1 you could look at author date and commit date; BTW when using gerrit, a commit-id is added to track commits between branches, could maybe be done the same way in your project
– OznOg
Nov 21 at 18:43
See this helps: stackoverflow.com/questions/10585874/… and stackoverflow.com/questions/42897660/…
– Rishabh Agarwal
Nov 21 at 18:54
add a comment |
using git show --pretty=fuller SHA1 you could look at author date and commit date; BTW when using gerrit, a commit-id is added to track commits between branches, could maybe be done the same way in your project
– OznOg
Nov 21 at 18:43
See this helps: stackoverflow.com/questions/10585874/… and stackoverflow.com/questions/42897660/…
– Rishabh Agarwal
Nov 21 at 18:54
using git show --pretty=fuller SHA1 you could look at author date and commit date; BTW when using gerrit, a commit-id is added to track commits between branches, could maybe be done the same way in your project
– OznOg
Nov 21 at 18:43
using git show --pretty=fuller SHA1 you could look at author date and commit date; BTW when using gerrit, a commit-id is added to track commits between branches, could maybe be done the same way in your project
– OznOg
Nov 21 at 18:43
See this helps: stackoverflow.com/questions/10585874/… and stackoverflow.com/questions/42897660/…
– Rishabh Agarwal
Nov 21 at 18:54
See this helps: stackoverflow.com/questions/10585874/… and stackoverflow.com/questions/42897660/…
– Rishabh Agarwal
Nov 21 at 18:54
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
accepted
It is not easy, considering the commit itself does not know in which branch it is.
It does not keep track of branch "events" which would mention it was created in branch X, and then merge (possibly fast-forward) in branch Y.
Only git reflog
registers HEAD changes, but it is limited in time.
As mentioned by the OP, you need to add a metadata (like an annotated tag, but you could also consider a git notes
) in order to memorize the information you need.
Since there is no permanent register of changing the read of a branch, the really feasible solution is to create an annotated tag, and see the commits in between
– neves
Nov 22 at 14:39
@neves I afre, and have included your comment in the answer for more visibility.
– VonC
Nov 22 at 16:52
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
accepted
It is not easy, considering the commit itself does not know in which branch it is.
It does not keep track of branch "events" which would mention it was created in branch X, and then merge (possibly fast-forward) in branch Y.
Only git reflog
registers HEAD changes, but it is limited in time.
As mentioned by the OP, you need to add a metadata (like an annotated tag, but you could also consider a git notes
) in order to memorize the information you need.
Since there is no permanent register of changing the read of a branch, the really feasible solution is to create an annotated tag, and see the commits in between
– neves
Nov 22 at 14:39
@neves I afre, and have included your comment in the answer for more visibility.
– VonC
Nov 22 at 16:52
add a comment |
up vote
0
down vote
accepted
It is not easy, considering the commit itself does not know in which branch it is.
It does not keep track of branch "events" which would mention it was created in branch X, and then merge (possibly fast-forward) in branch Y.
Only git reflog
registers HEAD changes, but it is limited in time.
As mentioned by the OP, you need to add a metadata (like an annotated tag, but you could also consider a git notes
) in order to memorize the information you need.
Since there is no permanent register of changing the read of a branch, the really feasible solution is to create an annotated tag, and see the commits in between
– neves
Nov 22 at 14:39
@neves I afre, and have included your comment in the answer for more visibility.
– VonC
Nov 22 at 16:52
add a comment |
up vote
0
down vote
accepted
up vote
0
down vote
accepted
It is not easy, considering the commit itself does not know in which branch it is.
It does not keep track of branch "events" which would mention it was created in branch X, and then merge (possibly fast-forward) in branch Y.
Only git reflog
registers HEAD changes, but it is limited in time.
As mentioned by the OP, you need to add a metadata (like an annotated tag, but you could also consider a git notes
) in order to memorize the information you need.
It is not easy, considering the commit itself does not know in which branch it is.
It does not keep track of branch "events" which would mention it was created in branch X, and then merge (possibly fast-forward) in branch Y.
Only git reflog
registers HEAD changes, but it is limited in time.
As mentioned by the OP, you need to add a metadata (like an annotated tag, but you could also consider a git notes
) in order to memorize the information you need.
edited Nov 22 at 16:51
answered Nov 21 at 18:41
VonC
825k28425933125
825k28425933125
Since there is no permanent register of changing the read of a branch, the really feasible solution is to create an annotated tag, and see the commits in between
– neves
Nov 22 at 14:39
@neves I afre, and have included your comment in the answer for more visibility.
– VonC
Nov 22 at 16:52
add a comment |
Since there is no permanent register of changing the read of a branch, the really feasible solution is to create an annotated tag, and see the commits in between
– neves
Nov 22 at 14:39
@neves I afre, and have included your comment in the answer for more visibility.
– VonC
Nov 22 at 16:52
Since there is no permanent register of changing the read of a branch, the really feasible solution is to create an annotated tag, and see the commits in between
– neves
Nov 22 at 14:39
Since there is no permanent register of changing the read of a branch, the really feasible solution is to create an annotated tag, and see the commits in between
– neves
Nov 22 at 14:39
@neves I afre, and have included your comment in the answer for more visibility.
– VonC
Nov 22 at 16:52
@neves I afre, and have included your comment in the answer for more visibility.
– VonC
Nov 22 at 16:52
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53418390%2fgit-how-to-find-when-a-commit-was-merged-into-master%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
using git show --pretty=fuller SHA1 you could look at author date and commit date; BTW when using gerrit, a commit-id is added to track commits between branches, could maybe be done the same way in your project
– OznOg
Nov 21 at 18:43
See this helps: stackoverflow.com/questions/10585874/… and stackoverflow.com/questions/42897660/…
– Rishabh Agarwal
Nov 21 at 18:54