Login | Register
My pages Projects Community openCollabNet

Discussions > users > Re: /etc/fsvs is modified only after the changes have been committed

fsvs
Discussion topic

Hide all messages in topic

All messages in topic

RE: /etc/fsvs is modified only after the changes have been committed

Author manolson
Full name Auriel Manolson
Date 2009-04-16 16:18:20 PDT
Message Regarding any other ideas:

Here is a very pragmatic "SOLUTION"
(no claim to be elegant ; -)


mkdir /etc/fsvs_commit_copy
fsvs unversion /etc/fsvs
fsvs ignore /etc/fsvs

add to the beginning of your cron job (before doing your fsvs commit) something like this

rsync -a /etc/fsvs/* /etc/fsvs_commit_copy/
rm -f /etc/fsvs_copy/*/Urls


This auto keeps your Ign but not your Urls under version control, and somebody savi of this work-around could of course do a manual


rsync -a /etc/fsvs/* /etc/fsvs_commit_copy/
fsvs commit

to add the Urls if they change things

your thoughts ?

Re: /etc/fsvs is modified only after the changes have been committed

Author griffon26
Full name Maurice van der Pot
Date 2008-10-22 10:13:22 PDT
Message On Wed, Oct 22, 2008 at 07:11:40PM +0200, Philipp Marek wrote:
> > This together with not deleting and recreating those files should make
> > it possible to not have any left-over changes after a commit.
> Well, only *after* the commit we know the revision we got - so the
> new "current" revision is available only when the new version is done, so
> there are uncommitted changes ;-/

Sure, what I meant was no uncommitted changes that you shouldn't add to the
ignore list.

Maurice.

--
Maurice van der Pot

Gentoo Linux Developer griffon26 at gentoo dot org http://www.gentoo.org
Gnome Planner Developer griffon26 at kfk4ever dot com http://live.gnome.org/Planner
Attachments

Re: /etc/fsvs is modified only after the changes have been committed

Author pmarek
Full name P.Marek
Date 2008-10-22 10:11:40 PDT
Message On Wednesday 22 October 2008 Maurice van der Pot wrote:
> On Tue, Oct 21, 2008 at 10:51:58AM +0200, Philipp Marek wrote:
> > I grant you that for a single URL (which will mostly be at HEAD) it's not
> > such an important point - but if you use some 50 URLs at varying
> > revisions, you'll be grateful if you can later see what you had 3 weeks
> > ago, "when it still worked" ...
>
> How about having two Urls files. One that gets committed and one that
> can be ignored. The latter would be updated to the new revision after a
> commit and its contents would be transferred to the former just before
> every commit.
That sounds like an idea .... I'll think about that.

> This together with not deleting and recreating those files should make
> it possible to not have any left-over changes after a commit.
Well, only *after* the commit we know the revision we got - so the
new "current" revision is available only when the new version is done, so
there are uncommitted changes ;-/


Regards,

Phil


--
Versioning your /etc, /home or even your whole installation?
             Try fsvs (fsvs.tigris.org)!

Re: /etc/fsvs is modified only after the changes have been committed

Author griffon26
Full name Maurice van der Pot
Date 2008-10-22 09:36:52 PDT
Message On Tue, Oct 21, 2008 at 10:51:58AM +0200, Philipp Marek wrote:
> I grant you that for a single URL (which will mostly be at HEAD) it's not such an
> important point - but if you use some 50 URLs at varying revisions, you'll be grateful
> if you can later see what you had 3 weeks ago, "when it still worked" ...

How about having two Urls files. One that gets committed and one that
can be ignored. The latter would be updated to the new revision after a
commit and its contents would be transferred to the former just before
every commit.

This together with not deleting and recreating those files should make
it possible to not have any left-over changes after a commit.

Maurice.

--
Maurice van der Pot

Gentoo Linux Developer griffon26 at gentoo dot org http://www.gentoo.org
Gnome Planner Developer griffon26 at kfk4ever dot com http://live.gnome.org/Planner
Attachments

Re: /etc/fsvs is modified only after the changes have been committed

Author pmarek
Full name P.Marek
Date 2008-10-22 09:25:07 PDT
Message Hello Pieter, hello Farzad,

On Wednesday 22 October 2008 Pieter Ennes wrote:
> > Actually, versionning "/etc" is a special use case. I'm going to use FSVS
> > to version other application directories, and therefore in this case the
> > FSVS meta-information is not versionned, right?
You're right, your ignore patterns wouldn't be taken.

> > Well, /etc/fsvs/*/{Urls,Ign,...} will be versionned anyway because I will
> > also commit "/etc", but we're talking about 2 distinct working copies
> > here :)
If you keep that versioned somewhere else, you have some way to retrieve the
data.

> Indeed, I agree that these two cases should ideally be handled in the
> same way... so (forgive me if I'm wrong here), is it true that we have
> two types of data?
>
> 1) The ignore lists and similar
> You'd probably almost always want this to be in the repository (even
> when not versioning /etc but some other directory)? Can it be stored in
> a svn property or special file?
I specifically *didn't* use a property - because the ignore list can be very
long, and even if it was possible where should I store it?
Someone has a repository of /etc, but wants to use the /etc/init.d on another
machine, too - so I can't use a specific place.
I'd have to put the patterns in *each* directory - and that's ugly, because
wildcard matches (like ./**.tmp) would have to be repeated.

> 2) The working copy 'state', url, revisions
> As long as you have a working system I can't think of any reason yet
> that this could not go into /var and also be completely ignored in the
> commits. Is the reason we'd want to commit this so that you can restore
> onto a clean system? Or am I not seeing it correctly?
There *is* a /var/spool/fsvs, and it's used for manber hashes/MD5, entry list
and similar things.

But the URL list isn't discardable, I think.
(At least not for non-trivial cases like a single URL at HEAD - and even then
it's nice to get that back).


Regards,

Phil


--
Versioning your /etc, /home or even your whole installation?
             Try fsvs (fsvs.tigris.org)!

Re: /etc/fsvs is modified only after the changes have been committed

Author Pieter Ennes <lists at spam dot ennes dot net>
Full name Pieter Ennes <lists at spam dot ennes dot net>
Date 2008-10-22 01:36:32 PDT
Message Hi all,

Farzad FARID wrote:
> Hi,
>
> On Tuesday 21 October 2008 10:51:58 Philipp Marek wrote:
>>> But why should the state of the 'current revision' go in /etc as well?
>> Because in /etc it will be versioned - and that's good, because to restore
>> a machine to *exactly* the state it was in you'll need the information
>> which URL*s* you had at which revision.
>>
>
> Actually, versionning "/etc" is a special use case. I'm going to use FSVS to
> version other application directories, and therefore in this case the FSVS
> meta-information is not versionned, right?
>
> Well, /etc/fsvs/*/{Urls,Ign,...} will be versionned anyway because I will also
> commit "/etc", but we're talking about 2 distinct working copies here :)

Indeed, I agree that these two cases should ideally be handled in the
same way... so (forgive me if I'm wrong here), is it true that we have
two types of data?

1) The ignore lists and similar
You'd probably almost always want this to be in the repository (even
when not versioning /etc but some other directory)? Can it be stored in
a svn property or special file?

2) The working copy 'state', url, revisions
As long as you have a working system I can't think of any reason yet
that this could not go into /var and also be completely ignored in the
commits. Is the reason we'd want to commit this so that you can restore
onto a clean system? Or am I not seeing it correctly?

Bye,
--
 - Pieter

Re: /etc/fsvs is modified only after the changes have been committed

Author farzy
Full name Farzad FARID
Date 2008-10-22 01:22:10 PDT
Message Hi,

On Tuesday 21 October 2008 10:51:58 Philipp Marek wrote:
>
> > But why should the state of the 'current revision' go in /etc as well?
>
> Because in /etc it will be versioned - and that's good, because to restore
> a machine to *exactly* the state it was in you'll need the information
> which URL*s* you had at which revision.
>

Actually, versionning "/etc" is a special use case. I'm going to use FSVS to
version other application directories, and therefore in this case the FSVS
meta-information is not versionned, right?

Well, /etc/fsvs/*/{Urls,Ign,...} will be versionned anyway because I will also
commit "/etc", but we're talking about 2 distinct working copies here :)

Regards,

--
Farzad FARID / Architecte Open Source - Associé
Pragmatic Source / http://www.pragmatic-source.com
Tel : +33 9 53 19 21 90 / Mob : +33 6 03 70 65 46

Re: /etc/fsvs is modified only after the changes have been committed

Author pmarek
Full name P.Marek
Date 2008-10-21 23:49:38 PDT
Message Hello everyone!

Here's another idea: how about having some exclude option (eg. "-x") for status and
commit, that takes paths/patterns as arguments, and causes the specified entries *not*
to be checked for changes? They won't be seen as changed, so won't get committed.

By using the empty_commit option that should work for cron, shouldn't it?

   fsvs ci -mcron -o empty_commit=no -x "/etc/fsvs/*/Urls" -x "/etc/fsvs/*"

Hmmm ... but then there should be some way to re-include parts, and specify
recursive/non-recursive - to say "take the Ign file, but not the directory nor the Urls"
...

Other thoughts?


--
Versioning your /etc, /home or even your whole installation?
             Try fsvs (fsvs.tigris.org)!

Re: /etc/fsvs is modified only after the changes have been committed

Author pmarek
Full name P.Marek
Date 2008-10-21 01:51:58 PDT
Message Hello Pieter!

>>> Is there an elegant solution to my problem, apart from ignoring
>>> "/etc/fsvs", which is a solution I don't really like?
>
>> Not yet. And if you ignored the whole directory, you wouldn't have the ignore
>> patterns versioned anymore.
>
> Ok, I agree that ignore patterns should go in /etc. But...
...
> But why should the state of the 'current revision' go in /etc as well?
>
> Referring to the the FHS[*] this may not be the best (or at least an
> unusual) location for it. FHS mentions that files in /etc should be
> 'configuration files' and also be 'static'. At the same time it suggests
> /var for "spool directories and files, administrative and logging data,
> and transient and temporary files".
>
> I was wondering whether we could realise this split for fsvs too. If so,
> my first hunch would be that this will solve the discussed problem as a
> bonus since, indeed, /etc will only contain static files.
FSVS already uses /var/spool/fsvs for spool files - eg and the *list* of entries (that
is mostly a cache of the repository data at revision N) is already there.

> But why should the state of the 'current revision' go in /etc as well?
Because in /etc it will be versioned - and that's good, because to restore a machine to
*exactly* the state it was in you'll need the information which URL*s* you had at which
revision.

I grant you that for a single URL (which will mostly be at HEAD) it's not such an
important point - but if you use some 50 URLs at varying revisions, you'll be grateful
if you can later see what you had 3 weeks ago, "when it still worked" ...


But I won't forgot your suggestion; it's duly noted :-)


Regards,

Phil

--
Versioning your /etc, /home or even your whole installation?
             Try fsvs (fsvs.tigris.org)!

Re: /etc/fsvs is modified only after the changes have been committed

Author Pieter Ennes <lists at spam dot ennes dot net>
Full name Pieter Ennes <lists at spam dot ennes dot net>
Date 2008-10-20 14:10:39 PDT
Message Hello Philipp, and list,

I just subscribed last week, and ran into the same thing. Please see
below...

Philipp Marek wrote:
> Hello Farzad!
>
> On Monday 13 October 2008 Farzad FARID wrote:
>> I'm having the following issue with FSFS 1.1.16 and the "/etc" directory
>> I'm versionning: apparently, the "/etc/fsvs/xxxxxxx/Urls" file is modified
>> *after* the "fsvs commit" command has finished.
> Yes, this is per design.
>
>> As a result, there are always 2 uncommitted change in my "/etc" folder ;)
> ...
>> I'm a bit embarrassed, because I wanted to use a cron script to check for
>> uncommitted changes, but 'fsvs commit -o empty_commit=no -m "cron" /etc',
>> as specified in the fsvs-options manpage, would commit this same change
>> over and over :)
>>
>> Is there an elegant solution to my problem, apart from ignoring
>> "/etc/fsvs", which is a solution I don't really like?

> Not yet. And if you ignored the whole directory, you wouldn't have the ignore
> patterns versioned anymore.

Ok, I agree that ignore patterns should go in /etc. But...


> There are two ways for that problem:
> - Just ignore the "Urls" files ("/etc/fsvs/*/Urls")
> - Have some other idea :-)
>
> I briefly thought whether it would be good to have an option to ignore
> the "Urls" file (like the WAA is ignored automatically), perhaps on "status"
> only ...
>
> That would be another special case in the code ... but maybe the only way,
> especially for the "stop_change" case ... maybe just implement that there?

> Do you have any other ideas?
>

But why should the state of the 'current revision' go in /etc as well?

Referring to the the FHS[*] this may not be the best (or at least an
unusual) location for it. FHS mentions that files in /etc should be
'configuration files' and also be 'static'. At the same time it suggests
/var for "spool directories and files, administrative and logging data,
and transient and temporary files".

I was wondering whether we could realise this split for fsvs too. If so,
my first hunch would be that this will solve the discussed problem as a
bonus since, indeed, /etc will only contain static files.

> Do you know C, and would like to send a patch?

Not well enough unfortunately :)


[*] http://www.pathname.​com/fhs/pub/fhs-2.3.​html


Best regards,
--
 - Pieter

Re: /etc/fsvs is modified only after the changes have been committed

Author pmarek
Full name P.Marek
Date 2008-10-13 11:04:19 PDT
Message On Monday 13 October 2008 Maurice van der Pot wrote:
> On Mon, Oct 13, 2008 at 05:12:21PM +0200, Philipp Marek wrote:
> > > apparently, the "/etc/fsvs/xxxxxxx/Urls" file is modified
> > > *after* the "fsvs commit" command has finished.
> >
> > Yes, this is per design.
>
> Could you elaborate on this?
FSVS cannot store more than a single revision number (per URL) - there are no
mixed working copies (as yet).

When FSVS can store the revision number(s) for each entry separately (as I've
got on my TODO), it might be possible to drop that; but I'm not yet sure.

Part of the problem is that FSVS has to tell the repository (on update) which
entry is at which revision, so that it can get the changed entries.

If a working copy tree has to be completely traversed, so that FSVS knows what
the base revision is [*] -- and that for each URL you want to update! -- it
might be a problem.

* Simply giving the repository a list of (entry, rev#) doesn't work really -
for 200k entries the list is a bit big, and I think that would affect the
communication negatively.

As long as there's mostly a single revision, perhaps with a few entries
somewhere else, the report is small enough.

> A possible solution for this guy's (and my) problem would be not to
> rewrite Urls for each commit. It hasn't changed after all, so why should
> it be overwritten?
But is has changed ... the WC is at another revision of the URL.

And keeping that out of a commit, eg. by using a separate file in WAA (like
the entry list), doesn't help - we want to know "which mix of URLs at which
revisions was the machine 13 months ago", so that it can be completely
restored.


Regards,

Phil


--
Versioning your /etc, /home or even your whole installation?
             Try fsvs (fsvs.tigris.org)!

Re: /etc/fsvs is modified only after the changes have been committed

Author griffon26
Full name Maurice van der Pot
Date 2008-10-13 10:21:58 PDT
Message On Mon, Oct 13, 2008 at 05:12:21PM +0200, Philipp Marek wrote:
> > apparently, the "/etc/fsvs/xxxxxxx/Urls" file is modified
> > *after* the "fsvs commit" command has finished.
> Yes, this is per design.

Could you elaborate on this?

A possible solution for this guy's (and my) problem would be not to
rewrite Urls for each commit. It hasn't changed after all, so why should
it be overwritten?

Regards,
Maurice.

--
Maurice van der Pot

Gentoo Linux Developer griffon26 at gentoo dot org http://www.gentoo.org
Gnome Planner Developer griffon26 at kfk4ever dot com http://live.gnome.org/Planner
Attachments

Re: /etc/fsvs is modified only after the changes have been committed

Author pmarek
Full name P.Marek
Date 2008-10-13 08:59:55 PDT
Message On Monday 13 October 2008 Farzad FARID wrote:
> OK it works only partially, because the mtime of the "/etc/fsvs" changes
> anyway, which leaves me with still one uncommitted change.. Thinking of it,
> this is strange, because there is one level of directory between
> "/etc/fsvs" and "Urls". I can't find why the mtime of this directory
> changes.
That's because the temporary "Urls" file is created there, and then moved to
its destionation.
Could/should be changed, perhaps.

I did that so that there'd be a limited number of places where temporary files
could be lying around, mostly for the WAA.

> > - Have some other idea :-)
> I'll think about it :)
Yes, please.

> > I briefly thought whether it would be good to have an option to ignore
> > the "Urls" file (like the WAA is ignored automatically), perhaps on
> > "status" only ...
> >
> > That would be another special case in the code ... but maybe the only
> > way, especially for the "stop_change" case ... maybe just implement that
> > there?
> If you ignore the Urls file on "status" only, then wouldn't 'fsvs commit -o
> empty_commit=no -m "cron" /etc' continue to commit the Urls file? It's not
> an error by itself, but the behaviour would seem incoherent to me.
I'd ignore only this file on status with stop_change set - so that exactly
your "if" in the shell wouldn't trigger.

It should be committed, I think - so that you can see which URLs you were
using, at which revisions. That might be necessary to rebuild the machine
exactly as it was.

> > Do you know C, and would like to send a patch?
>
> I think I'm too rusty with C coding to be of any help ;) But I'll have a
> look at the source code one of theses days anyway.
Fine - patches are welcome, even if it's just for typing mistakes.


Regards,

Phil


--
Versioning your /etc, /home or even your whole installation?
             Try fsvs (fsvs.tigris.org)!

Re: /etc/fsvs is modified only after the changes have been committed

Author farzy
Full name Farzad FARID
Date 2008-10-13 08:48:39 PDT
Message On Monday 13 October 2008 17:12:21 Philipp Marek wrote:
> >
> > Is there an elegant solution to my problem, apart from ignoring
> > "/etc/fsvs", which is a solution I don't really like?
>
> Not yet. And if you ignored the whole directory, you wouldn't have the
> ignore patterns versioned anymore.
>
> There are two ways for that problem:
> - Just ignore the "Urls" files ("/etc/fsvs/*/Urls")

OK it works only partially, because the mtime of the "/etc/fsvs" changes
anyway, which leaves me with still one uncommitted change.. Thinking of it,
this is strange, because there is one level of directory between "/etc/fsvs"
and "Urls". I can't find why the mtime of this directory changes.

> - Have some other idea :-)

I'll think about it :)

> I briefly thought whether it would be good to have an option to ignore
> the "Urls" file (like the WAA is ignored automatically), perhaps on
> "status" only ...
>
> That would be another special case in the code ... but maybe the only way,
> especially for the "stop_change" case ... maybe just implement that there?

If you ignore the Urls file on "status" only, then wouldn't 'fsvs commit -o
empty_commit=no -m "cron" /etc' continue to commit the Urls file? It's not an
error by itself, but the behaviour would seem incoherent to me.

> Do you know C, and would like to send a patch?

I think I'm too rusty with C coding to be of any help ;) But I'll have a look
at the source code one of theses days anyway.

 Regards,

--
Farzad FARID / Architecte Open Source - Associé
Pragmatic Source / http://www.pragmatic-source.com
Tel : +33 9 53 19 21 90 / Mob : +33 6 03 70 65 46

Re: /etc/fsvs is modified only after the changes have been committed

Author pmarek
Full name P.Marek
Date 2008-10-13 08:28:48 PDT
Message Another problem ...

On Monday 13 October 2008 Philipp Marek wrote:
> On Monday 13 October 2008 Farzad FARID wrote:
> > Is there an elegant solution to my problem, apart from ignoring
> > "/etc/fsvs", which is a solution I don't really like?
...
> I briefly thought whether it would be good to have an option to ignore
> the "Urls" file (like the WAA is ignored automatically), perhaps on
> "status" only ...
>
> That would be another special case in the code ... but maybe the only way,
> especially for the "stop_change" case ... maybe just implement that there?
Another thought that just occurred to me ...
Simply ignoring this' WC Urls file is easy ... but you're might have more than
a single WC on that machine, and then the other's URLs might give the same
problem.

Or maybe not - after all, commits of them won't have the same WC ..


Regards,

Phil


--
Versioning your /etc, /home or even your whole installation?
             Try fsvs (fsvs.tigris.org)!

Re: /etc/fsvs is modified only after the changes have been committed

Author pmarek
Full name P.Marek
Date 2008-10-13 08:12:21 PDT
Message Hello Farzad!

On Monday 13 October 2008 Farzad FARID wrote:
> I'm having the following issue with FSFS 1.1.16 and the "/etc" directory
> I'm versionning: apparently, the "/etc/fsvs/xxxxxxx/Urls" file is modified
> *after* the "fsvs commit" command has finished.
Yes, this is per design.

> As a result, there are always 2 uncommitted change in my "/etc" folder ;)
...
> I'm a bit embarrassed, because I wanted to use a cron script to check for
> uncommitted changes, but 'fsvs commit -o empty_commit=no -m "cron" /etc',
> as specified in the fsvs-options manpage, would commit this same change
> over and over :)
>
> Is there an elegant solution to my problem, apart from ignoring
> "/etc/fsvs", which is a solution I don't really like?
Not yet. And if you ignored the whole directory, you wouldn't have the ignore
patterns versioned anymore.

There are two ways for that problem:
- Just ignore the "Urls" files ("/etc/fsvs/*/Urls")
- Have some other idea :-)

I briefly thought whether it would be good to have an option to ignore
the "Urls" file (like the WAA is ignored automatically), perhaps on "status"
only ...

That would be another special case in the code ... but maybe the only way,
especially for the "stop_change" case ... maybe just implement that there?

Do you have any other ideas?

Do you know C, and would like to send a patch?


Regards,

Phil


--
Versioning your /etc, /home or even your whole installation?
             Try fsvs (fsvs.tigris.org)!

/etc/fsvs is modified only after the changes have been committed

Author farzy
Full name Farzad FARID
Date 2008-10-13 06:21:41 PDT
Message Hi,

I'm having the following issue with FSFS 1.1.16 and the "/etc" directory I'm
versionning: apparently, the "/etc/fsvs/xxxxxxx/Urls" file is modified *after*
the "fsvs commit" command has finished.

As a result, there are always 2 uncommitted change in my "/etc" folder ;) Here
is an example:

[/etc] # fsvs status
.m.? 51 fsvs/182f153bd948039​55c2043e6f2581d5d/Ur​ls
.m.. dir fsvs

[/etc] # fsvs commit -m "Mise à jour automatique conf fsvs"
Committing to file:///usr/local/fs​vs-repository
.m.. dir fsvs
.mC. 51 fsvs/182f153bd948039​55c2043e6f2581d5d/Ur​ls
committed revision 9 on 2008-10-13T09:28:57.786861Z as root

[/etc] # fsvs status
.m.? 51 fsvs/182f153bd948039​55c2043e6f2581d5d/Ur​ls
.m.. dir fsvs

Comparing the old and new "Urls" file, I see that the only change is the last
revision number.

I'm a bit embarrassed, because I wanted to use a cron script to check for
uncommitted changes, but 'fsvs commit -o empty_commit=no -m "cron" /etc', as
specified in the fsvs-options manpage, would commit this same change over and
over :)

Is there an elegant solution to my problem, apart from ignoring "/etc/fsvs",
which is a solution I don't really like?

 Regards,

--
Farzad FARID / Architecte Open Source - Associé
Pragmatic Source / http://www.pragmatic-source.com
Tel : +33 9 53 19 21 90 / Mob : +33 6 03 70 65 46
Messages per page: