|
mac geekeryGet your geek on. |
Auto-adding Files to a RepositoryOctober 31, 2008 - 1:19pm
Since I use Mercurial and it doesn’t have Xcode integration, I find that I’ll have added classes or whatnot and they will not have been added to the repository and I’ll forget about them come checkin time. That’s bad. So I thought about ways to remedy this, and after describing the issue to myself, the issue was clear. “When I add new files to the directory, it should run So I made a hg st | grep '^?' | cut -c'3-258' | xargs hg add So we get the files that HG hasn’t committed yet (and this excludes files from Ta da! New files are automatically added to the repository. Ensure your Of course you could do this with Subversion with minor changes. I leave that as an exercise to the reader (or a generous commenter). About Adam Knight |
|
||||
svn st | grep ‘^?’ | cut -c’8-258’ | xargs svn add
Doesn’t handle files with spaces in their names. Maybe run through
perl -pe 's/\n/\000/'"?Like this:
| grep '^?' \
| cut -c'3-258' \
| perl -pe 's/\n/\000/' \
| xargs -0 hg add