Defect #11868

Git and Mercurial diff displays deleted files as /dev/null

Added by Humberto Anjos about 5 years ago. Updated about 5 years ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Jean-Philippe Lang% Done:

0%

Category:SCM
Target version:2.2.0
Resolution:Fixed Affected version:

Description

It's the same bug reported here with ChiliProject: https://www.chiliproject.org/issues/589

Basically, in the diff view of git commits, deleted files show up as changes to the file /dev/null.

I'm using the Bitnami Redmine Stack, version 2.0.3-1. Administration > Information shows:

Environment:
  Redmine version                          2.0.3.stable
  Ruby version                             1.8.7 (x86_64-linux)
  Rails version                            3.2.6
  Environment                              production
  Database adapter                         MySQL

Associated revisions

Revision 10424
Added by Jean-Philippe Lang about 5 years ago

Fixed that git diff displays deleted files as /dev/null (#11868).

Revision 10428
Added by Toshi MARUYAMA about 5 years ago

use git diff format for all diff (#11868)

Mercurial diff uses git format.

Revision 10429
Added by Toshi MARUYAMA about 5 years ago

add functional attachment test of mercurial export file (#11868)

Revision 10431
Added by Toshi MARUYAMA about 5 years ago

set svn:eol-style native to test/fixtures/files/hg-export.diff (#11868)

History

#1 Updated by Toshi MARUYAMA about 5 years ago

  • Category set to SCM

#2 Updated by Jean-Philippe Lang about 5 years ago

What would be the expected behaviour?

#3 Updated by Humberto Anjos about 5 years ago

Jean-Philippe Lang wrote:

What would be the expected behaviour?

To show the original file names, with some indication that the files are no longer there.

An example of reasonable behavior can be seen here: in this commit, the files Events.cs and Utilities.cs no longer exist. When one clicks in Show Diff Stats, there is an icon showing that those files were removed.

P.S. Optionally, I wouldn't even show their contents too (my diff got truncated here, since some of the removed files were quite long...), but that's an extra :)

#4 Updated by Jean-Philippe Lang about 5 years ago

  • Subject changed from /dev/null in commit-diff-views to Git diff displays deleted files as /dev/null
  • Status changed from New to Closed
  • Assignee set to Jean-Philippe Lang
  • Target version set to 2.2.0
  • Resolution set to Fixed

Humberto Anjos wrote:

To show the original file names, with some indication that the files are no longer there.

An example of reasonable behavior can be seen here: in this commit, the files Events.cs and Utilities.cs no longer exist. When one clicks in Show Diff Stats, there is an icon showing that those files were removed.

Fixed in r10424. The indication that the file was deleted is displayed on the revision view.

P.S. Optionally, I wouldn't even show their contents too (my diff got truncated here, since some of the removed files were quite long...), but that's an extra :)

Not sure that this behaviour is desirable to everyone, maybe a seperate feature request.

#5 Updated by Jean-Philippe Lang about 5 years ago

Oh, and don't forget to clear your cache if you upgrade (diff rendering is cached).

#6 Updated by Toshi MARUYAMA about 5 years ago

  • Subject changed from Git diff displays deleted files as /dev/null to Git and Mercurial diff displays deleted files as /dev/null

Also available in: Atom PDF