1

I need to run astyle in a project with several source files. There's not a common IDE used by all developers, they develop in vi, gedit, Netbeans, Eclipse, etc. So I can't use a configuration file for indentation. In order to keep a standard in the code indentation I want to run an script (probably in a server) that everyday executes astyle for each source file and commits the changes. But I'm afraid I will loose track of who has made the last changes in the code.

Can I configure svn to keep information of who made the changes before the execution of astyle?

Thx.

eap
  • 168
  • 1
  • 1
  • 9
  • While more work to figure out how to configure all of the editors to use the same "style", a lot less hassle and confusion for the developers not needing to update after committing. – crashmstr Aug 22 '14 at 18:22
  • Actually they don't need to update after commiting because the script would run once a day (at midnight perhaps). – eap Aug 22 '14 at 18:24
  • Still, makes more sense to have the developers configure their tools to adhere to set standards if the standard is so important. – crashmstr Aug 22 '14 at 18:34
  • Believe me, we have tried this a lot. – eap Aug 22 '14 at 18:37

1 Answers1

2
  • SVN already automatically always keep this information (see svn log -l 1 FILE)
  • You have to remember old committer of every (modified && commited after astyle) file and restore (in added by astyle-script revisions) previous commiter - it can be special post-commit hook, in which you can do almost anything

Hints:

  1. Build changelists (before commits), in which you'll collect files per committer
  2. Commit astyle-related changes under special separated user, using changelists from p.1 or, if you know user's name|password, commit as this user (--username + --password options of svn ci)
  3. Permanent post-commit hook (maybe even pre-commit) can be executed only for special committer and will change author of commit|transaction with propset

Anyway, administrative reactions and sanctions ("Play by the rules or went out") is more right and short way

Lazy Badger
  • 94,711
  • 9
  • 78
  • 110