question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

if diff has space in folderName/fileName in filePath then parsed filename is wrong

See original GitHub issue

Step -1: Before filling an issue check out troubleshooting section

Step 0: Describe your environment

  • OS: ubuntu 20.04 LTS
  • diff2html version: 3.4.3
  • Using diff2html directly or using diff2html-ui helper: using both
  • Extra flags: _

Step 1: Describe the problem:

when user creates a folder or file with name some which has space in it then the parsed output of unified diff is giving wrong fileName

Steps to reproduce:

  1. use can use unified diff which has space in folder name or file name and check parsed output

diff example:

diff --git a/notebooks/Untitled Folder/untitled.txt b/notebooks/Untitled Folder/untitled.txt\nnew file mode 100644\nindex 0000000..e69de29\ndiff --git a/notebooks/new.txt b/notebooks/new1.txt\nsimilarity index 83%\nrename from notebooks/new.txt\nrename to notebooks/new1.txt\nindex 0dea293..fe4d7e2 100644\n--- a/notebooks/new.txt\n+++ b/notebooks/new1.txt\n@@ -1,2 +1,2 @@\n Text to test git backend functionality.\n-new li\n\\ No newline at end of file\n+new line\n\\ No newline at end of file\ndiff --git a/notebooks/untitled1.txt b/notebooks/untitled1.txt\nnew file mode 100644\nindex 0000000..3e5126c\n--- /dev/null\n+++ b/notebooks/untitled1.txt\n@@ -0,0 +1 @@\n+new\n\\ No newline at end of file\n

Observed Results:

  • What happened? This could be a description, log output, etc. ​​ addedLines: 0 blocks: Array [] checksumAfter: “e69de29” checksumBefore: “0000000” deletedLines: 0 isGitDiff: true isNew: true newFileMode: “100644” newName: “Folder/untitled.txt” oldName: “notebooks/Untitled Folder/untitled.txt b/notebooks/Untitled”

Expected Results:

  • What did you expect to happen?

newName: “notebooks/Untitled Folder/untitled.txt” oldName: “notebooks/Untitled Folder/untitled.txt”

Relevant Code:

// TODO(you): code here to reproduce the problem

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
rtfpessoacommented, Jul 9, 2021

Released as version 3.4.7

0reactions
rtfpessoacommented, Jul 9, 2021

Anyway since it does not stay worse than what it is now I went ahead and merged the update. Let me know how it goes.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Shell: rsync parsing spaces incorrectly in file name/path
I read the list of files from a .txt file (each file and path on one line), and I'm using ubuntu 14.04. Thanks!...
Read more >
Looping through files with spaces in the names? [duplicate]
Short answer (closest to your answer, but handles spaces) OIFS="$IFS" IFS=$'\n' for file in `find . -type f -name "*.csv"` do echo "file...
Read more >
Long filenames or paths with spaces require quotation marks
Use quotation marks when specifying long filenames or paths with spaces. For example, typing the copy c:\my file name d:\my new file name ......
Read more >
bash - Filenames with spaces breaking for loop, find command
This is the solution that worked for me. I was using comm to compare sorted file listings and the filenames had spaces in...
Read more >
Why shouldn't spaces be used in filenames on the computer?
In Linux the file name is part of the directory structure, then that file name points to an 'inode', which includes pointers to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found