Actually, author_date and commiter_date fields in versioncontrol_operations table are not filled during "Fetch logs" operations on Git repository.
How to reproduce:
1) Add Git repository
2) Fetch logs for it
3) See versioncontrol_operations table
author_date and commiter_date fields are 0.
I guess problem line is 362 in versioncontrol_git.log

  // build the data array to be used for the commit op
  $op_data = array(
    'type' => VERSIONCONTROL_OPERATION_COMMIT,
    'revision' => $revision,
    'author' => $author_email,
    'author_name' => $author_name,
    'committer' => $committer_email,
    'committer_name' => $committer_name,
    'parent_commit' => reset($parents),
    'merge' => $merge,
    'date' => $date,
    'message' => $message,
    'repository' => $repository,
  );

and maybe it should be like

  // build the data array to be used for the commit op
  $op_data = array(
    'type' => VERSIONCONTROL_OPERATION_COMMIT,
    'revision' => $revision,
    'author' => $author_email,
    'author_name' => $author_name,
    'committer' => $committer_email,
    'committer_name' => $committer_name,
    'parent_commit' => reset($parents),
    'merge' => $merge,
    'author_date' => $date,
    'message' => $message,
    'repository' => $repository,
  );

Any suggestions about this?

Comments

marvil07’s picture

Title: author_date and commiter_date fields are not filled during "Fetch logs" operations on Git repository » Follow api change on versioncontrolon the git history parser about author_date and commiter_date fields
Assigned: Unassigned » marvil07

I can not believe I forget about this, actually there is another issue pointing the TODO about the related change on versioncontrol(#1054436: Store commit date and authoring date) for updating default views here(#1203264: Change default views to follow versioncontrol api change on views data).

So, this is critical, let's do it quickly.

Thanks for noticing it :-)

marvil07’s picture

Title: Follow api change on versioncontrolon the git history parser about author_date and commiter_date fields » Follow api change on versioncontrol on the git history parser about author_date and commiter_date fields

title typo

marvil07’s picture

Priority: Normal » Critical
marvil07’s picture

Title: Follow api change on versioncontrol on the git history parser about author_date and commiter_date fields » Use the new date data members from VersioncontrolOperation
Status: Active » Fixed
StatusFileSize
new2.19 KB

Here the patch I pushed.

BTW I am bad with titles :-p

lazy’s picture

Wow! Thank you for fast response and fix.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

  • Commit 2c91a42 on 6.x-2.x, fix-invalid-default-branches, fullsync-memory by marvil07:
    Issue #1252096 by marvil07 | Lazy: Use the new date data members from...