i got a file like this and i need add it into my svn
admin/upload_data/FINAL leg list 19_01_2010 to agar (Merged data in one).xls
i as able to add other files with space using the following command :
svn st |grep ? |cut -c8- |sed 's/ /\ /g' |xargs svn add
however there are some special characters like ( ) +#@ that svn cannot understand as the full path of the file .
can some one help me in this in perl or in shell .
On Mon, Jan 24, 2011 at 6:57 AM, Agnello George agnello.dsouza@gmail.com wrote:
i got a file like this and i need add it into my svn
admin/upload_data/FINAL leg list 19_01_2010 to agar (Merged data in one).xls
First: don't do this, seriously. You're begging for pain in your scripting to handle such files from now on.
i as able to add other files with space using the following command :
svn st |grep ? |cut -c8- |sed 's/ /\ /g' |xargs svn add
Second, stop playing with xargs in command line handling. It is not your friend.
You should be able to do "svn add "admin/upload_data/FINAL leg list
svn add "admin/upload_data/FINAL leg list 19_01_2010 to agar (Merged data in one).xls"
however there are some special characters like ( ) +#@ that svn cannot understand as the full path of the file .
Well, *YES*. You're going to have difficulty getting characters that mean things to the subversion somponent numbering scheme or the Subversion URL scheme, such as '@', '/', and '#' into the actual filenames. Even if you can leverage your way past this by stuffing in enough backslashes, you're effectively destabilizing your Subversion repository and scripting to handle it, especially post-commit scripts.
can some one help me in this in perl or in shell .
-- Regards Agnello D'souza
Can you first explain why you want, or need, to do this?
On Mon, Jan 24, 2011 at 6:25 PM, Nico Kadel-Garcia nkadel@gmail.com wrote:
On Mon, Jan 24, 2011 at 6:57 AM, Agnello George agnello.dsouza@gmail.com wrote:
i got a file like this and i need add it into my svn
admin/upload_data/FINAL leg list 19_01_2010 to agar (Merged data in one).xls
First: don't do this, seriously. You're begging for pain in your scripting to handle such files from now on.
i as able to add other files with space using the following command :
svn st |grep ? |cut -c8- |sed 's/ /\ /g' |xargs svn add
Second, stop playing with xargs in command line handling. It is not your friend.
You should be able to do "svn add "admin/upload_data/FINAL leg list
svn add "admin/upload_data/FINAL leg list 19_01_2010 to agar (Merged data in one).xls"
however there are some special characters like ( ) +#@ that svn cannot understand as the full path of the file .
Well, *YES*. You're going to have difficulty getting characters that mean things to the subversion somponent numbering scheme or the Subversion URL scheme, such as '@', '/', and '#' into the actual filenames. Even if you can leverage your way past this by stuffing in enough backslashes, you're effectively destabilizing your Subversion repository and scripting to handle it, especially post-commit scripts.
can some one help me in this in perl or in shell .
-- Regards Agnello D'souza
Can you first explain why you want, or need, to do this? _______________________________________________ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
the reason i need to do this i want to automate the whole process of checking into to svn from dev server and checking out to QA server for testing purpose , my script would change the config file in QA server .
the developers have lots of issues while checking in .
svn is not meant to contain binary files (AFAIK Excel files are binary), there is no way to see a meaningful diff of these files. Furthermore, developers should be able to adapt to a naming scheme that avoids such problems.
Kai
On 1/24/2011 8:31 AM, Kai Schaetzl wrote:
svn is not meant to contain binary files (AFAIK Excel files are binary), there is no way to see a meaningful diff of these files. Furthermore, developers should be able to adapt to a naming scheme that avoids such problems.
Subversion actually does a pretty good job of versioning binary files, transmitting and storing deltas, although you are right that it can't show you a useful diff unless you can supply a suitable program for the operation.
Agnello George wrote:
On Mon, Jan 24, 2011 at 6:25 PM, Nico Kadel-Garcia nkadel@gmail.com wrote:
<snip>
On Mon, Jan 24, 2011 at 6:57 AM, Agnello George agnello.dsouza@gmail.com wrote:
Can you first explain why you want, or need, to do this?
the reason i need to do this i want to automate the whole process of checking into to svn from dev server and checking out to QA server for testing purpose , my script would change the config file in QA server .
the developers have lots of issues while checking in .
First, why not one svn server? All vcs's have tags or labels or whatever they call them, and you extract by label <test> instead of <dev>, or <head>, or whatever.
Second, the issues that the developers have while checking in needs to be addressed, including management calling them into a meeting and telling them YOU WILL CHECK THE DAMN THINGS IN!!!!
mark, who has been in charge of software configuration management at more than one job
On 1/24/2011 7:05 AM, Agnello George wrote:
the reason i need to do this i want to automate the whole process of checking into to svn from dev server and checking out to QA server for testing purpose , my script would change the config file in QA server .
the developers have lots of issues while checking in .
Are the developers generating those .xls files running windows? If so, get them to install tortoise svn which makes subversion operations a right-mouse away. And by the way, you are going to run into even more problems if they are saving to a samba share and you check in from there. Subversion's concept of 'native' eol depends on the OS where the file is created being the same as the one running the svn client.
Nico Kadel-Garcia wrote:
Agnello George wrote:
i got a file like this and i need add it into my svn
admin/upload_data/FINAL leg list 19_01_2010 to agar (Merged data in one).xls
First: don't do this, seriously. You're begging for pain in your scripting to handle such files from now on.
i as able to add other files with space using the following command :
svn st |grep ? |cut -c8- |sed 's/ /\ /g' |xargs svn add
Second, stop playing with xargs in command line handling. It is not your friend.
That seems harsh. Can you explain? It's been my experience that using "find mumble/ -print0 | xargs -0 mumble" almost always provides a way to process arbitrary file names. But maybe this particular case can't be shoehorned into that idiom?
Best regards,
On Mon, Jan 24, 2011 at 9:06 AM, cpolish@surewest.net wrote:
Nico Kadel-Garcia wrote:
i as able to add other files with space using the following command :
svn st |grep ? |cut -c8- |sed 's/ /\ /g' |xargs svn add
Second, stop playing with xargs in command line handling. It is not your friend.
That seems harsh. Can you explain? It's been my experience that using "find mumble/ -print0 | xargs -0 mumble" almost always provides a way to process arbitrary file names. But maybe this particular case can't be shoehorned into that idiom?
It's a bit harsh, The fact that this conversation is happening here, instead of the subversion user list where it would be more appropriate, is a bit problematic. I personally hang out on both, but you'll get better application advice like this on the appropriate user mailing list.
xargs is very useful, but for line-by-line processing like this, its default mangling of whitespace is designed to pass the set of arguments as command line arguments to some basic shell command like "rm" or "cp" or "cat". Read the manual page for details, or run "info xargs" to get the full texinfo documentation.
If you *NEED* to do this, you can use something like:
svn st |grep ^'?' |cut -c8- | xargs --null svn add
This helps avoid border cases with spaces or tabs or '?' in filenames. Robustly sanitizing inputs is an art form.
On 1/24/11 5:57 AM, Agnello George wrote:
i got a file like this and i need add it into my svn
admin/upload_data/FINAL leg list 19_01_2010 to agar (Merged data in one).xls
i as able to add other files with space using the following command :
svn st |grep ? |cut -c8- |sed 's/ /\ /g' |xargs svn add
however there are some special characters like ( ) +#@ that svn cannot understand as the full path of the file .
can some one help me in this in perl or in shell .
What you need to know is too long to describe here, but first you need to find a list of shell metacharacters and how to quote them on the command line. Short version is that a \ quotes the next character single quotes quote everything except another single quote literally, double quotes cover most things but allow $variable expansion.
Then you need to look at what subversion itself requires after you get the literal value past the shell parser. I thought it was just that @ was interpreted as file@revision peg revision unless you append another @ to the end but there could be more restrictions. All of that is simple enough to work around - but probably not worth it compared to using sensible names. However the thing that is going to kill you is that files that differ only in case of one or more letters are different files on linux - and in a linux svn repository - but not on windows (where such things are most likely being created). Enforce some rules before that happens.
On Mon, Jan 24, 2011 at 7:12 PM, Les Mikesell lesmikesell@gmail.com wrote:
On 1/24/11 5:57 AM, Agnello George wrote:
i got a file like this and i need add it into my svn
admin/upload_data/FINAL leg list 19_01_2010 to agar (Merged data in
one).xls
i as able to add other files with space using the following command :
svn st |grep ? |cut -c8- |sed 's/ /\ /g' |xargs svn add
however there are some special characters like ( ) +#@ that svn cannot understand as the full path of the file .
can some one help me in this in perl or in shell .
What you need to know is too long to describe here, but first you need to find a list of shell metacharacters and how to quote them on the command line. Short version is that a \ quotes the next character single quotes quote everything except another single quote literally, double quotes cover most things but allow $variable expansion.
Then you need to look at what subversion itself requires after you get the literal value past the shell parser. I thought it was just that @ was interpreted as file@revision peg revision unless you append another @ to the end but there could be more restrictions. All of that is simple enough to work around - but probably not worth it compared to using sensible names. However the thing that is going to kill you is that files that differ only in case of one or more letters are different files on linux - and in a linux svn repository
- but not on windows (where such things are most likely being created).
Enforce some rules before that happens.
-- Les Mikesell lesmikesell@gmail.com
I found the solution ( i think ) i did
svn add html/Set min account.html svn: warning: 'html/Set' not found svn: warning: 'min' not found svn: warning: 'account.html' not found
then i did svn add "html/Set min account.html" A html/Set min account.html
so here is my final answer
instead of doing
for i in $(svn st | grep "?" | awk '{print $2}'); do svn add $i;done
i can do
for i in $(svn st | grep "?" | awk '{print $2}'); do svn add *"$i" *;done
This is working for me ... i wonder if i am going to stumble somewhere ...humm!
On 1/24/11 7:49 AM, Agnello George wrote:
so here is my final answer
instead of doing
for i in $(svn st | grep "?" | awk '{print $2}'); do svn add $i;done
i can do
for i in $(svn st | grep "?" | awk '{print $2}'); do svn add *"$i" *;done
This is working for me ... i wonder if i am going to stumble somewhere ...humm!
Yes, I'm not sure if that would work at the shell level if the files have embedded $'s and you are still going to miss on files with embedded @'s. And I'll repeat that as soon as someone duplicates one of those mixed case filenames with a case difference you won't be able to check out both copies on windows.