Textpattern Forum

You are not logged in. Register | Login | Help

#1 2012-07-03 22:49:58

maniqui
Moderator
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 2,985
Website

remove SVN headers (or include them full) in last commit of release

Problem: (text taken from here, see last question)

Basically, on each TXP official release (distributed on .zip/.tar.gz files), the checksum for each file is calculated including an SVN header with some SVN-related info (HeadURL and LastChangedRevision) for that file.

For example:

/*
$HeadURL: https://textpattern.googlecode.com/svn/releases/4.4.1/source/index.php $
$LastChangedRevision: 3189 $
*/

But you will find that, even if you checkout an official tag/release (like 4.4.1), although this kind of SVN header is present on each file, it doesn’t have the proper info/values. Instead, it looks like this:

/*
$HeadURL$
$LastChangedRevision$
*/

In other words, the SVN header is almost empty, and, in consequence, the file itself is different from the “official” file (bundled on an official, downloadable release) for which the known checksum applies. Thus, you will inevitably get the “Some Textpattern files have been modified” in the Diagnostics tabs.

TL;DR: the official release (the .zip or .tar.gz file) of Textpattern doesn’t match exactly with the corresponding official commit (for TXP 4.4.1, it would be the commit r3576 in the graph below) in the SVN repo. This means ugly red lines in Diagnostics tab.
This mismatch… I think it could and should be avoided.

Proposal:

For those checking-out/testing/running from a stable release on the SVN repo (or better, a Git repo), this is an inconvenience.

I’d like to ask, if possible, for next release, to get this (useless?) SVN headers removed (or at least, included in full) in the release branch.

As an example, looking at the graph below (which corresponds to the release branch of TXP 4.4.1), the revision r3576 should have included the full SVN headers.

* r3577 - dev is on 4.4.1 now. 
| * r3576 - (4.4.1) Checksums for 4.4.1
| * r3576 - This is Textpattern CMS 4.4.1 stable
| * r3574 - Copying the 4.4.1 branch
|/  
* r3572 - Language files for 4.4.1

TL;DR (part 2): could the SVN headers be removed, please?

Thanks for reading.


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#2 2012-07-03 23:27:36

Gocom
Developer
Registered: 2006-07-14
Posts: 4,475
Website

Re: remove SVN headers (or include them full) in last commit of release

While I personally do not like the automatic processing SVN offers, or does, and I do not like tags, Textpattern does use tags correctly and I’m very fine them being there. Textpattern even actually uses those values, and seeing that information in files can be helpful even to some.

maniqui wrote:

But you will find that, even if you checkout an official tag/release (like 4.4.1), although this kind of SVN header is present on each file, it doesn’t have the proper info/values. Instead, it looks like this:

As it should actually. Those things you are seeing are keywords. SVN doesn’t expand keywords on checkout (as designed). So, you see them in their raw form.

If you need a release branch with keywords expanded, you can do so by using svn export command. Thing is, checkout is the wrong command for that.

I’d like to ask, if possible, for next release, to get this (useless?) SVN headers removed (or at least, included in full) in the release branch.

What do you mean by included in full? Keywords are handled by SVN when exporting. They are not committed and shouldn’t be committed with a branch. If you were to do so, at that point you could as well do copies instead of branching.

Anyhow, instead of removing the tags, if there needed to be a fix to the checksum deal, I would just disable checksum checks on SVN/git installs/checkouts. The checksums are valid for only stables anyways.

Since/when you are using SVN/git, the checksum are not even relevant. You can just use the repository to verify the file integrity. Git will wine if it sees something strange, and unlike bundled checksums, the repository verification is secure and safe no matter how the files were touched/modified.

Last edited by Gocom (2012-07-03 23:33:57)


Rah-plugins | What? I’m a little confused… again :-) <txp:is_god />

Offline

#3 2012-07-04 00:15:59

maniqui
Moderator
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 2,985
Website

Re: remove SVN headers (or include them full) in last commit of release

Gocom, I’m an SVN illiterate, thanks for the info.

Textpattern even actually uses those values (…)

Good to know.

Anyhow, instead of removing the tags, if there needed to be a fix to the checksum deal, I would just disable checksum checks on SVN/git installs/checkouts. The checksums are valid for only stables anyways.

I understand.
But then, stable Textpattern 4.4.1 coming from zip/tar.gz is different (include SVN headers) from the corresponding commit for stable Textpattern 4.4.1 (doesn’t include SVN headers). In other words, the only difference are the SVN headers.

Of course, I’m considering that “stable” doesn’t (and shouldn’t) mean “just the one bundlied in the zip/tar.gz package”.
The 4.4.1 version in the SVN repo is equally functional (and equally stable) to the one on the zip/tar.gz package.


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#4 2012-07-04 02:37:12

wet
Developer
From: Lenzing, Austria
Registered: 2005-06-06
Posts: 3,102
Website

Re: remove SVN headers (or include them full) in last commit of release

This is the script we use to build the release archives. You can do the same from every tagged branch.

#!/bin/sh

if [ $# -lt 1 ]; then
        echo 1>&2 Usage: $0 '<version> [svn-repos]'
        exit 127
fi

VER=$1
TMPDIR=`mktemp -d`
REPOS=http://textpattern.googlecode.com/svn/development/4.x/

if [ $# -eq 2 ]; then
        REPOS=$2
fi

svn export $REPOS $TMPDIR/textpattern-$VER
tar cvf - -C $TMPDIR textpattern-$VER | gzip -c > textpattern-$VER.tar.gz
OLDDIR=`pwd`
cd $TMPDIR
zip -r $OLDDIR/textpattern-$VER.zip textpattern-$VER
cd $OLDDIR

Problem solved.

Offline

#5 2012-07-05 11:50:47

maniqui
Moderator
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 2,985
Website

Re: remove SVN headers (or include them full) in last commit of release

I’d have preferred to have the contents of a particular release to be same, without differing if I get them from a zip file or checking them out from a particular tag on a repository.

Anyway, thanks Gocom & wet for your comments.


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#6 2012-07-05 12:22:56

Gocom
Developer
Registered: 2006-07-14
Posts: 4,475
Website

Re: remove SVN headers (or include them full) in last commit of release

maniqui wrote:

I’d have preferred to have the contents of a particular release to be same, without differing if I get them from a zip file or checking them out

You can, with svn export. svn checkout is the wrong tool if that is the purpose. Checking out always gives you a working copy.

Please note you don’t need checkouts for release branches. Branches are final and won’t be updated.

Last edited by Gocom (2012-07-05 12:24:15)


Rah-plugins | What? I’m a little confused… again :-) <txp:is_god />

Offline

#7 2012-07-05 12:39:44

maniqui
Moderator
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 2,985
Website

Re: remove SVN headers (or include them full) in last commit of release

I’m using “checking out” more in a Git-sense: switching/transforming your working directory to match a certain commit/branch/tag. Also, yes, I use tag in the sense that the git mirror (not the official one, but the one I made) uses a tag (eg. “4.4.1”) on the tip of each release branch.

That said, a question that may help explain my not-so-OCD requests:
Which is Textpattern 4.4.1?

r3575. This is Textpattern CMS 4.4.1 stable.. This?

r3576. Checksums for 4.4.1.. Or this one maybe?

r3577. dev is on 4.4.1 now.. Or maybe this one?

textpattern-4.4.1.zip. Or just this one?

I’d love the repo to have at least one commit where the files (at least, for files that are checksummed) match the files on the zip package.
But it’s ok if not possible, I can live without that. I now understand there is a build/deploy process that couldn’t make this possible.

Gocom wrote:

Textpattern even actually uses those values (…)

Back to that, could you shed some light about how TXP uses those values? Maybe for checking for new updates? Or anything more substantial?

Thanks again.

Last edited by maniqui (2012-07-05 12:40:57)


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#8 2012-07-05 13:49:12

Gocom
Developer
Registered: 2006-07-14
Posts: 4,475
Website

Re: remove SVN headers (or include them full) in last commit of release

maniqui wrote:

Which is Textpattern 4.4.1?

http://textpattern.googlecode.com/svn/releases/4.4.1

Is v4.4.1. The last commit to that branch is the exact the source you find from the zip. You get a release by exporting a branch, or local copy of the repository by a checkout.

I’d love the repo to have at least one commit where the files (at least, for files that are checksummed) match the files on the zip package.

Yes the repository contains all the raw source files, and all of those files do match the checksum. I see no messages on my Diagnostics panel at all. You don’t need to do any building or anything like that. You can get v4.4.1 by running:

svn export http://textpattern.googlecode.com/svn/releases/4.4.1/source

Or checkout:

svn checkout http://textpattern.googlecode.com/svn/releases/4.4.1/source

Both give you 100% match. First a source, second a working copy. In export SVN properties are parsed and .svn directories are stripped (as expected if you want the exact copy of the zip).

Since Git isn’t SVN, Git doesn’t handle SVN related features as keywords or other file properties. On git you will lose Textpattern’s branches, keywords and other SVN stuff. These are either stripped out, or you find the raw properties committed to the repository (i.e. keywords).

But it’s ok if not possible, I can live without that. I now understand there is a build/deploy process that couldn’t make this possible.

Can you please explain what build process you are referring to? There is no building involved, other than that Robert generates checksums and commits them to the repository for us. :o I’m seriously confused.

Are we talking about the keywords? The raw keywords are in the git repo since Git isn’t SVN. If Textpattern team uses SVN related features, I’m absolutely fine with that. I do not mind. Anyways, repositories are used to get the source. Both on git and SVN you get the same source when doing a checkout. Git just can’t handle tasks that SVN would. I use the git repo and I’m fine with what it offers.

Back to that, could you shed some light about how TXP uses those values? Maybe for checking for new updates? Or anything more substantial?

Dunno, I’m not Textpattern developer. To me they tell which revision the file is. Can help with development process since you clearly know what the file is.

Last edited by Gocom (2012-07-05 13:51:07)


Rah-plugins | What? I’m a little confused… again :-) <txp:is_god />

Offline

#9 2012-07-05 14:15:33

maniqui
Moderator
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 2,985
Website

Re: remove SVN headers (or include them full) in last commit of release

Gocom wrote:

http://textpattern.googlecode.com/svn/releases/4.4.1
Is v4.4.1. The last commit to that branch is the exact the source you find from the zip. You get a release by exporting a branch, or local copy of the repository by a checkout.

Yes the repository contains all the raw source files, and all of those files do match the checksum.

This file
textpattern.googlecode.com/svn/releases/4.4.1/source/index.php
is different from the one in the zip file.

Yes, the only difference is this:

<?php
/*
$HeadURL$
$LastChangedRevision$
*/
!=
<?php
/*
$HeadURL: https://textpattern.googlecode.com/svn/releases/4.4.1/source/index.php $
$LastChangedRevision: 3189 $
*/

That alone will make the checksums fail.

That’s what I’ve tried to explain so far, so, sorry if I’m being too repetitive.

Since Git isn’t SVN, Git doesn’t handle SVN related features as keywords or other file properties. On git you will lose Textpattern’s branches, keywords and other SVN stuff.

That’s why I tried to solve by creating this mirror of Textpattern SVN repo on Github, which differs from this (now official) one.
I’ve just checked again and my mirror has some commits (corresponding to r3576, r3576, r3574, see graph in OP on this thread) that aren’t even present in the official mirror! There are aswell other commits (from previous releases) that aren’t present in the official mirror but that are present on mine.

The history in my mirror is/looks more similar to the one on the Textpattern SVN repo: branches (releases) for each release clearly defined & no commits missing. If interested, I’ve tried to explain this better and with more detail in the repo wiki.

Can you please explain what build process you are referring to? There is no building involved, other than that Robert generates checksums and commits them to the repository for us. :o I’m seriously confused.

Sorry, I may have misused a word, once again. By “build” I mean a process where the source files are modified/transformed/compiled into another file, similar but not identical. In this case, the “build” would be to add all that SVN-related info. That info is not in the source file, but it’s there in the zip package, and I assume by your clear explanations, the SVN-related info gets added there if you do an SVN export/checkout. That’s what I meant with “build”.

Last edited by maniqui (2012-07-05 14:20:05)


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#10 2012-07-05 14:46:05

Gocom
Developer
Registered: 2006-07-14
Posts: 4,475
Website

Re: remove SVN headers (or include them full) in last commit of release

maniqui wrote:

I’ve just checked again and my mirror has some commits (corresponding to r3576, r3576, r3574, see graph in OP on this thread) that aren’t even present in the official mirror!

The official mirror mirrors the dev branch (as should, you can’t mirror multiple sources w/ messing shit up). Those commit are to different branch, aren’t they? Wait, are you saying that your mirror has commits that are to different branch then, merging commits from different sources? If that’s the case, then the history on your mirror doesn’t match the one of dev branch.

If you want to do mirrors as true to the SVN as possible, those tags should be branches and those missing commits should go to those branches. Not to the master.

Yes, the only difference is this: […] That alone will make the checksums fail. […] That’s what I’ve tried to explain so far, so, sorry if I’m being too repetitive.

Thing is, unlike Git, SVN isn’t distributed system. What you are looking is the file SVN stores on the server. It relies on the server, and it stores raw and “substitution” files on the server. Those files are the same, and there is no building involved. When I run:

svn checkout http://textpattern.googlecode.com/svn/releases/4.4.1/source

I get the source. It’s 100% match to the ones on the ZIP, and checksums are identical. The difference include that there is .svn data present in the checkout directory. If I want the 1on1 Zip, I would use export.

Thing is, SVN works that way. When you do checkout or export, SVN handles it raw properties. For instance, SVN doesn’t store keywords, file properties or special files (as symlinks) on the server in their true format. It creates and sets those locally. You are looking at the raw file stored on the server… SVN unfortunately isn’t distributed, there is no clones.

The files git has and Github host are exact copy of what the SVN server stores. That’s the only way to keep the history the same on both systems. But since Git doesn’t handle SVN’s features, when you clone the git repository you get what was on the SVN server. This is due to git being distributed system where everything is a clone and an Independent instance of the repository.

Last edited by Gocom (2012-07-05 14:50:13)


Rah-plugins | What? I’m a little confused… again :-) <txp:is_god />

Offline

Board footer

Powered by FluxBB