Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit » Problem with renaming file
Problem with renaming file [message #649285] Tue, 18 January 2011 15:26 Go to next message
razu  is currently offline razu Friend
Messages: 1
Registered: January 2011
Junior Member
Hi,

I'm trying to rename a file in my project, but EGit detects that operation as removing file and adding new one. In the result I'm loosing history of that file.

Is anyone has that problem too?

Version of eclipse: eclipse-java-helios-SR1-linux-gtk-x86_64
Version of EGit/JGit: 0.10.1
Re: Problem with renaming file [message #649429 is a reply to message #649285] Wed, 19 January 2011 08:49 Go to previous messageGo to next message
Marcin  is currently offline Marcin Friend
Messages: 1
Registered: January 2011
Junior Member
Hi all,

i guess my problem is somehow connected to above. After conflict, followed by file rename I lose git revision history and eventualy I can lose file changes!

I tried to write it down in a sort of algoritm:

Lets say person A commits and pushes file C rename operation to repository.
Then person B pulls changes and discovers a conflict on file C.
After resolving conflict, person B commits to repository but forgets to push.
Next, person A issues another C file rename operation (commit,push).
When person B try to push, finds it impossible and needs to pull changes.
That makes him/her:
- lose git revision history. Running 'Show in history' on project root show less revisions than executing 'git log'.
- becase of file rename (remove, add operation) person B can't merge his/her changes and loses them! My guess is that EGIT loses file C history before the rename and becouse of that person B can't make a successful merge.

I wanted to use git in my production project but this bug is too dangerous to even start with EGIT.

I'm using SpringSource Tool Suite (Build Id: 201008251000) with EGIT 0.10.1 on 64bit Ubuntu.
If you have any questions please ask.

best regards
Marcin

Re: Problem with renaming file [message #650171 is a reply to message #649285] Sat, 22 January 2011 10:09 Go to previous message
Robin Rosenberg is currently offline Robin RosenbergFriend
Messages: 332
Registered: July 2009
Senior Member
razu skrev 2011-01-18 16:26:
> Hi,
>
> I'm trying to rename a file in my project, but EGit detects that
> operation as removing file and adding new one. In the result I'm loosing
> history of that file.
>
> Is anyone has that problem too?
>
> Version of eclipse: eclipse-java-helios-SR1-linux-gtk-x86_64
> Version of EGit/JGit: 0.10.1

Git does not track file renames. It just add the new name and removes
the old name. The C version tries to track content moves during various
operations, e.g. merge and log (on demand). There is code in JGit to
perform rename detection, but it is only invoked in a few places yet and
not from EGit.

Adding the rename/rewrite detected to EGit is probably not that hard, in
fact it should be trivial, but you also want it to be shown in a
meaningful way, which leaves some opportunity for creativity since that
could probably be implemented in more than one way. There are also many
places where you want it.

Quickdiff (only Follow, not Rewrite)
History (Follow and Rewrite, how to annotate?)
Compare Version (Rename only, Different names, recursive rename detection?)
Commit Dialog (Both, how to annotate?)
Decorators (how to decorate)

This bug talks about the history view:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=302549

I added separate bugs for the others too, since they need unique
solutions in the UI.

https://bugs.eclipse.org/bugs/show_bug.cgi?id=335081
https://bugs.eclipse.org/bugs/show_bug.cgi?id=335082
https://bugs.eclipse.org/bugs/show_bug.cgi?id=335083
https://bugs.eclipse.org/bugs/show_bug.cgi?id=335084


-- robin
Previous Topic:Error commiting
Next Topic:Change GIT repository location with SHARE?
Goto Forum:
  


Current Time: Mon Dec 22 01:27:23 GMT 2014

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

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