Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit / JGit » Command line status incorrect(I change a file in Eclipse, and then do git status at the command line. The changed file does not show as modified.)
Command line status incorrect [message #722860] Wed, 07 September 2011 00:46 Go to next message
Jase Jones is currently offline Jase JonesFriend
Messages: 3
Registered: September 2011
Junior Member
I am using Eclipse Helios, on Windows 7. I have the Egit plugin, I have a few git repositories on a linux server, and local clones of the repositories in Egit. I am also using Gitolite on the server to manage the repositories.

I have cygwin installed on my Windows PC, but the cygwin installation does not have git installed. I can run git commands at the Windows command prompt, and I assume this functionality is provided by Egit/Jgit.

With one of my projects I can run git status and get the correct result, but when I run git status on my other project, I get the wrong result. Here are the commands and their output:




Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.

C:\Users\Jase>cd c:\WSLnlb

c:\WSLnlb>ls
LnlbMonitorDeploy.bat gitolite-admin lnlb
LnlbPythonDeploy.bat gitosis-admin lnlbMonitor

c:\WSLnlb>cd lnlb

c:\WSLnlb\lnlb>ls
COPYING README if_lnlb.h lnlb_mod_tracking.c removeMods
Makefile buildInsert lnlb.c lnlbctl.c stats

c:\WSLnlb\lnlb>git status
cygwin warning:
MS-DOS style path detected: c:\WSLnlb\lnlb\
Preferred POSIX equivalent is: /cygdrive/c/WSLnlb/lnlb/
CYGWIN environment variable option "nodosfilewarning" turns off this warning.
Consult the user's guide for more details about POSIX paths:
(link removed)
# Not currently on any branch.
# Changes not staged for commit:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: if_lnlb.h
# modified: lnlb.c
# modified: lnlb_mod_tracking.c
#
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# .git.zip
no changes added to commit (use "git add" and/or "git commit -a")

c:\WSLnlb\lnlb>cd ../lnlbMonitor

c:\WSLnlb\lnlbMonitor>git status
cygwin warning:
MS-DOS style path detected: c:\WSLnlb\lnlb\
Preferred POSIX equivalent is: /cygdrive/c/WSLnlb/lnlb/
CYGWIN environment variable option "nodosfilewarning" turns off this warning.
Consult the user's guide for more details about POSIX paths:
(link removed)
# On branch master
# Changes not staged for commit:
# (use "git add/rm <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# deleted: .classpath
# modified: .project
# deleted: .settings/org.eclipse.jdt.core.prefs
# deleted: deployMon.sh
# deleted: lnlbMon
# deleted: org/lnlb/LnlbMonitor.java
#
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# .cproject
# .git.zip
# COPYING
# Makefile
# README
# buildInsert
# if_lnlb.h
# lnlb.c
# lnlb_mod_tracking.c
# lnlbctl.c
# removeMods
# stats
no changes added to commit (use "git add" and/or "git commit -a")

c:\WSLnlb\lnlbMonitor>




The first project shows 3 modified files, which is correct. The second project shows only one modified file and 5 deleted ones. The modified file may be correct, but the deleted ones are definitely not deleted, and at least the last file (org/lnlb/LnlbMonitor.java) does have changes. So, the first project gives a correct git status, but the second project does not. The first project is a c project, and the second project is a java project.

I can commit the files, and this status output is identical. I can push the changes to the remote repository on the server, and check out the changes on the server and see the correct changes. At this stage Eclipse is showing no changes, but command line git status on the Windows machine still gives the above output.

The other thing that seems rather strange is that when I do a git status on the second project, as well as the wrong information, it gives me a list of untracked files, all of which are from the other project, and are (definitely) not present in the directory of the second project.

I need the status command to work so I can deploy my code to the server without checking in, pushing and checking out again (and saving useless commit information in git) each time I make a minor change when I am getting my code working.

Thanks for any suggestions, and I can provide more information if anyone can tell me what to provide.

[Updated on: Wed, 07 September 2011 00:48]

Report message to a moderator

Re: Command line status incorrect [message #722888 is a reply to message #722860] Wed, 07 September 2011 04:48 Go to previous messageGo to next message
Robin Rosenberg is currently offline Robin RosenbergFriend
Messages: 332
Registered: July 2009
Senior Member
Jase Jones skrev 2011-09-07 02.46:
> I am using Eclipse Helios, on Windows 7. I have the Egit plugin, I have
> a few git repositories on a linux server, and local clones of the
> repositories in Egit. I am also using Gitolite on the server to manage
> the repositories.
>
> I have cygwin installed on my Windows PC, but the cygwin installation
> does not have git installed. I can run git commands at the Windows
> command prompt, and I assume this functionality is provided by Egit/Jgit.

More likely is that you have msys git installed. The JGit command line
interface is not a pluggable replacement so you cannot use it by mistake.

>
> With one of my projects I can run git status and get the correct result,
> but when I run git status on my other project, I get the wrong result.
> Here are the commands and their output:
>
>
> SORRY, FORUM IS SAYING I CAN'T POST LINKS, BUT THERE ARE NO LINKS IN MY
> POST. I AM TRYING REMOVING THIS PART AND WILL POST AGAIN BELOW.

Using all caps sentences is very rude, I wonder why the forum permits
that... ;-). If you use e News client I think you can post about
anything you want. You can post a bug report to bugs.eclipse.org for the
forum I you think you cannot post legitimate content.

Without details it's hard to comment on the stuff below. You need
to provide the layout of the repositories and projects, but it is
quite possible to have a git repository that contains files that you
don't see in Eclipse simply because you only see what is imported as
projects in the project explorer. The commit dialog shows the whole
repo, as does the git repository explorer.

-- robin

>
> The first project shows 3 modified files, which is correct. The second
> project shows only one modified file and 5 deleted ones. The modified
> file may be correct, but the deleted ones are definitely not deleted,
> and at least the last file (org/lnlb/LnlbMonitor.java) does have
> changes. So, the first project gives a correct git status, but the
> second project does not. The first project is a c project, and the
> second project is a java project.
>
> I can commit the files, and this status output is identical. I can push
> the changes to the remote repository on the server, and check out the
> changes on the server and see the correct changes. At this stage Eclipse
> is showing no changes, but command line git status on the Windows
> machine still gives the above output.
>
> The other thing that seems rather strange is that when I do a git status
> on the second project, as well as the wrong information, it gives me a
> list of untracked files, all of which are from the other project, and
> are (definitely) not present in the directory of the second project.
>
> I need the status command to work so I can deploy my code to the server
> without checking in, pushing and checking out again (and saving useless
> commit information in git) each time I make a minor change when I am
> getting my code working.
>
> Thanks for any suggestions, and I can provide more information if anyone
> can tell me what to provide.
>
Re: Command line status incorrect [message #722891 is a reply to message #722888] Wed, 07 September 2011 05:24 Go to previous messageGo to next message
Jase Jones is currently offline Jase JonesFriend
Messages: 3
Registered: September 2011
Junior Member
Sorry about the all caps, I just wanted it to be obvious that the missing information was not my wish, and that I was trying to do something to fix it. I immediately edited it and by removing bits at a time I found the link that cygwin had put in, removed that and posted the proper information, which is now on the forum, without all caps.

I didn't want to file a bug report unless someone who knows more about Egit thinks that it is actually a bug, and not just a problem with how I am using it.

Here is the file structure:

For the project where git status works correctly:

c:\WSLnlb\lnlb>find . -name \*.*
.
./.cproject
./.git
./.git/refs/tags/V0.1.3
./.git.zip
./.project
./if_lnlb.h
./lnlb.c
./lnlbctl.c
./lnlb_mod_tracking.c


For the project where git status does not work correctly:

c:\WSLnlb\lnlbMonitor>find . -name \*.*
.
./.classpath
./.git
./.gitignore
./.project
./.settings
./.settings/org.eclipse.jdt.core.prefs
./.settings/org.eclipse.jdt.launching.prefs
./deployMon.sh
./org/lnlb/LnlbMonitor.java
./output/.classpath
./output/.gitignore
./output/.project
./output/.settings
./output/.settings/org.eclipse.jdt.core.prefs
./output/.settings/org.eclipse.jdt.launching.prefs
./output/deployMon.sh
./output/org/lnlb/LnlbMonitor.class




Just in case my edit of the missing information from my first post can't be seen by others:


Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.

C:\Users\Jase>cd c:\WSLnlb

c:\WSLnlb>ls
LnlbMonitorDeploy.bat gitolite-admin lnlb
LnlbPythonDeploy.bat gitosis-admin lnlbMonitor

c:\WSLnlb>cd lnlb

c:\WSLnlb\lnlb>ls
COPYING README if_lnlb.h lnlb_mod_tracking.c removeMods
Makefile buildInsert lnlb.c lnlbctl.c stats

c:\WSLnlb\lnlb>git status
cygwin warning:
MS-DOS style path detected: c:\WSLnlb\lnlb\
Preferred POSIX equivalent is: /cygdrive/c/WSLnlb/lnlb/
CYGWIN environment variable option "nodosfilewarning" turns off this warning.
Consult the user's guide for more details about POSIX paths:
(link removed)
# Not currently on any branch.
# Changes not staged for commit:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: if_lnlb.h
# modified: lnlb.c
# modified: lnlb_mod_tracking.c
#
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# .git.zip
no changes added to commit (use "git add" and/or "git commit -a")

c:\WSLnlb\lnlb>cd ../lnlbMonitor

c:\WSLnlb\lnlbMonitor>git status
cygwin warning:
MS-DOS style path detected: c:\WSLnlb\lnlb\
Preferred POSIX equivalent is: /cygdrive/c/WSLnlb/lnlb/
CYGWIN environment variable option "nodosfilewarning" turns off this warning.
Consult the user's guide for more details about POSIX paths:
(link removed)
# On branch master
# Changes not staged for commit:
# (use "git add/rm <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# deleted: .classpath
# modified: .project
# deleted: .settings/org.eclipse.jdt.core.prefs
# deleted: deployMon.sh
# deleted: lnlbMon
# deleted: org/lnlb/LnlbMonitor.java
#
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# .cproject
# .git.zip
# COPYING
# Makefile
# README
# buildInsert
# if_lnlb.h
# lnlb.c
# lnlb_mod_tracking.c
# lnlbctl.c
# removeMods
# stats
no changes added to commit (use "git add" and/or "git commit -a")

c:\WSLnlb\lnlbMonitor>




The main problem I have is that git status does not show files that I know I have modified as being modified. Thanks, and please let me know if I should file a bug report.
Re: Command line status incorrect [message #723674 is a reply to message #722891] Fri, 09 September 2011 06:41 Go to previous messageGo to next message
Manuel Doninger is currently offline Manuel DoningerFriend
Messages: 119
Registered: October 2010
Senior Member
As Robin said, it's very unlikely, that this output comes from JGit. You should look, if you have MSysGit installed. The command "which git" should also work in Cygwin, that could help you to find the path of the Git executable.

Besides that, do you have a hidden .git directory in the path C:\WSLnlb?
(no subject) [message #723684 is a reply to message #722891] Fri, 09 September 2011 06:41 Go to previous messageGo to next message
Manuel Doninger is currently offline Manuel DoningerFriend
Messages: 119
Registered: October 2010
Senior Member
As Robin said, it's very unlikely, that this output comes from JGit. You should look, if you have MSysGit installed. The command "which git" should also work in Cygwin, that could help you to find the path of the Git executable.

Besides that, do you have a hidden .git directory in the path C:\WSLnlb?
Re: Command line status incorrect [message #726629 is a reply to message #722860] Mon, 19 September 2011 04:22 Go to previous messageGo to next message
Jase Jones is currently offline Jase JonesFriend
Messages: 3
Registered: September 2011
Junior Member
Thanks Manuel and Robin for your help.

Firstly, there was definitely no hidden .git directory at the location C:\WSLnlb.

Unfortunately I am not currently at the PC from which I was having this problem, so I cannot determine if I was using MSysGit or not. However I have had to deal with this same issue on another PC, and based on the help from Manuel and Robin, I have found out this:

1. There are two normal methods of installing git on Windows, one is MSysGit, and the other is cygwin git.

2. I have installed cygwin git, using

$ apt-cyg install git

3. If I do git status in cygwin I now get the correct results.

I believe that I was probably using MSysGit, and that cygwin git has fixed the problem. I'll confirm at a later date when I am back at the other PC.

Thanks again for the help.

Jase
Re: Command line status incorrect [message #726635 is a reply to message #726629] Mon, 19 September 2011 05:03 Go to previous message
Robin Rosenberg is currently offline Robin RosenbergFriend
Messages: 332
Registered: July 2009
Senior Member
Jase Jones skrev 2011-09-19 06.22:
> Thanks Manuel and Robin for your help.
>
> Firstly, there was definitely no hidden .git directory at the location
> C:\WSLnlb.
>
> Unfortunately I am not currently at the PC from which I was having this
> problem, so I cannot determine if I was using MSysGit or not. However I
> have had to deal with this same issue on another PC, and based on the
> help from Manuel and Robin, I have found out this:
>
> 1. There are two normal methods of installing git on Windows, one is
> MSysGit, and the other is cygwin git.
>
> 2. I have installed cygwin git, using
>
> $ apt-cyg install git
>
> 3. If I do git status in cygwin I now get the correct results.
>
> I believe that I was probably using MSysGit, and that cygwin git has
> fixed the problem. I'll confirm at a later date when I am back at the
> other PC.
>

A potential issue is that there may be settings in $prefix/etc, where
prefix is the same as for where the bin directory that contain the git
executable.

The problem ofcourse is that cygwin and msys have different ideas about
where etc is located and JGit has no idea at all. Actually we try to
figure that out if git is in the path, but usually it isn't.

Hence msys git can have autocrlf enabled, while cygwin does not. That
can yield different status.

Try cat /etc/gitconfig in cygwin bash and msys bash and see if there
is a difference.

-- robin
Previous Topic:JGIT, HTTPS and client certificates
Next Topic:How to do a "git pull origin subbranch:subbranch" in jgit?
Goto Forum:
  


Current Time: Tue Mar 19 03:46:35 GMT 2024

Powered by FUDForum. Page generated in 0.04010 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top