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 |
Jase Jones 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 |
Robin Rosenberg 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 #726635 is a reply to message #726629] |
Mon, 19 September 2011 05:03 |
Robin Rosenberg 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
|
|
|
Goto Forum:
Current Time: Fri Apr 26 03:28:29 GMT 2024
Powered by FUDForum. Page generated in 0.03082 seconds
|