[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: "svn patch" and the TAB character

From: Daniel Shahaf <d.s_at_daniel.shahaf.name>
Date: Sat, 14 Dec 2019 10:59:01 +0000

Doug Robinson wrote on Fri, 13 Dec 2019 21:59 +00:00:
> If I [...] edit that patch file using an editor with settings that replace the TAB
> with a "proper" number of SPACE characters,

Don't do that. If the context lines start with tabs (ignoring the first
column), they would be corrupted and the patch wouldn't apply — and even
if it did apply, the indentation would be off-by-one or off-by-eight. However:

> $ svn patch ../n.txt
> Skipped missing target: 'TheFile (revision 18)'
> Summary of conflicts:
> Skipped paths: 1
>
> (the TAB was between "TheFile" and "(revision...)".

Fixing this specific case would be helpful to projects that use spaces-
only indentation where the unidiff got tabs-to-spaces'ed at some point
(e.g., some terminal emulators do this). I'm not opposed to it, though
I don't think it's high priority either. Does anyone have an algorithm
to propose? (An algorithm for deriving the name of a file to patch from
the +++, ---, and "Index:" lines.)

Cheers,

Daniel
Received on 2019-12-14 11:59:35 CET

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.