git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Diff filename has trailing tab if filename contains space

From
乙酸鋰 <ch3cooli@gmail.com>
Date
Mar 4, 2016, 23:50 UTC
Message-ID
<CAHtLG6TLAOA0hg897EntOjG1kJsZEmjDshc-yyO9zP27540AAg@mail.gmail.com>
Hi,
Using git 2.7.1

Diff filename has trailing tab if filename contains space Please run below shell script and look at the output diff file 1.diff There is trailing tab chars after these lines:

--- a/8 1/8.txt
+++ b/8 1/8.txt
---- b/9 86
+++ b/9 86



#!/bin/sh
set -e
git init

echo a >> "normal"
git add "normal"
echo y >> "9 86"
git add "9 86" # file name has space
mkdir x
echo d >> "x/normal"
git add "x/normal"
mkdir "8 1"
echo u >> "8 1/8.txt" # directory name has space
echo k >> "8 1/8.txt"
git add "8 1/8.txt"
git commit -m "Initial commit"

echo b >> "normal"
git add "normal"
echo c >> "9 86"
git add "9 86"
echo e >> "x/normal"
git add "x/normal"
echo h >> "8 1/8.txt"
git add "8 1/8.txt"
git commit -m "Edit files"
git diff master~1 > 1.diff
Next: Junio C Hamano
Message 1 of 2 in “Diff filename has trailing tab if filename contains space”
  1. 乙酸鋰Mar 4, 2016
  2. Junio C HamanoMar 5, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.