History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: QB-1139
Type: Bug Bug
Status: Closed Closed
Resolution: Won't Fix
Priority: Minor Minor
Assignee: Steve Luo
Reporter: Alexey Shumkin
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
QuickBuild

Git plugin. SCM changes detection is based on author date but not on commit date

Created: 18/Nov/11 08:11 AM   Updated: 02/Feb/12 10:05 AM
Component/s: None
Affects Version/s: 3.1.62
Fix Version/s: None

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown
Environment:
Operating System Linux 2.6.33.7-co-0.7.9, i386
JVM OpenJDK Client VM 1.6.0_20, Sun Microsystems Inc.
QuickBuild Version 3.1.62 - Thu Sep 29 09:39:59 MSK 2011
Git Support 3.1.11


 Description  « Hide
Here is a citate from a QB log :
...
10:52:14,381 [master>checkout repo>checkout Git@drcis:8811] DEBUG - Executing command: git log -1 --date=raw --pretty=format:%ad 12cc11cf4c295a15f1c2ae97ad01c8a2ba52fb92
...
10:52:14,459 [master>checkout repo>checkout Git@drcis:8811] DEBUG - 1321551015 +0400
10:52:14,459 [master>checkout repo>checkout Git@drcis:8811] DEBUG - Executing command: git log -1 --date=raw --pretty=format:%ad c78a27eb6dc5573d012f4f039b1553348bf0af6f
...
10:52:14,537 [master>checkout repo>checkout Git@drcis:8811] DEBUG - 1320684763 +0400
10:52:14,537 [master>checkout repo>checkout Git@drcis:8811] WARN - Ignoring fetching changes because the start revision (12cc11cf4c295a15f1c2ae97ad01c8a2ba52fb92) seems elder than end revision (c78a27eb6dc5573d012f4f039b1553348bf0af6f).
...

As I suppose git plugin assumes linear development history (i.e. any later commit has a later date than a previous one). But commit in Git has two dates: author date and commit date (one per person responsible for a commit: "author" and "committer"). And the power of Git allows to reorder commits, rebasing, cherry-picking, etc.
So, every commit can have two different dates: author date and commit date. Generally, they are not used to the same. During rebasing, cherry-picking and committing with -c/-C option commit can have author date set some time earlier then the committing moment (commit date). So, author date is not too reliable source to determine age of the commit relatively of previuos one. Commit date is more reliable, I guess.

I guess
git log -1 --date=raw --pretty=format:%cd
must be used instead of
git log -1 --date=raw --pretty=format:%ad

The same is for changset log window (the date of changeset is an author date there, too)

 All   Comments   Work Log   Change History      Sort Order:
Steve Luo [02/Feb/12 10:04 AM]
When user schema is one of below types:
Author Name, Auther Email, Author Name, Author Name and Email

author date will be used, otherwise, commit date will be used.