Uploaded image for project: 'Bitbucket Cloud'
  1. Bitbucket Cloud
  2. BCLOUD-14143

API should return both Author and Commit Date

    XMLWordPrintable

Details

    Description

      I spent few hours building a tool to generate git stats across all our company repositories by parsing all commits from Bitbucket APIs and storing them in DB then connecting it to BI tool to create any graphs.

      The commit API json returns the following data about each commit

      {
        "hash": "d566e1c3328809f1dde0123db183e403c2ca2c7c",
        "repository": {..},
        "links": {..},
        "author": {..},
        "participants": [],
        "parents": [],
        "date": "2016-04-02T13:40:04+00:00",
        "message": "Refactoring and code comments\n",
        "type": "commit"
      }
      

      Naturally, you would think date is the author date but ironically, it's the commit date!!! Why on earth would they return a single date and the one you choose isn't the author date?

      This is the difference (source):

      As the Pro Git Book explains: The author is the person who originally wrote the work, whereas the committer is the person who last applied the work. So if, for instance, you send in a patch to a project, the author date will be when you made the original commit but the committer date will be when the patch was applied.

      Why is this important? because all modern devs don't push commits until they're ready. Usually any dev just commits changes atomically and then pushes them end of day or week or every few hours.

      The problem is right now the stats shows people with over 60 commits per day when in reality they are distributed among several days.

      How long will it take you guys to return both dates?

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              dc79cb13752c Salem Korayem
              Votes:
              1 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: