Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
badges earned

Your Points Tracker
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

git log with date range or before after Edited

A developer completed a new feature last month and I've completed the review, test, etc and merge that feature branch into release branch this month. Now I need to collect my current month's release branch changes and I'm using the below git command to see the changes applied to the release branch. Unfortunately the above mentioned feature changes are not listing since the commit date for above changes doesn't fall under the date I've selected. For me, the change has been delivered to release branch now and I need to count those change towards this month release churn metrics.

git log --after='2017-07-01 00:00:00' 

Any quick and easy thoughts on this?

As a workaround, currently I'm achieving the above functionality by collecting the full release branch log every month and do a diff between previously saved last month git log o/p file. The resulting diff will have all changes since last month's saved log. 

2 answers

I forgot to add the command above, the command I supposed to use is 

git log --after='2017-07-01 00:00:00' 

Hi @Bijoy_Thomas, I'm contributing during my free time to this open source project: which seems like it would automate some aspect of your workflow. However at the time of writing it only checks the current branch and does not include merge commits (yet). Hope this helps.

Here's one idea:

- Rebase before you merge.   The rebase will leave all the "authorDate" meta-data alone on the rebased commits, but it will update the "commitDate" meta-data, which is what "git log --after" actually uses internally, even though it uses "authorDate" in its output (a git ux mistake IMO, quite confusing for users!).  And so if you rebase today, all commits that get rebased will be captured by a "git log --after yesterday" even though the dates they show look older.

More info here about what data "git log --after" is actually using (  How to get git to show commits in a specified date range for author date?


Here's another idea:

- The merge commit itself should show up (its "commitDate" will be in July), just not the commits brought over by the merge.   Can you use the merge commit to calculate your metrics?

- Try "git log --first-parent -m -p" to get merge diffs into your git log output.   Normally "git log -p" does not include merges in the diff output.  You need to add "-m" to get their diffs to print.


p.s.  If you're on Bitbucket Server, my paid add-on, Bit-Booster Rebase/Squash, is very useful if you're want to try a rebase workflow.  It also includes a hook you can enable to require rebases for merges into the release branch.

Thanks for the prompt response, the rebase option won't be quick and easy choice, since the merge is happening via Bitbucket PR after the review.

Let me look into the other deatails.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Bitbucket

New improvements to user management in Bitbucket Cloud 👥

Hey Community! We’re willing to wager that quite a few of you not only use Bitbucket, but administer it too. Our team is excited to share that we’ll be releasing improvements throughout this month of...

551 views 4 13
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you