WordPress plugin development: Solution to “Malformed tag detected” error

Look, day-to-day, I do not use SVN. It’s not a tool of choice, so I make my life easier by using the excellent app Versions to manage my WordPress.org SVN access for my WordPress plugins. I drag and drop the changes and all is good.

However, i recently started getting this message when trying to create my tags folder…

Subversion error occurred

Commit blocked by pre-commit hook (exit code 1) with output:

Malformed tag detected, It looks like you’re creating a tag without a readme file present.

As the message says, you can’t now create an empty tags folder (which is used for specific versioning, unlike trunk). I don’t know why the change has occurred, but I’m guessing it’s caused some issues in the past. I’m not aware of the change being officially communicated but, drill down into the documentation and you’ll find it.

Instead of pushing your code directly to a tag folder, you should edit the code in trunk, complete with the stable version in the readme, and then copy the code from trunk to the new tag.

It even then goes on to explain the reasoning…

Not only will this make it easier see any changes, you will be making smaller commits as SVN will only update the changed code. This will save you time and reduce potential errors (such as updating to the wrong stable tag and pushing bad code to users).

When using the Versions app, there’s a quick solution

  1. Update the trunk folder as usual
  2. Right click on the trunk folder and select “Duplicate”
  3. A pop-up window will ask for the new name – write this as /tags/ followed by your preferred tags folder name (i.e. the version number)

This will now copy the trunks folder into your preferred folder under tags


Discover more from artiss.blog

Subscribe to get the latest posts sent to your email.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.