Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8721643
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T07:15:16+00:00 2026-06-13T07:15:16+00:00

I’ll start off by saying that it’s entirely possible that this isn’t possible –

  • 0

I’ll start off by saying that it’s entirely possible that this isn’t possible – if it’s not, that’s fine (well, it sucks, but I’ll live). I know there are potentially some “well, how would that work anyway?” walls in doing what I want to do, but hey.

What I’d like to do is to reformat a large number of files in a Subversion repository without changing any of the ownership data, either turning this:

username   | commit number
------------------------------------------------
john_smith | 1 | <?php
john_smith | 1 | echo 'Hello world';
joe_bloggs | 2 | if (isset($user)) {
john_doe   | 3 |   echo ', and hello ' . $user;
joe_bloggs | 2 | }

into this (where the new lines are unowned):

username   | commit number
------------------------------------------------
john_smith | 1 | <?php
           |   |
john_smith | 1 | echo 'Hello world';
joe_bloggs | 2 | if (isset($user))
           |   | {
john_doe   | 3 |   echo ', and hello ' . $user;
joe_bloggs | 2 | }

or this (where new lines are owned by me but changed lines aren’t):

username   | commit number
------------------------------------------------
john_smith | 1 | <?php
mr_man     | 4 |
john_smith | 1 | echo 'Hello world';
joe_bloggs | 2 | if (isset($user))
mr_man     | 4 | {
john_doe   | 3 |   echo ', and hello ' . $user;
joe_bloggs | 2 | }

or any other permutation.

I’m wanting to do this as there’s a lot of badly formatted code in the repository, and I’d like to get it cleaned up without taking ownership of (pretty much) the entire thing, as it’s handy to be able to hit Blame down the side of a file and see the last changes for each line, and the reasons for those changes. Re-formatting with a commit message and ownership would remove that for a large chunk of the repository, and force us to look in the log for the actual person, then diff it just to make sure.

If anyone can think of an alternative way to get the code reformatted without ruining the Blame, I’m open to suggestions on that too.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T07:15:17+00:00Added an answer on June 13, 2026 at 7:15 am

    Can you do that? No. Any change in the file creates another revision. Thus, you’ll get a new revision number in svn blame for each line. After all, even innocuous changes might cause problems. What if your reformatting operation changed data that broke the application. The developer who carefully formatted that data wouldn’t want to find themselves getting blamed for that. That’s why even formatting changes will change the revision.

    There is something you can possibly do if so desired: The owner of a revision is a revision property of svn:author. If you change that revision property, you can change the name of the user who did the commit.

    A bit of a limit:

    • Each commit has only a single author, so you’d have to arrange your commits to do all the files by a particular author.
    • By default, Subversion does not allow you to change revision properties. You have to create a pre revision change hook to allow you to change that property.
    • All of the lines will show up as that author in the blame and the revision shown will be the revision of when you did the change.

    My recommendation: Don’t do it. You could break something if it isn’t thoroughly tested. What I would recommend is to use something like Jenkins. I realize that PHP files don’t need to be compiled like Java or C code, but you could run a syntax checker on the files and display the results in Jenkins.

    You might be able to use the phpcheckstyle application along with the Jenkins Checkstyle plugin. Then use the cigame plugin to challenge developers to fix the formatting of the code itself.

    Each checkstyle violation that’s fixed will give developers points in the cigame plugin. This will encourage the developers to fix the format issues themselves. If you’re not a developer, you should not be touching code. Otherwise, the Finger o’ Blame could point from a developer who created buggy code to you because you changed it — even though it was only formatting.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a French site that I want to parse, but am running into
This could be a duplicate question, but I have no idea what search terms
I know there's a lot of other questions out there that deal with this
I need a function that will clean a strings' special characters. I do NOT
Is it possible to replace javascript w/ HTML if JavaScript is not enabled on
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.