You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Ulrich Eckhardt <ec...@satorlaser.com> on 2007/02/12 12:58:27 UTC

Re: rename and diff

On Monday 12 February 2007 06:01, Dave Grundgeiger wrote:
> Hi. I'm familiar with Subversion but not an expert. I want to rename a file
> in a working copy and then produce a patch representing the rename. I'm
> doing the following:
>
> svn rename oldname.txt newname.txt
> svn diff
>
> The resulting diff contains the deletion of oldname.txt, but not the
> addition of newname.txt. Is this the intended behavior?

diff files can't represent moved/renamed files, the format simply doesn't 
allow it. Same problem applies to directories (only implicitly by creating 
files therein), deleting files (only via making them empty) or adding files 
(only via giving them content). Further things are SVN-specific properties of 
a file or OS-specific properties like permissions.

/me just wonders if that shouldn't be a FAQ...

Uli

-- 
ML: http://subversion.tigris.org/mailing-list-guidelines.html
FAQ: http://subversion.tigris.org/faq.html
Docs: http://svnbook.red-bean.com/

**************************************************************************************
           Visit our website at <http://www.satorlaser.de/>
**************************************************************************************
Diese E-Mail einschließlich sämtlicher Anhänge ist nur für den Adressaten bestimmt und kann vertrauliche Informationen enthalten. Bitte benachrichtigen Sie den Absender umgehend, falls Sie nicht der beabsichtigte Empfänger sein sollten. Die E-Mail ist in diesem Fall zu löschen und darf weder gelesen, weitergeleitet, veröffentlicht oder anderweitig benutzt werden.
E-Mails können durch Dritte gelesen werden und Viren sowie nichtautorisierte Änderungen enthalten. Sator Laser GmbH ist für diese Folgen nicht verantwortlich.

**************************************************************************************

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org


Re: rename and diff

Posted by Dave Grundgeiger <da...@codenouveau.com>.
Jeff Smith wrote:
> I'm not qualified to answer, but I'll give it a guess. It seems this
> responsibility has been falling on the specific "package manager"
> utility. For example, if YOU (managing packages installed on SUSE
> Linux) wants to update my "firefox" package using only a differential
> patch, I think it would have to decide what to send to complete the
> differential update.

Thats an interesting question too, but I'm talking about the other 
direction. Suppose I wanted to contribute a fix to a Subversion bug, and the 
fix involved directory and file renames. I can perform these renames in my 
WC, but svn diff doesn't capture them so I can't submit this patch. Of 
course I can imagine ways to deal with this--I can have the project 
maintainers do the renames themselves or I can provide a shell script to do 
the renames. I'm just asking if there's a commonly accepted practice or 
perhaps another tool that I should be using. I guess another way you could 
look at it is that I want to merge my changes into someone else's WC rather 
than into the repository.

Dave

Dave Grundgeiger
CodeNouveau, LLC
Develop .NET Software with Open-Source Tools
http://www.codenouveau.com 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: rename and diff

Posted by Jeff Smith <js...@robotronics.com>.
On Thursday 15 February 2007 14:46, James Oltmans wrote:
> -----Original Message-----
> From: Dave Grundgeiger [mailto:dave.grundgeiger@codenouveau.com]
> Sent: Wednesday, February 14, 2007 3:42 PM
> To: users@subversion.tigris.org
> Subject: Re: rename and diff
>
> I haven't received any comments on this. *Is* there a standard
> practice? It
> seems fairly straightforward: I've issued a bunch of svn rename
> commands in
> my WC, but this can't be represented in a diff file. I want to hand
> over a
> convenient, atomic patch to a project's maintainers. What do others
> do? My
> solution was to supply a batch file with the svn commands, plus a
> diff file
> with the actual file changes. Is this reasonable?
>
> Dave
>
> Dave Grundgeiger
> CodeNouveau, LLC
> Develop .NET Software with Open-Source Tools
> http://www.codenouveau.com
>
> -------------------------------------------------------------------
>
> I'd like to know as well. We currently deliver patches by hand and
> our customers are used to it. People don't seem very comfortable
> with just replacing the system whole. We also have customers who
> modify the code we distribute (I know a nightmare, we shouldn't be
> distributing code but that's what we've always done). We're also
> concerned about SOX, though I really think that as far as SOX
> compliance is concerned that's just a red herring.
>
> But, I digress, what is the best way to distribute patches to code
> where the names can change?

I'm not qualified to answer, but I'll give it a guess. It seems this 
responsibility has been falling on the specific "package manager" 
utility. For example, if YOU (managing packages installed on SUSE 
Linux) wants to update my "firefox" package using only a differential 
patch, I think it would have to decide what to send to complete the 
differential update.

Anybody know how tools that use svn libs to implement this sort of 
specific application automatically?

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

RE: rename and diff

Posted by James Oltmans <jo...@bolosystems.com>.
-----Original Message-----
From: Dave Grundgeiger [mailto:dave.grundgeiger@codenouveau.com] 
Sent: Wednesday, February 14, 2007 3:42 PM
To: users@subversion.tigris.org
Subject: Re: rename and diff

> What is the accepted practice when you have a complicated set of
changes 
> for which you want to create a single patch?

I haven't received any comments on this. *Is* there a standard practice?
It 
seems fairly straightforward: I've issued a bunch of svn rename commands
in 
my WC, but this can't be represented in a diff file. I want to hand over
a 
convenient, atomic patch to a project's maintainers. What do others do?
My 
solution was to supply a batch file with the svn commands, plus a diff
file 
with the actual file changes. Is this reasonable?

Dave

Dave Grundgeiger
CodeNouveau, LLC
Develop .NET Software with Open-Source Tools
http://www.codenouveau.com 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

I'd like to know as well. We currently deliver patches by hand and our
customers are used to it. People don't seem very comfortable with just
replacing the system whole. We also have customers who modify the code
we distribute (I know a nightmare, we shouldn't be distributing code but
that's what we've always done). We're also concerned about SOX, though I
really think that as far as SOX compliance is concerned that's just a
red herring. 

But, I digress, what is the best way to distribute patches to code where
the names can change?

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org


Re: rename and diff

Posted by Dave Grundgeiger <da...@codenouveau.com>.
> What is the accepted practice when you have a complicated set of changes 
> for which you want to create a single patch?

I haven't received any comments on this. *Is* there a standard practice? It 
seems fairly straightforward: I've issued a bunch of svn rename commands in 
my WC, but this can't be represented in a diff file. I want to hand over a 
convenient, atomic patch to a project's maintainers. What do others do? My 
solution was to supply a batch file with the svn commands, plus a diff file 
with the actual file changes. Is this reasonable?

Dave

Dave Grundgeiger
CodeNouveau, LLC
Develop .NET Software with Open-Source Tools
http://www.codenouveau.com 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: rename and diff

Posted by Dave Grundgeiger <da...@codenouveau.com>.
> diff files can't represent moved/renamed files,

What is the accepted practice when you have a complicated set of changes for 
which you want to create a single patch?

Thanks

Dave

CodeNouveau, LLC
Develop .NET Software with Open-Source Tools
http://www.codenouveau.com 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: rename and diff

Posted by Vincent Lefevre <vi...@vinc17.org>.
On 2007-02-12 08:34:23 -0600, Dave Grundgeiger wrote:
> Ulrich Eckhardt wrote:
> >diff files can't represent moved/renamed files
> 
> I thought that might be the case. What is the standard practice then when 
> contributing to a project for which I don't have commit rights? Would I 
> provide a batch file containing svn commands that accomplish the renames 
> plus a diff file containing file edits?

Hmm... I'd say that the current behavior is buggy when the
--notice-ancestry option isn't given.

-- 
Vincent Lefèvre <vi...@vinc17.org> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / Arenaire project (LIP, ENS-Lyon)

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: rename and diff

Posted by Dave Grundgeiger <da...@codenouveau.com>.
Ulrich Eckhardt wrote:
> diff files can't represent moved/renamed files

I thought that might be the case. What is the standard practice then when 
contributing to a project for which I don't have commit rights? Would I 
provide a batch file containing svn commands that accomplish the renames 
plus a diff file containing file edits?

Thanks!

Dave 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: [RFE] Re: rename and diff

Posted by Vincent Lefevre <vi...@vinc17.org>.
On 2007-02-12 09:46:14 -0600, Dave Grundgeiger wrote:
> Yes, you're right. If I do this:
> 
> svn add newFile.txt
> svn diff
> 
> I get output, but if I do this:
> 
> svn copy oldFile.txt newFile.txt
> svn diff
> 
> I get no output, even though the status on newFile.txt is "Added."
> 
> Including --notice-ancestry on the diff made no difference.

This is the problem. IMHO, with --notice-ancestry, "svn diff" should
consider ancestry for newFile.txt, i.e. it should notice that it has
been copied from oldFile.txt, and as there hasn't been any change, it
should output nothing (this is the current behavior, which is correct
in this case). But now, if --notice-ancestry is not given, "svn diff"
should compare newFile.txt with the old newFile.txt version, and as
newFile.txt (under that name) is new, it should output the diff like
"svn add"; but it doesn't, and I think this is a bug.

-- 
Vincent Lefèvre <vi...@vinc17.org> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / Arenaire project (LIP, ENS-Lyon)

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: [RFE] Re: rename and diff

Posted by Dave Grundgeiger <da...@codenouveau.com>.
Vincent Lefevre
> When there is an
> addition, svn does show the addition. Now, the rename is just a
> copy + a delete. The delete is shown as expected. When there is a
> copy, svn shows the diff against the old version; when there are
> no diffs (i.e. one just has a copy, not a copy + modifications),
> svn doesn't show anything. I wonder if svn shouldn't output:

Yes, you're right. If I do this:

svn add newFile.txt
svn diff

I get output, but if I do this:

svn copy oldFile.txt newFile.txt
svn diff

I get no output, even though the status on newFile.txt is "Added."

Including --notice-ancestry on the diff made no difference.

Dave

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

[RFE] Re: rename and diff

Posted by Vincent Lefevre <vi...@vinc17.org>.
On 2007-02-12 13:58:27 +0100, Ulrich Eckhardt wrote:
> On Monday 12 February 2007 06:01, Dave Grundgeiger wrote:
> > Hi. I'm familiar with Subversion but not an expert. I want to
> > rename a file in a working copy and then produce a patch
> > representing the rename. I'm doing the following:
> >
> > svn rename oldname.txt newname.txt
> > svn diff
> >
> > The resulting diff contains the deletion of oldname.txt, but not
> > the addition of newname.txt. Is this the intended behavior?
> 
> diff files can't represent moved/renamed files, the format simply
> doesn't allow it. Same problem applies to directories (only
> implicitly by creating files therein), deleting files (only via
> making them empty) or adding files (only via giving them content).

I don't think you really answer the question. When there is an
addition, svn does show the addition. Now, the rename is just a
copy + a delete. The delete is shown as expected. When there is a
copy, svn shows the diff against the old version; when there are
no diffs (i.e. one just has a copy, not a copy + modifications),
svn doesn't show anything. I wonder if svn shouldn't output:

Index: newname.txt (copied)
===================================================================

like it does for deleted files, or even:

Index: newname.txt (copied from oldname.txt)
===================================================================

-- 
Vincent Lefèvre <vi...@vinc17.org> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / Arenaire project (LIP, ENS-Lyon)

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org