<< Back to previous view

[QB-2395] Git proof build fails if run for a "detached HEAD".
Created: 31/Mar/15  Updated: 18/May/15

Status: Resolved
Project: QuickBuild
Component/s: None
Affects Version/s: 5.1.43
Fix Version/s: 6.0.11

Type: Bug Priority: Major
Reporter: Alexey Shumkin Assigned To: Unassigned
Resolution: Fixed Votes: 0
Remaining Estimate: Unknown Time Spent: Unknown
Original Estimate: Unknown
Environment: System Date and Time 2015-03-31 17:15:53
Operating System Linux 3.13.0-32-generic, amd64
JVM OpenJDK 64-Bit Server VM 1.7.0_65, Oracle Corporation
QuickBuild Version 5.1.43 - Sat Jan 17 05:04:39 MSK 2015


 Description   
Setup user agent and config to run proof builds.
If working copy is a "detached HEAD" then proof build fails with the following error
17:03:51,926 ERROR - fatal: ambiguous argument 'origin/master..(detached from 0a75bb3)': unknown revision or path not in the working tree.
17:03:51,926 ERROR - Use '--' to separate paths from revisions, like this:
17:03:51,926 ERROR - 'git <command> [<revision>...] -- [<file>...]'
17:03:51,764 INFO - Executing post-execute action...
17:03:51,764 ERROR - Step 'master>checkout repo>checkout Git' is failed: Failed to run command: git log --name-status --pretty=raw --reverse "origin/master..(detached from 0a75bb3)"
Command return code: 128
Command error output: fatal: ambiguous argument 'origin/master..(detached from 0a75bb3)': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'

Obviously, the reason for this QB executes `git branch` command to get current SHA-1 to get changes between origin/master and current commit.
Here is an appropriate log cut:
17:03:49,954 INFO - Getting local change...
17:03:49,980 INFO - Checking working branch...
17:03:50,188 DEBUG - Executing command: git branch
17:03:50,188 DEBUG - Command working directory: d:\AShu\projects\1C-Mirror
17:03:50,246 INFO - * (detached from 0a75bb3)
17:03:50,246 INFO - dUnit
17:03:50,246 INFO - db-export-powershell
17:03:50,246 INFO - err-580-service
17:03:50,246 INFO - fpc
17:03:50,246 INFO - master

But current commit is not always a named branch, e.g. we want to test several previous commit(s) in our test branch.

I expect QB wouldn't fail to get changes between a current commit and an upstream branch.
I guess, `git rev-parse HEAD` is a more suitable command to get a current commit ID.

 Comments   
Comment by Robin Shen [ 01/Apr/15 01:25 AM ]
Thanks for the report. Will get it fixed in next patch release.
Comment by Alexey Shumkin [ 18/May/15 08:48 PM ]
I confirm fix :)
Generated at Sat Apr 20 00:27:12 UTC 2024 using JIRA 189.