You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Jani Averbach <ja...@jaa.iki.fi> on 2004/03/04 18:05:11 UTC
svn diff doesn't verify MD5 sums (Related to issues #1774 and #1177)
Hi!
SVN doesn't verify md5sums when it is doing diff against text
base. Here is the recipe:
svn --version
svn, version 1.1.0 (dev build)
compiled Mar 4 2004, 09:51:36
# --8<--
svnadmin create repo
svn co file://`pwd`/repo wc
cd wc
touch file
svn add file
svn ci -m '' file
echo '#1 line' >> file
echo '#2 line' >> file
chmod u+w .svn/text-base/file.svn-base
echo '#2 line' >> .svn/text-base/file.svn-base
svn diff
# --8<--
Index: file
===================================================================
--- file (revision 1)
+++ file (working copy)
@@ -1 +1,2 @@
+#1 line
#2 line
However, svn ci works correctly:
svn ci -m ''
Sending file
Transmitting file data .svn: Commit failed (details follow):
svn: Checksum mismatch for '/raid/3/jaa/tmp/svntest/wc/.svn/text-base/file.svn-base':
expected 'd41d8cd98f00b204e9800998ecf8427e', actual: 'ca9da9a536181a005144afc186ada942'
This is related (similar) to issues:
svn status should MD5 the text-base
http://subversion.tigris.org/issues/show_bug.cgi?id=1177
'svn revert' does not verify checksums
http://subversion.tigris.org/issues/show_bug.cgi?id=1774
BR, Jani
--
Jani Averbach
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: svn diff doesn't verify MD5 sums (Related to issues #1774 and
#1177)
Posted by Greg Hudson <gh...@MIT.EDU>.
On Fri, 2004-03-05 at 23:13, Jani Averbach wrote:
> I could live very easily with current 'status', but I would like to
> see 'diff' to do verification because you can use it to generate
> patch-files. And if those patch files are not correct, it might be
> hard to detect afterwards.
I'm with Karl on this one. Doing checksum verification at diff time is
a little outside the scope of what checksums are supposed to do, so we
should only do it if it's easy.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: svn diff doesn't verify MD5 sums (Related to issues #1774 and #1177)
Posted by Karl Fogel <kf...@localhost.localdomain>.
Jani Averbach <ja...@jaa.iki.fi> writes:
> I could live very easily with current 'status', but I would like to
> see 'diff' to do verification because you can use it to generate
> patch-files. And if those patch files are not correct, it might be
> hard to detect afterwards.
Aha, good argument. Okay, so we need to fix 'diff'. And, I'd like to
update the 'revert' verification code as Greg Stein pointed out
earlier. These two aren't necessarily related. If you want to supply
a patch for some/all of it, feel free :-). I'll at least try to get
to the 'revert' improvement when I'm traveling tomorrow, but don't
currently plan to tackle 'diff'.
-Karl
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: svn diff doesn't verify MD5 sums (Related to issues #1774 and #1177)
Posted by Jani Averbach <ja...@jaa.iki.fi>.
On 2004-03-05 18:26-0600, kfogel@collab.net wrote:
> As I understood it, our goal in havin checksums has been primarily to
> prevent corrupt data from getting into the repository.
...
> I'm not so sure that 'status' and 'diff' are equally persuasive cases,
> though. And in the case of 'status', we'd pay a speed penalty to do
> verification, since it almost never has to scan the entire text base
> for modified files right now.
>
> In short: I'm comfortable with the status quo, but wonder what others
> think. (If we agree the status quo is okay, we should probably close
> those two issues as WONTFIX.)
I could live very easily with current 'status', but I would like to
see 'diff' to do verification because you can use it to generate
patch-files. And if those patch files are not correct, it might be
hard to detect afterwards.
BR, Jani
--
Jani Averbach
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: svn diff doesn't verify MD5 sums (Related to issues #1774 and #1177)
Posted by "C.A.T.Magic" <c....@gmx.at>.
> As I understood it, our goal in havin checksums has been primarily to
> prevent corrupt data from getting into the repository. That's why
> commits have verified checksums since the beginning. I just now
> committed r8897 (fixing #1774) because 'revert' somehow intuitively
> seemed like a good chance to verify the text base, much like
> 'checkout' and 'update'.
>
> I'm not so sure that 'status' and 'diff' are equally persuasive cases,
> though. And in the case of 'status', we'd pay a speed penalty to do
> verification, since it almost never has to scan the entire text base
> for modified files right now.
I'm not sure if you want to hear a 'user' opinion on your dev-talk,
but since I was the one who filed the 1774 issue I feel a bit involved
in the discussion :-)
my short comment is: I just wanted to be 99.9% sure that what I
have in my local WC (after an svn update) represents the tagged
version on the central repository.
my recommendation: always do an MD5 check when you
write/modify a file (that includes writes to the repository).
no big need to check a file when you just have
to read it. (or maybe add an 'svn verify' command for
the paranoid users like svnadmin verify does for the repos).
==
my long comment:
I found it a great feature that svn performs MD5 checksums on all
the data automatically, because that gives us a very high chance
that when we do a fresh update and compile a release version
for a customer there is almost no chance an error can sneak in.
Ofcourse, using a complete fresh -checkout- could be even safer,
but unfortunetely the total amount of data is ~3GB and I only have
a 100kbyte/s download connection to the central repository -
so I prefer to use my local data and just do an update to the
tagged version on the server, run the final tests, scripts and builds.
In svn, everything that is downloaded fresh from the server gets
MD5 checked - thats perfect. But a few commands (like svn revert)
did move a file into the WC without performing an MD5 check.
> In short: I'm comfortable with the status quo, but wonder what others
> think. (If we agree the status quo is okay, we should probably close
> those two issues as WONTFIX.)
if everything that -writes- to a WC files checks its MD5 (or in the
case of merges, patches checks its sources) I'd say thats more than
enough.
real disk errors should be catched by the underlying filesystem anyway.
just be sure that svn never writes defective data anywhere.
> Thoughts?
hope I could help with that.
:-)
===
c.a.t.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: svn diff doesn't verify MD5 sums (Related to issues #1774 and #1177)
Posted by kf...@collab.net.
Jani Averbach <ja...@jaa.iki.fi> writes:
> SVN doesn't verify md5sums when it is doing diff against text
> base. Here is the recipe:
Hmmm.
Okay, we have a general question here: when and/or how often do we
want to verify the text base? The cost, of course, is that we have to
scan every byte.
This and the related issues #1774 and #1177 all share a common theme:
Subversion may take the "early out" and decide that the working file
is not modified, based on the timestamp. And if it gets past that, it
may still take another early out and decide that the file *is*
modified because the two file sizes differ. In both outs, it avoids
scanning the entire text base.
Once past these two outs, the three commands (diff, revert, status)
diverge a bit. While 'revert' and 'status' do need to scan the bytes,
they currently only need to go as far as discovering the first
difference, then they stop, whereas 'diff' has to scan all the bytes
anyway.
As I understood it, our goal in havin checksums has been primarily to
prevent corrupt data from getting into the repository. That's why
commits have verified checksums since the beginning. I just now
committed r8897 (fixing #1774) because 'revert' somehow intuitively
seemed like a good chance to verify the text base, much like
'checkout' and 'update'.
I'm not so sure that 'status' and 'diff' are equally persuasive cases,
though. And in the case of 'status', we'd pay a speed penalty to do
verification, since it almost never has to scan the entire text base
for modified files right now.
In short: I'm comfortable with the status quo, but wonder what others
think. (If we agree the status quo is okay, we should probably close
those two issues as WONTFIX.)
Thoughts?
-Karl
> svn --version
> svn, version 1.1.0 (dev build)
> compiled Mar 4 2004, 09:51:36
>
> # --8<--
> svnadmin create repo
> svn co file://`pwd`/repo wc
> cd wc
> touch file
> svn add file
> svn ci -m '' file
> echo '#1 line' >> file
> echo '#2 line' >> file
> chmod u+w .svn/text-base/file.svn-base
> echo '#2 line' >> .svn/text-base/file.svn-base
> svn diff
> # --8<--
>
> Index: file
> ===================================================================
> --- file (revision 1)
> +++ file (working copy)
> @@ -1 +1,2 @@
> +#1 line
> #2 line
>
> However, svn ci works correctly:
> svn ci -m ''
> Sending file
> Transmitting file data .svn: Commit failed (details follow):
> svn: Checksum mismatch for '/raid/3/jaa/tmp/svntest/wc/.svn/text-base/file.svn-base':
> expected 'd41d8cd98f00b204e9800998ecf8427e', actual: 'ca9da9a536181a005144afc186ada942'
>
> This is related (similar) to issues:
>
> svn status should MD5 the text-base
> http://subversion.tigris.org/issues/show_bug.cgi?id=1177
>
> 'svn revert' does not verify checksums
> http://subversion.tigris.org/issues/show_bug.cgi?id=1774
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org