Discussion:
Bug: Locally deleted file wrongly accepted as log message string.
Karl Fogel
2018-06-29 02:29:02 UTC
Permalink
I'm pretty sure this is a bug, but wanted to check here first before filing a ticket.

Normally, if you accidentally use a local versioned file path as a log message, you will get an error:

$ svn --version
svn, version 1.10.0 (r1827917)
[...]
$ svn commit -m locally_versioned_path
svn: E205005: The log message is a pathname (was -F intended?); use '--force-log' to override
$

It doesn't matter whether 'locally_versioned_path' is modified or not. It doesn't have to be part of the commit; the mere fact that it's a path under version control is why SVN decides it likely wasn't intended to be the log message.

Now try this:

$ svn status
$ svn rm locally_versioned_path
D locally_versioned_path
$ svn commit -m locally_versioned_path
Deleting locally_versioned_path
Committing transaction...
Committed revision 1729.
$

Oops :-).

Because the *working file* is no longer there, Subversion fails to decide that the path likely wasn't intended to be the log message -- even though obviously Subversion should come to the same conclusion here that it would have come to if the path were not locally deleted.

If we agree this is a bug, I'll file it. Maybe I'll even fix it -- no promises; depends how much I'm able to sleep on the plane this weekend :-). In any case, I first wanted to make sure there is consensus that this is a bug. Do we agree?

Best regards,
-Karl
Philip Martin
2018-06-29 08:35:38 UTC
Permalink
Post by Karl Fogel
:-). In any case, I first wanted to make sure there is consensus that
this is a bug. Do we agree?
Agreed.
--
Philip
Branko Čibej
2018-06-29 09:10:29 UTC
Permalink
Post by Philip Martin
Post by Karl Fogel
:-). In any case, I first wanted to make sure there is consensus that
this is a bug. Do we agree?
Agreed.
That check was put in the code to prevent users from writing '-m foo<tab
completion>' instead of '-F foo<tab completion>'. It was *not* put there
to prevent people from using the name of a (nominally)
version-controlled file in the log message. Therefore, the behaviour is
correct, since in your second example, there is no such file on disk.

Note that the error message says that "the log message is a pathname",
not that it's a versioned file. Also the comment in the code where we
check that says:

If the -m argument is a file at all, that's probably not what the
user intended.


QED: not a bug but expected behaviour.

-- Brane

P.S.: Incidentally, Karl, your name appears in the blame of that bit of
the source file, so I'm assuming that, at least at some point, you
agreed with the current behaviour. :)
Julian Foad
2018-06-29 09:55:41 UTC
Permalink
Post by Branko Čibej
That check was put in the code to prevent users from writing '-m foo<tab
completion>' instead of '-F foo<tab completion>' [...]
.. which reminds me of a Subversion tab-completion enhancement I have been missing for some time: completing the names of locally-deleted files in addition to those found on disk. :-)

- Julian

Loading...