[SOLVED] git plugin ignores git commit failure

Post here any ideas/problems/suggestions you have regarding CodeLite's Subversion (SVN) plugin
Modem Man
CodeLite Enthusiast
Posts: 28
Joined: Tue Sep 11, 2012 11:50 am
Genuine User: Yes
IDE Question: C++
Contact:

[SOLVED] git plugin ignores git commit failure

Post by Modem Man »

I'm using "CodeLite 5.3" under Win7U/x64 and "git version 1.7.11.msysgit.1".

Problem:
It looks like the invocation of git commit does not regard the errorlevel/return value of git.

How I found it out (only ONE way to reproduce it):
I configured and used git for my local account modem-man@mycomputer.home well, works since months on cmd.exe.
Then I noticed, CodeLite has a built in git.
So I changed a .cpp file of my project and selected "Commit local changes" (the green down arrow below the git tab).
I was asked for comment, typed it in, ... and the file still was marked as "Modified"

Then I found the detailed log:

Code: Select all

Commit local changes (-m "added easy wrapper myEXCEPTION"  ExceptionSafety/ExceptionSafety1.cpp )
git --no-pager commit -m "added easy wrapper myEXCEPTION"  ExceptionSafety/ExceptionSafety1.cpp . Repo path: D:\proj.privat\GitSvn.Hosted
warning: CRLF will be replaced by LF in ExceptionSafety/ExceptionSafety1.cpp.
The file will have its original line endings in your working directory.
*** Please tell me who you are.
Run
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
to set your account's default identity.
Omit --global to set the identity only in this repository.
fatal: unable to auto-detect email address (got 'Admin@mycomputer.(none)')
Get current branch
git --no-pager branch --no-color. Repo path: D:\proj.privat\GitSvn.Hosted
* master
Current branch master
Listing modified files in git repository
git --no-pager ls-files -m. Repo path: D:\proj.privat\GitSvn.Hosted
...
So, the reason for getting the problem was: I'm invoking CodeLite as user "Admin", not as "modem-man", because of leveled rights. But I never configured git for Admin@mycomputer.home.
To be clear, this was a local configuration mistake on my side, yes. BUT it shows, that CodeLite does not regard the negative return from git.

Am I right? Can this be fixed?

It is not very critical in my eyes.
Uhm, but it might also happen on other git commit situations, where a user relies on the right return value evaluation of a git call - like broken remote connection, disk full and so on.
May also be, this return evaluation does not only affect git, but also svn?
May be it is only a Win32/Win64 platform porting issue?

Would like to hear some comments from the community on this,
BR,
Modem Man
Last edited by Modem Man on Thu Oct 29, 2015 10:14 pm, edited 1 time in total.
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: git plugin ignores git commit failure

Post by eranif »

codelite does not check the exit code since it does not work properly on Windows.
It does however, checks for interesting strings in git output.

For example, if the git plugin will detect a phrase like "password for" or "password:"
It will popup a password entry dialog.

We can do the same for error that contains lines that starts with "fatal:"
etc.

I will look into this specific case

Eran
Make sure you have read the HOW TO POST thread
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: git plugin ignores git commit failure

Post by eranif »

Update:
This is now fixed in git head. i.e. git plugin will prompt the user about this error
1.png
Eran
You do not have the required permissions to view the files attached to this post.
Make sure you have read the HOW TO POST thread
Post Reply