You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Beatriz Stratton <be...@telus.net> on 2008/05/02 23:06:32 UTC

keyword expansion for MS Office files

Hello,

My client is interested in using Subversion for versioning documents such as
MS Office files. They would like keyword substitution on these files for
things like Revision number and date.

I just tested this with a Word document and it seems to work fine. I used
fixed length keywords to avoid corrupting the file and Subversion did a fine
job. I tried the keywords both on the actual document and in the file
properties area (using custom properties).

So my question is: is this feature safe on non-text files such as MS Office
files? Or will I get into trouble and corrupt files? Has anyone implemented
this successfully?

Thanks in advance,

Beatriz.


Beatriz Stratton
-----------------------
Senior Principal
B. Stratton Consulting
3860 Haro Road
Victoria, BC Canada
V8N 4A5
phone: (250) 477-1487
fax: (250) 477-1487
cell: (250) 208-5539
www.bstratton.com



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: keyword expansion for MS Office files

Posted by Ryan Bloom <rb...@gmail.com>.
This feature can most likely not be implemented reliably in MS Office
binary formats.  The issue is the actual office format itself.
Basically, Office doesn't store all of the text in one place, so it is
possible for a single string to be split with binary formatting
content.  In most simple tests, this won't happen, but in files that
are actually edited, it can and will at some time.  I have seen
strings in Office files that were split into two different substrings
with the exact same formatting.  This happens when formatting is
accidentally applied to a portion of the string, and then it is
removed.

So, the easy answer is that in your tests, this will work, but it
won't ever be reliable unless svn grows to learn the office formats
(which shouldn't happen).

Putting the keywords into Office properties might be a different story.

Ryan

On Sat, May 3, 2008 at 5:09 PM, Henrik Sundberg <st...@gmail.com> wrote:
> 2008/5/3 Joshua Kramer <jo...@globalherald.net>:
>
> >
>  >> Do you mean OOXML? In that case I think you are wrong. Both OOXML and
>  >> ODF store zipped XML. The substitution will not work in zip-archives.
>  >> I think it would be a great feature to allow key substitution in
>  >> zip-archives with .od* extension.
>  >
>  > Hello,
>  >
>  > It's worth mentioning the odf-svn project.  This project stores ODF files in
>  > Subversion the "right" way, i.e. unzipping them and storing the resulting
>  > XML files.  You may be able to hack this to add the $Revision keyword...
>  >
>  > http://sourceforge.net/projects/odfsvn/
>
>  But it's done the wrong way, IMO. It's not compatible with any other
>  client than the odfsvn client.
>  By giving subversion a way to automatically keep some archives in
>  uncompressed form in the repository, it should be possible to use svn
>  keywords in more cases.
>
>  The OP was about binary word documents, but fixing the problem for
>  zipped xml-documents would be good for the future.
>  /$
>
>
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
>  For additional commands, e-mail: users-help@subversion.tigris.org
>
>



-- 
Ryan Bloom
rbb@apache.org
rbb@rkbloom.net
rbloom@gmail.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: keyword expansion for MS Office files

Posted by Henrik Sundberg <st...@gmail.com>.
2008/5/3 Joshua Kramer <jo...@globalherald.net>:
>
>> Do you mean OOXML? In that case I think you are wrong. Both OOXML and
>> ODF store zipped XML. The substitution will not work in zip-archives.
>> I think it would be a great feature to allow key substitution in
>> zip-archives with .od* extension.
>
> Hello,
>
> It's worth mentioning the odf-svn project.  This project stores ODF files in
> Subversion the "right" way, i.e. unzipping them and storing the resulting
> XML files.  You may be able to hack this to add the $Revision keyword...
>
> http://sourceforge.net/projects/odfsvn/

But it's done the wrong way, IMO. It's not compatible with any other
client than the odfsvn client.
By giving subversion a way to automatically keep some archives in
uncompressed form in the repository, it should be possible to use svn
keywords in more cases.

The OP was about binary word documents, but fixing the problem for
zipped xml-documents would be good for the future.
/$

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: keyword expansion for MS Office files

Posted by Joshua Kramer <jo...@globalherald.net>.
> Do you mean OOXML? In that case I think you are wrong. Both OOXML and
> ODF store zipped XML. The substitution will not work in zip-archives.
> I think it would be a great feature to allow key substitution in
> zip-archives with .od* extension.

Hello,

It's worth mentioning the odf-svn project.  This project stores ODF files 
in Subversion the "right" way, i.e. unzipping them and storing the 
resulting XML files.  You may be able to hack this to add the $Revision 
keyword...

http://sourceforge.net/projects/odfsvn/

Cheers,
-J


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: keyword expansion for MS Office files

Posted by Henrik Sundberg <st...@gmail.com>.
2008/5/3 Ryan Schmidt <su...@ryandesign.com>:
> On May 2, 2008, at 7:39 PM, Oren Eini (Murphy & Associates) wrote:
>
>>> My client is interested in using Subversion for versioning documents such
>>> as
>>> MS Office files. They would like keyword substitution on these files for
>>> things like Revision number and date.
>>>
>>> I just tested this with a Word document and it seems to work fine. I used
>>> fixed length keywords to avoid corrupting the file and Subversion did a
>>> fine
>>> job. I tried the keywords both on the actual document and in the file
>>> properties area (using custom properties).
>>>
>>> So my question is: is this feature safe on non-text files such as MS
>>> Office
>>> files? Or will I get into trouble and corrupt files? Has anyone
>>> implemented
>>> this successfully?
>>
>> If you would use that on the text versions (MS Office has XML versions),
>> that should be safe.

Do you mean OOXML? In that case I think you are wrong. Both OOXML and
ODF store zipped XML. The substitution will not work in zip-archives.
I think it would be a great feature to allow key substitution in
zip-archives with .od* extension.

> If we believe that it's unlikely that a string like "$Revision::        $"
> would otherwise appear in Word's binary format, then it's ok to use in Word
> binary files too. I believe the fixed-width keywords were created exactly so
> that they could be used in binary formats like (binary) Word.

Since Microsoft keep changing their binary formats, I don't like to
rely on the formats keeping strings as is.

/$

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: keyword expansion for MS Office files

Posted by Ryan Schmidt <su...@ryandesign.com>.
On May 2, 2008, at 7:39 PM, Oren Eini (Murphy & Associates) wrote:

>> My client is interested in using Subversion for versioning  
>> documents such as
>> MS Office files. They would like keyword substitution on these  
>> files for
>> things like Revision number and date.
>>
>> I just tested this with a Word document and it seems to work fine.  
>> I used
>> fixed length keywords to avoid corrupting the file and Subversion  
>> did a fine
>> job. I tried the keywords both on the actual document and in the file
>> properties area (using custom properties).
>>
>> So my question is: is this feature safe on non-text files such as  
>> MS Office
>> files? Or will I get into trouble and corrupt files? Has anyone  
>> implemented
>> this successfully?
>
> If you would use that on the text versions (MS Office has XML  
> versions), that should be safe.

If we believe that it's unlikely that a string like  
"$Revision::        $" would otherwise appear in Word's binary  
format, then it's ok to use in Word binary files too. I believe the  
fixed-width keywords were created exactly so that they could be used  
in binary formats like (binary) Word.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

RE: keyword expansion for MS Office files

Posted by "Oren Eini (Murphy & Associates)" <v-...@microsoft.com>.
If you would use that on the text versions (MS Office has XML versions), that should be safe.

-----Original Message-----
From: Beatriz Stratton [mailto:beatriz.stratton@telus.net]
Sent: Friday, May 02, 2008 4:07 PM
To: users@subversion
Subject: keyword expansion for MS Office files

Hello,

My client is interested in using Subversion for versioning documents such as
MS Office files. They would like keyword substitution on these files for
things like Revision number and date.

I just tested this with a Word document and it seems to work fine. I used
fixed length keywords to avoid corrupting the file and Subversion did a fine
job. I tried the keywords both on the actual document and in the file
properties area (using custom properties).

So my question is: is this feature safe on non-text files such as MS Office
files? Or will I get into trouble and corrupt files? Has anyone implemented
this successfully?

Thanks in advance,

Beatriz.


Beatriz Stratton
-----------------------
Senior Principal
B. Stratton Consulting
3860 Haro Road
Victoria, BC Canada
V8N 4A5
phone: (250) 477-1487
fax: (250) 477-1487
cell: (250) 208-5539
www.bstratton.com



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org