Yes,
When I try to execute
I have two cases :
1- update ok
2- generate conflicts ( some problems with remote repository)
So in this 2cases ===> exitCode = 0 ===> operation pull OK
is the second case : generate conflicts ===> exitCode = 0 ??
Yes,
When I try to execute
I have two cases :
1- update ok
2- generate conflicts ( some problems with remote repository)
So in this 2cases ===> exitCode = 0 ===> operation pull OK
is the second case : generate conflicts ===> exitCode = 0 ??
What is the git command return code when you execute the same from the command line? i.e. If linux or mac run the command from the command line then echo $? which will show you the return code. You'll have to google how to do the same on Windows if you're using Windows.
If git's return code is indeed zero on a conflict, you'll have to parse the output of the git command to determine success/failure, but I know that git generally sets return code 1 on error, 0 on success, although there may be exceptions to that rule.
I write the best type of code possible, code that I want to write, not code that someone tells me to write!
Have you tried something like this:
Qt Code:
QStringList argumemts; arguments << "pull" << "origin" << "master"; process.start("git", aguments);To copy to clipboard, switch view to plain text mode
Thanks,
some notes :
1- GIT command QProces work well
2- GIT command QProces return the same result = GIT command Line
Code :Qt Code:
process.start("git pull origin master"); if(process.waitForFinished()) { for (int i = 0; i < projects.size()-1; ++i) { qDebug() << " --> " << projects[i]; } } qDebug() << Status; if (Status == 0) { qDebug() << "App executed OK!!"; pullOk = true; }To copy to clipboard, switch view to plain text mode
Now, I can't test the conflicts because I can't generate conflicts (now) and I have to analyze all cases
>> I wonder if someone has already done the same thing (Testing conflicts)
>> Git's return code is indeed zero on a conflict ??
Any Idea (Test conflict, ...)
Thanks,
From my Mac using git version 2.9.2:
So the git command exits with rc=1 on a merge conflict as shown on line 6 above.Qt Code:
mbp02:~/develop/InkjetPlumber[testb2]$ git merge testb1 Auto-merging InkjetPlumber.pro CONFLICT (content): Merge conflict in InkjetPlumber.pro Automatic merge failed; fix conflicts and then commit the result. mbp02:~/develop/InkjetPlumber[testb2 *+|MERGING]$ echo $? 1 mbp02:~/develop/InkjetPlumber[testb2 *+|MERGING]$ git --version git version 2.9.2 mbp02:~/develop/InkjetPlumber[testb2 *+|MERGING]$To copy to clipboard, switch view to plain text mode
Your example still shows that you're executing the QProcess with "git pull origin master" as the program to execute. Post #5 demonstrated the correct way to do this, the program is "git" and the arguments should be "pull", "origin", "master". Not sure if this is related to your issue, but you should make that change regardless.
Good luck.
I write the best type of code possible, code that I want to write, not code that someone tells me to write!
Bookmarks