Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit / JGit » EGit ignores my attempt to stage files in one repository
EGit ignores my attempt to stage files in one repository [message #1823385] Wed, 25 March 2020 22:42 Go to next message
David M. Karr is currently offline David M. KarrFriend
Messages: 727
Registered: July 2009
Senior Member
I seem to have a new egit problem in 2020-03.

In the last hour I've been making code changes in three different repositories. I've been watching files appear in the staging view from time to time. I was about done with making a set of changes, so I started to set up to push those changes to the remote feature branch.

When I move files from "Unstaged changes" to "Staged changes", I use whatever action is convenient. Sometimes I select individual files and click the +, sometimes I click the ++ and then sometimes move extraneous files back to unstaged with the -. This normally works perfectly fine. Sometimes there is a short delay between clicking the action and seeing the files move from unstaged to staged.

When I did this with the three repositories, two of them worked perfectly fine. The third one is doing something really odd. The delay from clicking the action to move from unstaged to staged is very long. Like, infinite. It's not moving the files. There is no error message, it just takes my request to move the files and ignores me. There is no error in the error log.

At this point, I thought to go to the shell and see if there was something odd about the files. This is a repository that is similar to the one that I saw the weird "crlf execute" bug that I posted about in a separate thread. On that note, I'm pretty sure I don't have that problem with any of these files.

The first thing I did was a "git status". The result confused me a bit. It listed files in the "Changes to be committed:". In fact, all of the files listed there were the files I was attempting to copy to staged files. This makes it seem like egit was moving those files to staged files, but just not displaying them. However, it's more than just not displaying them, because when I now try to "Commit and Push...", it says there are no staged files.

At this point, I guess I'll try a couple of things. I will restart Eclipse and see if that fixes its brain damage. If that doesn't work, I can commit from the shell and then push the branch.

Returning to real time, restarting Eclipse WORKED. I went back to that repository, and now the unstaged changes list was empty, and the staged changes list had all my desired changes. I was able to commit and push.
Re: EGit ignores my attempt to stage files in one repository [message #1823412 is a reply to message #1823385] Thu, 26 March 2020 08:57 Go to previous message
Christian Halstrick is currently offline Christian HalstrickFriend
Messages: 272
Registered: July 2009
Senior Member
One tip to find out what is happening is to use pure JGit to call git status etc. Then we get hints whether we have problems in EGit or JGit. I would download [1] and whenever such problems exist open a commandline, cd to the root of your working tree and call 'jgit.sh status' and 'jgit-sh debug-show-dir-cache'.

EGit will present an empty staged area in staging view not when files are missing but when for every path the staged content matches what is currently in HEAD. Therefore it is ok sometimes that you have for a path something in unstaged changes and when you stage it it vanishes from unstaged changes and is also no mentioned in staged changes (because what you have staged matches HEAD content). Like in
git init; echo 1>a; git add a; git commit -m addA; echo 2>a; git add a; git status; echo 1>a; git add a; git status


[1] https://repo.eclipse.org/content/groups/releases//org/eclipse/jgit/org.eclipse.jgit.pgm/5.7.0.202003110725-r/org.eclipse.jgit.pgm-5.7.0.202003110725-r.sh


Ciao
Chris
Previous Topic:How do I control where Eclipse gets the git config from?
Next Topic:EGit now forcing GSSAPI-WITH-MIC?
Goto Forum:
  


Current Time: Thu Jun 24 13:52:13 GMT 2021

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

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

Back to the top