You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by jo...@widarsson.com on 2005/01/02 22:13:25 UTC
retying - Excluding directories on a sticky basis
Sorry for any inconvenience. I used the wrong From-address when sending
before. I didn't recieve anything from the list. Maybe it didn't get
through...
The original message follows:
***************************
Hello.
This is my first message to this list.
Please see this short (3 posts) thread at the php community:
http://forums.devnetwork.net/viewtopic.php?p=145846#145846
I am leaving CVS in favour of subversion because of the copy and move
abilities on files and directories subversion has.
But this message is a request for tips on how to stickily disallow a subdir of
a workdir to be included in the operations svn performs. By stickily I mean
that I want to define this restriction to the workdir and leave it that way
thereafter. The thread linked to above provides an example that was a halfway
success using a CVS alias module with "!" exclusion entries. It works on the
first checkout, but as soon as next update is performed, that exclusion I set
is not consulted. The effort is wasted.
I have not started using subversion for serious work yet, but I have read the
almost all of the "book" online today and yesterday. The book mentions
externals which include subdirs foreign to the current repository into the
workdir. this would have sufficed for me in an inverted sense (I mean that I
could split my project into small parts and link them in with externals), but
the manual says very clearly that svn will NOT recurse into subdirs that
represent an external - which breaks the behaivour I am looking for.
Please read the short thread linked to above and give me a comment on how I
should best use subversion to accomplish this.
Best regards
--
Jonas Widarsson
tel: +46 271 152 00 - tel: +46 271 121 42 (hemma/home) - gsm: +46 70 539 64 79
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Re: Excluding directories on a sticky basis
Posted by Max Bowsher <ma...@ukf.net>.
Jonas Widarsson wrote:
> On Tuesday 04 January 2005 20:54, Christopher Ness wrote:
>> On Tue, 2005-04-01 at 20:36 +0100, Jonas Widarsson wrote:
>>> However, you speak of the commit procedure, and I want to filter
>>> checkouts.
>>
>> Simply make the directories you do not want to check out unreadable by
>> all users. If you can't read the directory - you can't check it out.
> Now, that sounds odd...
>>
>> Not sure why you'd want to do that... but it's your call.
> I don't. I wan't to define different exclusions for different sites, ie:
> site1 - exclude modules/app2, themes/app2
> site2 - exclude modules/app1, themes/app1
> Although on my laptop I check them both out with "site", which has no
> exclusions defined. That's pretty much like how cvs alias modules with !
> entries would work, although it only works on the initial checkout ...
> (I tried it. It was a halfway success)
>
> I don't really understand why people thinks this is so unusual. It would
> be
> great to manage code that is tightly assembled in one dimension and
> loosely
> in a second. Exclude the loose parts which don't apply.
> Now those checkouts with excluded subdirs aren't primarily for
> development,
> but for on site installation, with a possibility to commit if needed. I
> don't
> think it is so odd.
>
>> Personally I simply wouldn't put those directories under revision
>> control if they are different for each client. Maybe try a structure
>> like this.
>>
>> / -- trunk/
>> [ ... lengthy dirtree example ... ]
>>
>
> If exclusion was extremely important, I would go that way yes.
> This time it is more like a conveniency desire.
>
> Ah, I feel embarrased. You don't need to waste your time on this. Just
> know
> that there is a partly useful little feature in CVS (alias modules with
> subdir exclusion) that subversion doesn't have (yet).
>
> I am satisfied with the replies so far. I am not willing to wrestle with
> the
> system to get it working because it is not THAT important. I was looking
> for
> a simple method. There isn't one, so I leave my wish unfulfilled.
I agree, subversion needs to grow more features in this area.
A rough approximation to this could be crafted using svn:externals, but that
would get messy.
There is one other approach which might satisfy you, if you are already
using http:// access to the repository.
If you were to set up multiple user ids (one per customer), and use
mod_authz_svn to only grant read access for files that the relevant
customer's site needs, then any files to which access is denied should be
totally ignored. It's not a very elegant solution: you effectively need
seperate svn users for each module - but it would achieve the exclusions you
want. I leave you to decide whether it is worth the effort.
Max.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Re: Excluding directories on a sticky basis
Posted by Jonas Widarsson <jo...@widarsson.com>.
On Tuesday 04 January 2005 20:54, Christopher Ness wrote:
> On Tue, 2005-04-01 at 20:36 +0100, Jonas Widarsson wrote:
> > However, you speak of the commit procedure, and I want to filter
> > checkouts.
>
> Simply make the directories you do not want to check out unreadable by
> all users. If you can't read the directory - you can't check it out.
Now, that sounds odd...
>
> Not sure why you'd want to do that... but it's your call.
I don't. I wan't to define different exclusions for different sites, ie:
site1 - exclude modules/app2, themes/app2
site2 - exclude modules/app1, themes/app1
Although on my laptop I check them both out with "site", which has no
exclusions defined. That's pretty much like how cvs alias modules with !
entries would work, although it only works on the initial checkout ...
(I tried it. It was a halfway success)
I don't really understand why people thinks this is so unusual. It would be
great to manage code that is tightly assembled in one dimension and loosely
in a second. Exclude the loose parts which don't apply.
Now those checkouts with excluded subdirs aren't primarily for development,
but for on site installation, with a possibility to commit if needed. I don't
think it is so odd.
> Personally I simply wouldn't put those directories under revision
> control if they are different for each client. Maybe try a structure
> like this.
>
> / -- trunk/
> [ ... lengthy dirtree example ... ]
>
If exclusion was extremely important, I would go that way yes.
This time it is more like a conveniency desire.
Ah, I feel embarrased. You don't need to waste your time on this. Just know
that there is a partly useful little feature in CVS (alias modules with
subdir exclusion) that subversion doesn't have (yet).
I am satisfied with the replies so far. I am not willing to wrestle with the
system to get it working because it is not THAT important. I was looking for
a simple method. There isn't one, so I leave my wish unfulfilled.
Thanks for your time.
--
Jonas Widarsson
tel: +46 271 152 00 - tel: +46 271 121 42 (hemma/home) - gsm: +46 70 539 64 79
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Re: Excluding directories on a sticky basis
Posted by Christopher Ness <ch...@nesser.org>.
On Tue, 2005-04-01 at 20:36 +0100, Jonas Widarsson wrote:
> However, you speak of the commit procedure, and I want to filter checkouts.
Simply make the directories you do not want to check out unreadable by
all users. If you can't read the directory - you can't check it out.
Not sure why you'd want to do that... but it's your call.
> What a pity there is no post-checkout...
>
> Maybe I have to leave this unusual idea. Anytime I mention this people say
> "Why would you what to do that". I guess it is an odd request.
Personally I simply wouldn't put those directories under revision
control if they are different for each client. Maybe try a structure
like this.
/ -- trunk/
|- src/
|- include/
|- etc/
|- ...
|- branches/
|- bugfix0/
|- feature0/
|- ...
|- tags/
|- 1.0/
|- 1.1/
|- 2.0/
|- ...
|- skins/
|- GenericSkin1/
|- GenericSkin2/
|- ....
|- clients/
|- Client1/
|- ClientCustomSkin/
|- strings/
|- otherClientData/
|- Client2/
|- ...
|- ...
|- ...
HTH's
Chris
--
Software Engineering IV,
McMaster University
PGP Public Key: http://www.nesser.org/pgp-key/
14:44:26 up 1 day, 16:28, 2 users, load average: 0.19, 0.42, 0.39
http://www.fsf.org/philosophy/no-word-attachments.html
Re: Excluding directories on a sticky basis
Posted by Jonas Widarsson <jo...@widarsson.com>.
Thankyou!
I didn't discover that possibilty myself.
However, you speak of the commit procedure, and I want to filter checkouts.
The chapter you provided a link to says :
"Currently there are five hooks implemented by the Subversion repository"
These are:
start-commit
pre-commit
post-commit
pre-revprop-change
post-revprop-change
What a pity there is no post-checkout...
Maybe I have to leave this unusual idea. Anytime I mention this people say
"Why would you what to do that". I guess it is an odd request.
Thanks anyway.
/Jonas
On Tuesday 04 January 2005 19:57, Christopher Ness wrote:
> On Tue, 2005-04-01 at 02:43 +0100, Jonas Widarsson wrote:
> > Is this possible?
>
> Try a pre-commit script to reject commits with whatever "sticky dirs"
> you do not want to commit.
>
> This is not optimal since the entire commit is rejected and forces the
> developer to figure out why it was rejected (a good pre-commit script
> would write the reason to STDERR).
>
> Here is a simple example that rejects commits to any repository URL with
> the word tag in it. YMMV based on how well you can write programs to
> verify transactions.
>
> #########################################################
> # Make sure that the log message contains some text.
> SVNLOOK=/usr/local/bin/svnlook
>
> # Don't allow commits to anything in the "tag" directory
> ${SVNLOOK} changed -t $2 $1 | grep "^U\W*tag" > /dev/null && /bin/echo
> "Cannot commit to tag directory
> Try /trunk or /branch!" 1>&2 && exit 1
>
> # All checks passed, so allow the commit.
> exit 0
> #########################################################
>
> More info here:
> http://svnbook.red-bean.com/en/1.0/ch05s02.html#svn-ch-5-sect-2.1
>
> Cheers,
> Chris
--
Jonas Widarsson
tel: +46 271 152 00 - tel: +46 271 121 42 (hemma/home) - gsm: +46 70 539 64 79
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Re: Excluding directories on a sticky basis
Posted by Christopher Ness <ch...@nesser.org>.
On Tue, 2005-04-01 at 02:43 +0100, Jonas Widarsson wrote:
> Is this possible?
Try a pre-commit script to reject commits with whatever "sticky dirs"
you do not want to commit.
This is not optimal since the entire commit is rejected and forces the
developer to figure out why it was rejected (a good pre-commit script
would write the reason to STDERR).
Here is a simple example that rejects commits to any repository URL with
the word tag in it. YMMV based on how well you can write programs to
verify transactions.
#########################################################
# Make sure that the log message contains some text.
SVNLOOK=/usr/local/bin/svnlook
# Don't allow commits to anything in the "tag" directory
${SVNLOOK} changed -t $2 $1 | grep "^U\W*tag" > /dev/null && /bin/echo
"Cannot commit to tag directory
Try /trunk or /branch!" 1>&2 && exit 1
# All checks passed, so allow the commit.
exit 0
#########################################################
More info here:
http://svnbook.red-bean.com/en/1.0/ch05s02.html#svn-ch-5-sect-2.1
Cheers,
Chris
--
Software Engineering IV,
McMaster University
PGP Public Key: http://www.nesser.org/pgp-key/
13:48:49 up 1 day, 15:32, 1 user, load average: 0.12, 0.15, 0.15
http://www.fsf.org/philosophy/no-word-attachments.html
Re: Excluding directories on a sticky basis
Posted by Jonas Widarsson <jo...@widarsson.com>.
Is this possible?
On Sunday 02 January 2005 23:13, jonas@widarsson.com wrote:
> Hello.
> This is my first message to this list.
>
> Please see this short (3 posts) thread at the php community:
> http://forums.devnetwork.net/viewtopic.php?p=145846#145846
>
> I am leaving CVS in favour of subversion because of the copy and move
> abilities on files and directories subversion has.
>
> But this message is a request for tips on how to stickily disallow a subdir
> of a workdir to be included in the operations svn performs. By stickily I
> mean that I want to define this restriction to the workdir and leave it
> that way thereafter. The thread linked to above provides an example that
> was a halfway success using a CVS alias module with "!" exclusion entries.
> It works on the first checkout, but as soon as next update is performed,
> that exclusion I set is not consulted. The effort is wasted.
>
> I have not started using subversion for serious work yet, but I have read
> the almost all of the "book" online today and yesterday. The book mentions
> externals which include subdirs foreign to the current repository into the
> workdir. this would have sufficed for me in an inverted sense (I mean that
> I could split my project into small parts and link them in with externals),
> but the manual says very clearly that svn will NOT recurse into subdirs
> that represent an external - which breaks the behaivour I am looking for.
>
> Please read the short thread linked to above and give me a comment on how I
> should best use subversion to accomplish this.
--
Jonas Widarsson
tel: +46 271 152 00 - tel: +46 271 121 42 (hemma/home) - gsm: +46 70 539 64 79
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org