On Mon, Jun 19, 2006, Baruch Even wrote about "Re: Subversion-friendly Shell hacking?": > > Turns out that in order to get Subversion to properly manage and keep > > track of history of files even when they are copied or renamed, one > > should use 'svn copy' instead of 'cp' and 'svn move' instead of 'mv'. > > > > I wonder whether shells (such as bash) have a facility to do > > directory-dependent aliasing. For example, when your pwd is a directory > > checked out from a svn repository (could be identified as having .svn > > subdirectory or declared as such in .bash_profile), then your 'cp' > > becomes alias to a script which processes cp's arguments and issues the > > appropriate 'svn copy' command/s. >... > What you can do is create a shell function called mv that will check if > the file is in a subversion directory and do svn move on it. The > function will override the call to mv and you'll need to call the real > mv with /bin/mv.
Another possible trick is to change "cd" itself to a function (or, in zsh, create a new "chpwd"), and after each directory change, re-alias the "cp" and "mv" commands. -- Nadav Har'El | Monday, Jun 19 2006, 24 Sivan 5766 [EMAIL PROTECTED] |----------------------------------------- Phone +972-523-790466, ICQ 13349191 |How to become immortal: Read this http://nadav.harel.org.il |signature tomorrow and follow its advice. ================================================================= To unsubscribe, send mail to [EMAIL PROTECTED] with the word "unsubscribe" in the message body, e.g., run the command echo unsubscribe | mail [EMAIL PROTECTED]
