You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by su...@spamgourmet.com on 2006/05/11 07:22:13 UTC

Why doesn't svn use /tmp for temporary files ?

Just a question, because I tripped over this and found it very
irritating.  I've never used Subversion before, but have used CVS a lot.
 I was going through the tutorial, importing a simple project, but
instead of using -m to put a comment on the command line, I left it off
so that it would bring up an editor (I'm a verbose guy, I like
multi-line comments).  Subversion appears to use the CWD to hold the
comment file in this situation, meaning:

1) If I am importing the local directory, ".", I get a spurious file
svn-commit.tmp added to the repository.  Googling online, I found
hundreds of "Deleted spurious svn-commit.tmp file" commit lines in
various people's repositories, so this problem seems pretty widespread.

2) I can't be in the root directory and run "svn import
~/temp/myprojfect file:///~/repository/myproject", because I don't have
permission to create svn-commit.tmp.

So why doesn't Subversion behave like CVS, and indeed every other unix
program, and use /tmp for temporary files?  It seemed pretty
counterintuitive.

It's svn version 1.1.4.  I expected this to be an FAQ, but I couldn't
see anything there.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Why doesn't svn use /tmp for temporary files ? 1 of 10) (subversion: message 4 of 10)

Posted by Matthew Exon <ma...@yahoo.com.au>.
Just getting back to my original point, I could reformulate the issue so
it sounds more like a bug that could be fixed:

1) Subversion shouldn't commit to the repository temporary files that it
created.

and/or...

2) Subversion shouldn't create temporary files in a directory it's busy
importing.

Both of those are detectable, incorrect situations.  I'm sure checking
for either of these would be pretty hairy (you'd need to have a global
data structure listing all the temporary files it currently has open;
yuck), but it's still a desirable feature.

Garrett Rooney - rooneg@electricjellyfish.net wrote:
> On 5/11/06, subversion.mexon@spamgourmet.com
> 
>> OK.  But in the case where I specify the full paths, subversion has no
>> idea which filesystem I'm in.  I could have been in /tmp, in which case
>> it would have written there anyway.  So writing the temporary file in
>> the CWD isn't a guarantee that it'll be atomic, right?
> 
> Nope, but it's more likely to be correct that /tmp is.

Possibly, I suppose.  I'd personally say that you should only go against
standard behaviour if by doing so you can eliminate the problem
completely.  But it's a judgement call either way.

>> Anyway, is there a known bugs page for Subversion?  You know, like the
>> known bugs section in manpages, for "bugs" that can't or shouldn't be
>> fixed.  This seems like a candidate: annoying and counterintuitive, but
>> not incorrect.
> 
> There's the issue tracker, but I don't know of any other page that
> does precisely what you're asking.  That's why we ask people to bring
> up questions like this on the mailing lists.

Does the issue tracker have a "won't fix" option?  That'd do, at a
pinch.  I do think tracking this information is valuable.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Why doesn't svn use /tmp for temporary files ? 1 of 10)

Posted by Garrett Rooney <ro...@electricjellyfish.net>.
On 5/11/06, subversion.mexon@spamgourmet.com

> OK.  But in the case where I specify the full paths, subversion has no
> idea which filesystem I'm in.  I could have been in /tmp, in which case
> it would have written there anyway.  So writing the temporary file in
> the CWD isn't a guarantee that it'll be atomic, right?

Nope, but it's more likely to be correct that /tmp is.

> Anyway, is there a known bugs page for Subversion?  You know, like the
> known bugs section in manpages, for "bugs" that can't or shouldn't be
> fixed.  This seems like a candidate: annoying and counterintuitive, but
> not incorrect.

There's the issue tracker, but I don't know of any other page that
does precisely what you're asking.  That's why we ask people to bring
up questions like this on the mailing lists.

-garrett

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org


Re: Why doesn't svn use /tmp for temporary files ? (subversion: message 1 of 10)

Posted by Matthew Exon <ma...@yahoo.com.au>.
Garrett Rooney - rooneg@electricjellyfish.net wrote:
> On 5/11/06, subversion.mexon@spamgourmet.com
> <su...@spamgourmet.com> wrote:
> 
>> Just a question, because I tripped over this and found it very
>> irritating.  I've never used Subversion before, but have used CVS a lot.
>>  I was going through the tutorial, importing a simple project, but
>> instead of using -m to put a comment on the command line, I left it off
>> so that it would bring up an editor (I'm a verbose guy, I like
>> multi-line comments).  Subversion appears to use the CWD to hold the
>> comment file in this situation, meaning:
>>
>> 1) If I am importing the local directory, ".", I get a spurious file
>> svn-commit.tmp added to the repository.  Googling online, I found
>> hundreds of "Deleted spurious svn-commit.tmp file" commit lines in
>> various people's repositories, so this problem seems pretty widespread.
>>
>> 2) I can't be in the root directory and run "svn import
>> ~/temp/myprojfect file:///~/repository/myproject", because I don't have
>> permission to create svn-commit.tmp.
>>
>> So why doesn't Subversion behave like CVS, and indeed every other unix
>> program, and use /tmp for temporary files?  It seemed pretty
>> counterintuitive.
>>
>> It's svn version 1.1.4.  I expected this to be an FAQ, but I couldn't
>> see anything there.
> 
> 
> Subversion often atomically copies temporary files into place, so that
> you either see all of a file or none of it.  This doesn't work if
> you're copying between two filesystems, and since /tmp is often on a
> different filesystem than your working copy, that would be a problem.

OK.  But in the case where I specify the full paths, subversion has no
idea which filesystem I'm in.  I could have been in /tmp, in which case
it would have written there anyway.  So writing the temporary file in
the CWD isn't a guarantee that it'll be atomic, right?

Anyway, is there a known bugs page for Subversion?  You know, like the
known bugs section in manpages, for "bugs" that can't or shouldn't be
fixed.  This seems like a candidate: annoying and counterintuitive, but
not incorrect.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Why doesn't svn use /tmp for temporary files ?

Posted by Garrett Rooney <ro...@electricjellyfish.net>.
On 5/12/06, Michael Haggerty <mh...@alum.mit.edu> wrote:
> Garrett Rooney wrote:
> > On 5/11/06, subversion.mexon@spamgourmet.com
> > <su...@spamgourmet.com> wrote:
> >> So why doesn't Subversion behave like CVS, and indeed every other unix
> >> program, and use /tmp for temporary files?  It seemed pretty
> >> counterintuitive.
> >
> > Subversion often atomically copies temporary files into place, so that
> > you either see all of a file or none of it.  This doesn't work if
> > you're copying between two filesystems, and since /tmp is often on a
> > different filesystem than your working copy, that would be a problem.
>
> Your argument might be convincing for many types of temporary files, but
> I don't see how it applies to svn-commit.tmp.
>
> The main advantages of /tmp are (1) the files are not cluttering up the
> WC and daring svn to commit them; (2) /tmp is typically cleaned up
> periodically to remove ancient detritus.  These benefits would accrue
> not only to the svn-commit.tmp files (which svn tries to clean up), but
> also editor backup files like svn-commit.tmp~, which svn doesn't know
> about and therefore cannot clean up.
>
> Even if temp files really have to be in the current WC due to some
> atomicity requirement, then maybe they could be tucked away in a
> subdirectory of .svn where they won't bother anybody?

Sure, for commit logs they could be put someplace else, I don't see
any problem with that.  As for putting temp files in the .svn/ dir,
many of them already are (see .svn/tmp/).  I honestly can't recall why
the log message file goes in the current working directory.

-garrett

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org


Re: Why doesn't svn use /tmp for temporary files ? (subversion: message 5 of 10)

Posted by Matthew Exon <ma...@yahoo.com.au>.
Michael Haggerty - mhagger@alum.mit.edu wrote:

> Even if temp files really have to be in the current WC due to some
> atomicity requirement, then maybe they could be tucked away in a
> subdirectory of .svn where they won't bother anybody?

That doesn't work for my original problem, an import, because there's no
.svn directory yet.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Why doesn't svn use /tmp for temporary files ?

Posted by Garrett Rooney <ro...@electricjellyfish.net>.
On 5/12/06, Michael Haggerty <mh...@alum.mit.edu> wrote:
> Garrett Rooney wrote:
> > On 5/11/06, subversion.mexon@spamgourmet.com
> > <su...@spamgourmet.com> wrote:
> >> So why doesn't Subversion behave like CVS, and indeed every other unix
> >> program, and use /tmp for temporary files?  It seemed pretty
> >> counterintuitive.
> >
> > Subversion often atomically copies temporary files into place, so that
> > you either see all of a file or none of it.  This doesn't work if
> > you're copying between two filesystems, and since /tmp is often on a
> > different filesystem than your working copy, that would be a problem.
>
> Your argument might be convincing for many types of temporary files, but
> I don't see how it applies to svn-commit.tmp.
>
> The main advantages of /tmp are (1) the files are not cluttering up the
> WC and daring svn to commit them; (2) /tmp is typically cleaned up
> periodically to remove ancient detritus.  These benefits would accrue
> not only to the svn-commit.tmp files (which svn tries to clean up), but
> also editor backup files like svn-commit.tmp~, which svn doesn't know
> about and therefore cannot clean up.
>
> Even if temp files really have to be in the current WC due to some
> atomicity requirement, then maybe they could be tucked away in a
> subdirectory of .svn where they won't bother anybody?

Sure, for commit logs they could be put someplace else, I don't see
any problem with that.  As for putting temp files in the .svn/ dir,
many of them already are (see .svn/tmp/).  I honestly can't recall why
the log message file goes in the current working directory.

-garrett

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org


Re: Why doesn't svn use /tmp for temporary files ?

Posted by Garrett Rooney <ro...@electricjellyfish.net>.
On 5/12/06, Michael Haggerty <mh...@alum.mit.edu> wrote:
> Garrett Rooney wrote:
> > On 5/11/06, subversion.mexon@spamgourmet.com
> > <su...@spamgourmet.com> wrote:
> >> So why doesn't Subversion behave like CVS, and indeed every other unix
> >> program, and use /tmp for temporary files?  It seemed pretty
> >> counterintuitive.
> >
> > Subversion often atomically copies temporary files into place, so that
> > you either see all of a file or none of it.  This doesn't work if
> > you're copying between two filesystems, and since /tmp is often on a
> > different filesystem than your working copy, that would be a problem.
>
> Your argument might be convincing for many types of temporary files, but
> I don't see how it applies to svn-commit.tmp.
>
> The main advantages of /tmp are (1) the files are not cluttering up the
> WC and daring svn to commit them; (2) /tmp is typically cleaned up
> periodically to remove ancient detritus.  These benefits would accrue
> not only to the svn-commit.tmp files (which svn tries to clean up), but
> also editor backup files like svn-commit.tmp~, which svn doesn't know
> about and therefore cannot clean up.
>
> Even if temp files really have to be in the current WC due to some
> atomicity requirement, then maybe they could be tucked away in a
> subdirectory of .svn where they won't bother anybody?

Sure, for commit logs they could be put someplace else, I don't see
any problem with that.  As for putting temp files in the .svn/ dir,
many of them already are (see .svn/tmp/).  I honestly can't recall why
the log message file goes in the current working directory.

-garrett

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org


Re: Why doesn't svn use /tmp for temporary files ?

Posted by Michael Haggerty <mh...@alum.mit.edu>.
Garrett Rooney wrote:
> On 5/11/06, subversion.mexon@spamgourmet.com
> <su...@spamgourmet.com> wrote:
>> So why doesn't Subversion behave like CVS, and indeed every other unix
>> program, and use /tmp for temporary files?  It seemed pretty
>> counterintuitive.
> 
> Subversion often atomically copies temporary files into place, so that
> you either see all of a file or none of it.  This doesn't work if
> you're copying between two filesystems, and since /tmp is often on a
> different filesystem than your working copy, that would be a problem.

Your argument might be convincing for many types of temporary files, but
I don't see how it applies to svn-commit.tmp.

The main advantages of /tmp are (1) the files are not cluttering up the
WC and daring svn to commit them; (2) /tmp is typically cleaned up
periodically to remove ancient detritus.  These benefits would accrue
not only to the svn-commit.tmp files (which svn tries to clean up), but
also editor backup files like svn-commit.tmp~, which svn doesn't know
about and therefore cannot clean up.

Even if temp files really have to be in the current WC due to some
atomicity requirement, then maybe they could be tucked away in a
subdirectory of .svn where they won't bother anybody?

Michael

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Why doesn't svn use /tmp for temporary files ?

Posted by Garrett Rooney <ro...@electricjellyfish.net>.
On 5/11/06, subversion.mexon@spamgourmet.com
<su...@spamgourmet.com> wrote:
> Just a question, because I tripped over this and found it very
> irritating.  I've never used Subversion before, but have used CVS a lot.
>  I was going through the tutorial, importing a simple project, but
> instead of using -m to put a comment on the command line, I left it off
> so that it would bring up an editor (I'm a verbose guy, I like
> multi-line comments).  Subversion appears to use the CWD to hold the
> comment file in this situation, meaning:
>
> 1) If I am importing the local directory, ".", I get a spurious file
> svn-commit.tmp added to the repository.  Googling online, I found
> hundreds of "Deleted spurious svn-commit.tmp file" commit lines in
> various people's repositories, so this problem seems pretty widespread.
>
> 2) I can't be in the root directory and run "svn import
> ~/temp/myprojfect file:///~/repository/myproject", because I don't have
> permission to create svn-commit.tmp.
>
> So why doesn't Subversion behave like CVS, and indeed every other unix
> program, and use /tmp for temporary files?  It seemed pretty
> counterintuitive.
>
> It's svn version 1.1.4.  I expected this to be an FAQ, but I couldn't
> see anything there.

Subversion often atomically copies temporary files into place, so that
you either see all of a file or none of it.  This doesn't work if
you're copying between two filesystems, and since /tmp is often on a
different filesystem than your working copy, that would be a problem.

-garrett

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org