SitePoint Sponsor |
|
User Tag List
Results 1 to 15 of 15
-
Oct 18, 2007, 09:13 #1
Using subversion with rails: a real pain for dirs and files added?
We know that with subversion if i modfy files in my working copy everythink is transparent when i will do a commit. Instead if i add files or directory to the working copy i must use the related svn subcommands such as svn add for example. But this is a pain in rails where in a working day with my working copy i will add many autogenerated files and directory. At the end of the day when i'm ready to commit i have to remember every files in every directory or directories that rails (or me) added to the project and i have to run the svn add command for each of them. Am i wrong? What is at the end the benefit of using it?
-
Oct 18, 2007, 13:24 #2Code:
./script/generate controller Whatever --svn
-
Oct 18, 2007, 14:44 #3
wow i didn't know that option to the generator script
Is it documented somewhere?
Anyway someone has told me that a "svn add", with no argument, to the root rails app directory, will discover and schedule to add to the repository new files and directory whithin this rails app. Which way is the best and most used among rails developers? If i choose your way, do i have to do that only for generated stuff?
-
Oct 18, 2007, 16:19 #4
You can see all files that are yet to be added by running:
Code:$ svn st | sed "s/^? //"
Code:$ svn st | sed "s/^? //" | xargs svn add
-
Oct 18, 2007, 16:33 #5
-
Oct 18, 2007, 22:20 #6
-
Oct 19, 2007, 01:39 #7
- Join Date
- Feb 2006
- Location
- Worcs. UK
- Posts
- 404
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
If you are running Windows as your development environment and using SVN, I would highly recommend installing TortoiseSVN. With that installed, you can right click on the root of your application and commit. The Explorer plug-in will then list all the files that may need including in the commit. The items that are controlled by SVN and have changed since the last commit will be checked, but also files that are not in the repository and may need to also be included in the commit, will also be listed but unchecked. If you review that list before confirming the commit, it is usually fairly simple to pick up any files you've forgotten.
Also, the alterations of file icons in Windows explorer make it fairly easy to detect files that are either out of step with the repository or not included.
This link shows the right click menu additions, alteration of icons and an example explorer view of files.
-
Oct 19, 2007, 10:18 #8
- Join Date
- Jan 2006
- Posts
- 268
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
On the same note, svn with rails...
I'd like svn to ignore my log directory... I can't seem to get the svn:ignore propset working... Anyone got an example?If you give someone a program,
you will frustrate them for a day;
if you teach them how to program,
you will frustrate them for a lifetime.
-
Oct 19, 2007, 11:09 #9
svn add with no options doesn't do anything. There's nothing odd about chaining powerful unix commands together once you get to know them. Besides, as I said I've set it up a bash alias for the whole command so all I actually have to type is:
Code:$ aaa
-
Oct 19, 2007, 11:11 #10
You should be adding 'log' to the svn:ignore property of the root of your rails app. No need to add a trailing slash.
Personally I think you're better off ignoring specific files as you'll still need the log folder when you run a fresh checkout. So from the root of your Rails app run:
Code:$ svn propset svn:ignore log/
Code:*.log *.pid
-
Oct 19, 2007, 11:14 #11
As a side note, I wouldn't really recommend using the --svn switch with the generators unless you plan on checking the generated files in straight away; if you don't, then you'll have added files lying around that you might not necessarily want to check in at that point. Say an issue comes up that needs to be fixed there and then; you'd now have to go to the trouble of listing each individual file you want checking in so as not to check in all of the added files (that aren't relevant to that changeset).
Its almost always a good idea to not run svn add until you are ready to check in and only then svn add the files you need.
-
Oct 19, 2007, 12:07 #12
if i run:
svn add * --force
...it adds every unversioned file and/or dir if i type that command in the root of the app.
-
Oct 19, 2007, 16:20 #13
- Join Date
- Jan 2006
- Posts
- 268
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I keep getting this if I try to set it on files:
svn: Cannot set 'svn:ignore' on a file ('log/development.log')If you give someone a program,
you will frustrate them for a day;
if you teach them how to program,
you will frustrate them for a lifetime.
-
Oct 19, 2007, 17:03 #14
-
Oct 19, 2007, 20:02 #15
- Join Date
- Jan 2006
- Posts
- 268
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Thanks for your help Luke.
I also found this page:
http://wiki.rubyonrails.org/rails/pa...WithSubversion
Which is a great help and has some scripts tooIf you give someone a program,
you will frustrate them for a day;
if you teach them how to program,
you will frustrate them for a lifetime.
Bookmarks