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?
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'
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
------------------------------------------------------------------------
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With