After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 617098 - New versions of Git shows unmerged files as "both modified"
New versions of Git shows unmerged files as "both modified"
Status: RESOLVED FIXED
Product: meld
Classification: Other
Component: dirdiff
1.3.x
Other Linux
: Normal normal
: ---
Assigned To: Kai Willadsen
Stephen Kennedy
: 617097 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2010-04-28 16:54 UTC by Семён Марьясин
Modified: 2010-05-24 21:45 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch for /usr/lib/meld/vc/git.py (821 bytes, patch)
2010-04-28 16:54 UTC, Семён Марьясин
none Details | Review
Makes a test repo with different file states (unmerged, added, deleted, modified, untracked) (604 bytes, application/x-shellscript)
2010-04-29 14:40 UTC, Семён Марьясин
  Details
Tentative patch (1.30 KB, patch)
2010-05-07 22:47 UTC, Kai Willadsen
none Details | Review

Description Семён Марьясин 2010-04-28 16:54:10 UTC
Created attachment 159807 [details] [review]
patch for /usr/lib/meld/vc/git.py

Newer versions of Git (checked with 1.7.0.4) shows merge-diff like this:

$ git status
# On branch connection-errors
# Changes to be committed:
#
#       modified:   Session.java
#       new file:   VkException.java
#
# Unmerged paths:
#   (use "git add/rm <file>..." as appropriate to mark resolution)
#
#       both modified:      PersonForm.java
#       both modified:      Request.java
#

Currently melds recognizes such files as "Non VC".
Comment 1 Kai Willadsen 2010-04-28 21:05:03 UTC
*** Bug 617097 has been marked as a duplicate of this bug. ***
Comment 2 Kai Willadsen 2010-04-28 21:07:56 UTC
Thanks for the patch. Unfortunately, this patch doesn't apply to Meld HEAD, as
we've switched over to using "git diff-index --name-status" to get the same
information. Could you please retest with current Meld HEAD, and see if there
is a similar bug?
Comment 3 Семён Марьясин 2010-04-29 14:40:29 UTC
Created attachment 159885 [details]
Makes a test repo with different file states (unmerged, added, deleted, modified, untracked)

Strange... Seems that command
git diff-index --name-status HEAD ./
reports unmerged files as modified ones...

/tmp $ ./mkrepo.sh 
Initialized empty Git repository in /tmp/test-repo/.git/
[master (root-commit) b1f202e] Initial commit
 4 files changed, 7 insertions(+), 0 deletions(-)
 create mode 100644 another1
 create mode 100644 another2
 create mode 100644 file
 create mode 100644 justafile
Switched to a new branch 'new'
[new 28be16b] Modification one
 1 files changed, 1 insertions(+), 1 deletions(-)
Switched to branch 'master'
[master 56bdae4] Modification two
 1 files changed, 1 insertions(+), 1 deletions(-)
Auto-merging file
CONFLICT (content): Merge conflict in file
Automatic merge failed; fix conflicts and then commit the result.
file: needs merge
rm 'another1'
Ready...
/tmp $ cd test-repo/
/tmp/test-repo $ git status
# On branch master
# Changes to be committed:
#
#       deleted:    another1
#       new file:   thenewfile1
#
# Unmerged paths:
#   (use "git add/rm <file>..." as appropriate to mark resolution)
#
#       both modified:      file
#
# Changed but not updated:
#   (use "git add/rm <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#
#       deleted:    another2
#       modified:   justafile
#
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#       thenewfile2
/tmp/test-repo $ git diff-index --name-status HEAD ./
D       another1
D       another2
M       file
M       justafile
A       thenewfile1
/tmp/test-repo $ meld .

And here is screenshot: http://s59.radikal.ru/i163/1004/a7/17fe93244cfe.png
Comment 4 Kai Willadsen 2010-05-03 01:15:47 UTC
So is there something wrong with Meld's behaviour here, or is it okay now that we're using git-diff-index?

Also, git-diff-index has a specific code ('U') for unmerged... I don't know why that's not being used here.
Comment 5 Семён Марьясин 2010-05-03 02:10:49 UTC
Current behaviour is still incorrect, because unmerged files must be shown as unmerged and not as added. But it seems that problem has moved from meld itself to git or our usage of it.
Comment 6 Kai Willadsen 2010-05-07 22:47:05 UTC
Created attachment 160546 [details] [review]
Tentative patch

I've spent a little while trying to figure this one out. I'm not convinced that I understand *why* git-diff-index doesn't do what we want, but "git diff-files -0" seems to.

Patch attached for testing.
Comment 7 Семён Марьясин 2010-05-08 18:14:54 UTC
I tested it on my test repo, and here is screenshot: http://funkyimg.com/u2/821/621/2010-05-08-220533_1024x600_scrot.png
Meld with this patch doesn't see changes that are already in index. Is it a correct behaviour? Previous version (without patch) showed them: http://s59.radikal.ru/i163/1004/a7/17fe93244cfe.png
Comment 8 Kai Willadsen 2010-05-24 21:45:37 UTC
In Meld HEAD, this now behaves as it used to, including showing changes in the index. Thanks for the bug report, and for your help tracking down various problems.