Re: [OT] Difficulty creating working patch - renamed file.

2010-09-28 Thread Rainer Jung

On 28.09.2010 19:11, Mark Thomas wrote:

On 28/09/2010 17:36, David Jencks wrote:


 From what I hear the best advice is "use git, not svn".  However that's 
usually difficult at apache.


There are git mirrors for trunk and 6.0.x/trunk but that does rely on a
Tomcat committer also using git. Anyone?

I had high hopes for git, particularly around working on multiple issues
at the same time and 'off-line' commits for an incremental approach to
larger changes but having experienced / been forced to use git at work I
have to say I won't be switching anytime soon. The benefit of the extra
features I would use doesn't yet outweigh the costs of switching.


I started using "git svn" when working on httpd. What is nice is the 
ability to prepare everything including log message and then when it 
looks fine, apply to svn without a lot of copy and paste. I usually 
create a git branch for some feature, then work there until I'm 
satisfied, merge to my trunk and from their use "git svn dcommit" to 
apply to the ASF svn.


Since I didn't have much experience with the real merge feature, I often 
"merge" by doing cherry-picking with git revisions, e.g.


git branch newbranch
git checkout newbranch
... work until fine
... decide I want to "merge" git revision 9240f4 from that branch
git checkout trunk
git format-patch -k --stdout 9240f4^..9240f4 | git am -3 -k
git log /* optional */
git svn dcommit
git branch -d newbranch /* delete when no longer needed */

Here 9240f4 is the short form of some git revision.

For the initial setup (replace PROJECT_NAME)

git clone git://git.apache.org/PROJECT_NAME
cd PROJECT_NAME/.git; wget http://git.apache.org/authors.txt; cd ..
git config svn.authorsfile ".git/authors.txt"
git config --global user.name "My Full Name" /* Use your name */
git config --global user.email my.em...@adress /* Use your mail address */
git config --global color.diff auto
git config --global color.status auto
git config --global color.branch auto
git svn init --prefix=origin/ --tags=tags --trunk=trunk 
--branches=branches https://svn.apache.org/repos/asf/PROJECT_NAME

git svn rebase

For a list of projects see http://git.apache.org/. That page also 
contains in its upper part two links to further docs about git at ASF.


I didn't yet use git for Tomcat, but will soon.

I didn't yet check, how "git svn dcommit" behaves, when files are moved.

Regards,

Rainer

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



Re: [OT] Difficulty creating working patch - renamed file.

2010-09-28 Thread Mark Thomas
On 28/09/2010 17:36, David Jencks wrote:
> 
> From what I hear the best advice is "use git, not svn".  However that's 
> usually difficult at apache.

There are git mirrors for trunk and 6.0.x/trunk but that does rely on a
Tomcat committer also using git. Anyone?

I had high hopes for git, particularly around working on multiple issues
at the same time and 'off-line' commits for an incremental approach to
larger changes but having experienced / been forced to use git at work I
have to say I won't be switching anytime soon. The benefit of the extra
features I would use doesn't yet outweigh the costs of switching.

> What I try to do in this situation is to supply a script with the svn mv 
> commands along with the patch from svn diff

+1.

Mark



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



Re: [OT] Difficulty creating working patch - renamed file.

2010-09-28 Thread Konstantin Kolinko
2010/9/28 Wesley Acheson :
> HI All,
>
> I'm not actually sure how OT this is or if the question belongs here.
>
> This is semi duplicating some comments seen in a bug. However I think
> its useful for anyone trying to create future patches who is
> inexperienced like me, so I'm sort of double posting.
>
> I'm trying to create a patch. However part of that patch is renaming a
> file then modifying its contents. However when a .patch is created in
> eclipse it appears to record the delete then record the changes to the
> new filename. However as It hasn't got the new filename in SVN when
> that patch is applied it breaks.
>
> I've no idea how to record this properly as It appears that the
> patches are always made against SVN directly. So I can't provide a
> patch to rename the file then another patch to modify its contents.
>
> Finally the question. How to create a patch that involves moving or
> renaming a file and changing its contents.
>

1) It is not possible to represent svn move operation in an unified
diff format. Adds are represented (as a new file with content vs. old
file of zero length), but there is no information about where the file
was copied from.

2) Patches are applied by an external program. Implementations do differ.

As someone noticed, there is an ambiguity, whether the file was
deleted or whether its content was removed (setting its length to 0).

Also patch carries no explicit information about creating intermediate
directories if those are needed.

3) In complex cases I used to provide/propose not only a patch file,
but also a series of commands that are to be executed before applying
it.


The Subversion 1.7 (that is currently being developed) is expected to
solve 1) and 2) by providing enhancements to the diff format generated
by subversion (I am looking forward to "svn diff --git" option) and
new "svn patch" command.

http://subversion.apache.org/roadmap.html
http://svnbook.red-bean.com/nightly/en/svn.ref.svn.c.diff.html



Regarding BZ 50001, note that *.launch files have already been moved
and renamed in the current /trunk.

Best regards,
Konstantin Kolinko

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



Re: [OT] Difficulty creating working patch - renamed file.

2010-09-28 Thread David Jencks

On Sep 28, 2010, at 7:23 AM, Wesley Acheson wrote:

> HI All,
> 
> I'm not actually sure how OT this is or if the question belongs here.
> 
> This is semi duplicating some comments seen in a bug. However I think
> its useful for anyone trying to create future patches who is
> inexperienced like me, so I'm sort of double posting.
> 
> I'm trying to create a patch. However part of that patch is renaming a
> file then modifying its contents. However when a .patch is created in
> eclipse it appears to record the delete then record the changes to the
> new filename. However as It hasn't got the new filename in SVN when
> that patch is applied it breaks.
> 
> I've no idea how to record this properly as It appears that the
> patches are always made against SVN directly. So I can't provide a
> patch to rename the file then another patch to modify its contents.
> 
> Finally the question. How to create a patch that involves moving or
> renaming a file and changing its contents.

From what I hear the best advice is "use git, not svn".  However that's usually 
difficult at apache.

It's really unfortunate that svn can't generate usable patches if you've svn 
mv'ed any files.  What I try to do in this situation is to supply a script with 
the svn mv commands along with the patch from svn diff.  Part of the patch 
won't apply (the part that empties the moved files) but the part that shows the 
modifications of the moved files should.

Supplying an svn script for the file move rather than a patch means that svn 
history will be preserved.  A patch just from svn mv won't result in proper svn 
history (and I think also won't actually add the content to the files at the 
new location)

david jencks

> 
> Wes
> 
> -
> To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: dev-h...@tomcat.apache.org
> 


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



Re: [OT] Difficulty creating working patch - renamed file.

2010-09-28 Thread Wesley Acheson
I don't really run SVN from the command line. But yes I believe thats
been done via the eclipse plugin actually I think it called svn move.

On Tue, Sep 28, 2010 at 5:11 PM, Caldarale, Charles R
 wrote:
>> From: Wesley Acheson [mailto:wesley.ache...@gmail.com]
>> Subject: [OT] Difficulty creating working patch - renamed file.
>
>> However as It hasn't got the new filename in SVN when
>> that patch is applied it breaks.
>
> Have you tried "svn add" to register the new (renamed) file in the 
> .svn/entries file?
>
>  - Chuck
>
>
> THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
> MATERIAL and is thus for use only by the intended recipient. If you received 
> this in error, please contact the sender and delete the e-mail and its 
> attachments from all computers.
>
>
> -
> To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: dev-h...@tomcat.apache.org
>
>

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



RE: [OT] Difficulty creating working patch - renamed file.

2010-09-28 Thread Caldarale, Charles R
> From: Wesley Acheson [mailto:wesley.ache...@gmail.com] 
> Subject: [OT] Difficulty creating working patch - renamed file.

> However as It hasn't got the new filename in SVN when
> that patch is applied it breaks.

Have you tried "svn add" to register the new (renamed) file in the .svn/entries 
file?

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[OT] Difficulty creating working patch - renamed file.

2010-09-28 Thread Wesley Acheson
HI All,

I'm not actually sure how OT this is or if the question belongs here.

This is semi duplicating some comments seen in a bug. However I think
its useful for anyone trying to create future patches who is
inexperienced like me, so I'm sort of double posting.

I'm trying to create a patch. However part of that patch is renaming a
file then modifying its contents. However when a .patch is created in
eclipse it appears to record the delete then record the changes to the
new filename. However as It hasn't got the new filename in SVN when
that patch is applied it breaks.

I've no idea how to record this properly as It appears that the
patches are always made against SVN directly. So I can't provide a
patch to rename the file then another patch to modify its contents.

Finally the question. How to create a patch that involves moving or
renaming a file and changing its contents.

Wes

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org