Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I add log messages to SVN without committing any files?

Tags:

svn

Is it possible add a new log message to SVN without having to commit a file?

If not, what workarounds would you suggest, e.g. committing a one-byte hidden file?

like image 610
Simon Avatar asked Jun 01 '11 14:06

Simon


3 Answers

Instead of changing and committing an actual dummy file, you can consider changing metadata (aka property) of a directory. Such kind of metadata is something tracked by SVN and hence, can trigger a commit even there is no change in any file.

For example, just create/change a property in the root directory and do the commit. By doing so, user will not see any meaningless dummy file in the source, and will not see a meaningless file change entry of the dummy file either.

e.g.

> svn propset LOG_FOR_MESSAGE `date` .
> svn commit -m 'a commit without any file change'
like image 62
Adrian Shum Avatar answered Sep 29 '22 20:09

Adrian Shum


You can use svnmucc to crate an empty commit. Just tell it to delete a property on the root path that doesn't exist. The root directory will end up showing as modified, but there won't be any actual changes.

$ svnadmin create repo

$ svnmucc -m "commit message" -U file://`pwd`/repo propdel nosuchproperty /
r1 committed by breser at 2013-08-21T03:34:00.270416Z

$ svn log -v --diff file://`pwd`/repo
------------------------------------------------------------------------
r1 | breser | 2013-08-20 20:34:00 -0700 (Tue, 20 Aug 2013) | 1 line
Changed paths:
   M /

commit message


------------------------------------------------------------------------
like image 29
Ben Reser Avatar answered Sep 29 '22 21:09

Ben Reser


I'm not sure of the purpose. Why would I like to see dozens of log entries without a single file change?

You want the latest status of the repository? You can use revision properties. You can change a revision property without committing any file, and that revision property will be attached to the revision. Three special ones you are already familiar with: svn:log, svn:date, and svn:author. These are the commit message, the date of the commit, and the author of the change. What you see when you do a svn log.

However, you can create your own properties, and simply change them without a commit:

 $ svn ps site:status --rev-prop -rHEAD "Sunny" $REPO_URL

The only thing is you have to create a revision property change hook to allow you to change revision properties.

like image 33
David W. Avatar answered Sep 29 '22 22:09

David W.