Edgewall Software
Modify

Opened 8 years ago

Closed 8 years ago

#12341 closed defect (duplicate)

Patch with space in filenames is displayed wrong

Reported by: pano Owned by:
Priority: low Milestone:
Component: rendering Version:
Severity: trivial Keywords: diff mimeview
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

Paths with spaces contained in patches / diffs are displayed wrong:

  • dir

    diff --git a/dir with spaces/filename b/dir with spaces/filename
    a b  
    11abcdef
     2ghijkl
  • dirWithoutSpaces/filename

    diff --git a/dirWithoutSpaces/filename b/dirWithoutSpaces/filename
    a b  
    11abcdef
     2ghijkl

The first "title" is displayed as just dir when it should actually be dir with spaces/filename.

(Same with attached patches.)

Attachments (0)

Change History (4)

comment:1 by pano, 8 years ago

The problem seems to be here: source:trunk/trac/mimeview/patch.py@13930:136,148#L134

Change both occurrences of split(None, 2) to split(None, 1) to fix it. But I don't know what [rev] could be. oldrev and newrev seem to get ignored anyway.

comment:2 by Jun Omae, 8 years ago

Keywords: mimeview added; patch removed
Milestone: next-stable-1.0.x
Priority: normallow
Severity: normalminor

comment:3 by Jun Omae, 8 years ago

Severity: minortrivial

It wouldn't fix. Another complex case.

$ mkdir 'file.txt a' 'file.txt b'
$ echo 1 >./file.txt\ a/file.txt
$ echo 1 >./file.txt\ b/file.txt
$ git add *
$ git commit -a -m test
[master c80f2b2] test
 2 files changed, 2 insertions(+)
 create mode 100644 file.txt a/file.txt
 create mode 100644 file.txt b/file.txt
$ echo 2 >./file.txt\ b/file.txt
$ echo 2 >./file.txt\ a/file.txt
$ git diff

Diff:

diff --git a/file.txt a/file.txt b/file.txt a/file.txt
index d00491f..0cfbf08 100644
--- a/file.txt a/file.txt
+++ b/file.txt a/file.txt
@@ -1 +1 @@
-1
+2
diff --git a/file.txt b/file.txt b/file.txt b/file.txt
index d00491f..0cfbf08 100644
--- a/file.txt b/file.txt
+++ b/file.txt b/file.txt
@@ -1 +1 @@
-1
+2

I think we should retrieve path from diff --git a/... b/... line, or detect git extended format by the diff --git line.

comment:4 by Jun Omae, 8 years ago

Milestone: next-stable-1.0.x
Resolution: duplicate
Status: newclosed

A duplicate of #6943.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The ticket will remain with no owner.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from (none) to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.