# Temporary directories getting errantly added into trees

12 messages from 2007-11-22 to 2007-11-24. Participants: Sam Vilain, Eric Wong, Jeff King, Johannes Schindelin, Martin Langhoff, Junio C Hamano, Karl Hasselström, Marco Costalba.
Thread: https://gitlist.dev/t/10973

## Sam Vilain, 2007-11-22 03:51

Subject: Temporary directories getting errantly added into trees
Message-ID: <4744FCD9.7020102@vilain.net>
URL: https://gitlist.dev/e/4744FCD9.7020102%40vilain.net

```
I just got through a rather nasty debugging session with git-rebase,
which relies on a .dotest directory.  Turns out that .dotest was
accidentally added to the tree in the history of the commit that was
being rebased onto.

There are a lot of temporary files like that made by various scripts -
eg, git-filter-branch makes .git-rewrite, etc.

I think it would be a good thing for all if you had to work very hard to
put files like this in the tree, or perhaps it would be better to go
through and make all the tools that create these temporary directories
create them under .git instead.

Thoughts/comments?
Sam.

```

## Eric Wong, 2007-11-22 07:30

Subject: Re: Temporary directories getting errantly added into trees
Message-ID: <20071122073059.GA28197@soma>
URL: https://gitlist.dev/e/20071122073059.GA28197%40soma
In-Reply-To: <4744FCD9.7020102@vilain.net>

```
Sam Vilain <sam@vilain.net> wrote:
> I just got through a rather nasty debugging session with git-rebase,
> which relies on a .dotest directory.  Turns out that .dotest was
> accidentally added to the tree in the history of the commit that was
> being rebased onto.

Hi Sam,

Ouch

> There are a lot of temporary files like that made by various scripts -
> eg, git-filter-branch makes .git-rewrite, etc.
> 
> I think it would be a good thing for all if you had to work very hard to
> put files like this in the tree, or perhaps it would be better to go
> through and make all the tools that create these temporary directories
> create them under .git instead.

Polluting the working tree is definitely a bad thing to do IMNSHO.

git-rebase --merge already puts its temporary directory inside
.git/.dotest-merge.  I hoped to set an example with that and
get more tools to do the same; but it hasn't happened yet...

-- 
Eric Wong

```

## Jeff King, 2007-11-22 10:43

Subject: Re: Temporary directories getting errantly added into trees
Message-ID: <20071122104352.GB10389@sigill.intra.peff.net>
URL: https://gitlist.dev/e/20071122104352.GB10389%40sigill.intra.peff.net
In-Reply-To: <4744FCD9.7020102@vilain.net>

```
On Thu, Nov 22, 2007 at 04:51:53PM +1300, Sam Vilain wrote:

> I think it would be a good thing for all if you had to work very hard to
> put files like this in the tree, or perhaps it would be better to go
> through and make all the tools that create these temporary directories
> create them under .git instead.


Personally, I think they should all go under .git with very descriptive,
public names (the name ".dotest" is not really hidden from the user, and
I have never really been able to make sense of it. Surely there is some
more useful name?).

But I think there is the real possibility of damaging user scripts which
make assumptions based on the presence of .dotest (to see if we're in a
git-am or rebase session, etc). I have no idea how common such scripts
are.

-Peff

```

## Johannes Schindelin, 2007-11-22 10:55

Subject: Re: Temporary directories getting errantly added into trees
Message-ID: <Pine.LNX.4.64.0711221052280.27959@racer.site>
URL: https://gitlist.dev/e/Pine.LNX.4.64.0711221052280.27959%40racer.site
In-Reply-To: <4744FCD9.7020102@vilain.net>

```
Hi,

On Thu, 22 Nov 2007, Sam Vilain wrote:

> I just got through a rather nasty debugging session with git-rebase, 
> which relies on a .dotest directory.  Turns out that .dotest was 
> accidentally added to the tree in the history of the commit that was 
> being rebased onto.

While we're at it, could we change the name so that it is .git/rebase, and 
not .dotest or .git/.dotest-merge?

Yes, I know, existing tools could rely on the location.  But then, I do 
not think that tools should be allowed to be _that_ married to particular 
implementations.  And indeed, I see no reason why a tool should access 
.dotest, except for accessing .dotest/patch, and then it will be very 
obvious where it fails.

But I don't know about QGit, StGit, etc...

Ciao,
Dscho

```

## Martin Langhoff, 2007-11-22 11:01

Subject: Re: Temporary directories getting errantly added into trees
Message-ID: <46a038f90711220301o1cbb16b7g79eea541f8ca5e58@mail.gmail.com>
URL: https://gitlist.dev/e/46a038f90711220301o1cbb16b7g79eea541f8ca5e58%40mail.gmail.com
In-Reply-To: <Pine.LNX.4.64.0711221052280.27959@racer.site>

```
On Nov 22, 2007 11:55 PM, Johannes Schindelin > While we're at it,
could we change the name so that it is .git/rebase, and
> not .dotest or .git/.dotest-merge?

+1 on that

> ... And indeed, I see no reason why a tool should access
> .dotest, except for accessing .dotest/patch, and then it will be very
> obvious where it fails.

when it comes to .dotest/patch, it must be reasonably accessible. When
git-am refuses to apply a patch, and I am resolving things by hand, I
need it pretty handy. I also sometimes edit .dotest/msg-clean.

cheers,


m

```

## Jeff King, 2007-11-22 11:16

Subject: Re: Temporary directories getting errantly added into trees
Message-ID: <20071122111600.GF10389@sigill.intra.peff.net>
URL: https://gitlist.dev/e/20071122111600.GF10389%40sigill.intra.peff.net
In-Reply-To: <Pine.LNX.4.64.0711221052280.27959@racer.site>

```
On Thu, Nov 22, 2007 at 10:55:00AM +0000, Johannes Schindelin wrote:

> While we're at it, could we change the name so that it is .git/rebase, and 
> not .dotest or .git/.dotest-merge?

I totally agree.

> Yes, I know, existing tools could rely on the location.  But then, I do 
> not think that tools should be allowed to be _that_ married to particular 
> implementations.  And indeed, I see no reason why a tool should access 
> .dotest, except for accessing .dotest/patch, and then it will be very 
> obvious where it fails.

Another reason might be something like:

  test -d .dotest && die "rebase or am already in progress"

which some of the git tools do, and which third party scripts might care
about.

-Peff

```

## Johannes Schindelin, 2007-11-22 11:30

Subject: Re: Temporary directories getting errantly added into trees
Message-ID: <Pine.LNX.4.64.0711221129170.27959@racer.site>
URL: https://gitlist.dev/e/Pine.LNX.4.64.0711221129170.27959%40racer.site
In-Reply-To: <46a038f90711220301o1cbb16b7g79eea541f8ca5e58@mail.gmail.com>

```
Hi,

On Fri, 23 Nov 2007, Martin Langhoff wrote:

> On Nov 22, 2007 11:55 PM, Johannes Schindelin
> 
> > ... And indeed, I see no reason why a tool should access .dotest, 
> > except for accessing .dotest/patch, and then it will be very obvious 
> > where it fails.
> 
> when it comes to .dotest/patch, it must be reasonably accessible. When 
> git-am refuses to apply a patch, and I am resolving things by hand, I 
> need it pretty handy. I also sometimes edit .dotest/msg-clean.

Maybe install a .dotest/ symlink for a few "git eons", i.e. some 6 months?

Although this will not work on Windows, I see not much problems in it, 
since Windows users are not big in scripting (at least the git 
type) anyway.

Ciao,
Dscho

```

## Johannes Schindelin, 2007-11-22 11:32

Subject: Re: Temporary directories getting errantly added into trees
Message-ID: <Pine.LNX.4.64.0711221130510.27959@racer.site>
URL: https://gitlist.dev/e/Pine.LNX.4.64.0711221130510.27959%40racer.site
In-Reply-To: <20071122111600.GF10389@sigill.intra.peff.net>

```
Hi.

On Thu, 22 Nov 2007, Jeff King wrote:

> On Thu, Nov 22, 2007 at 10:55:00AM +0000, Johannes Schindelin wrote:
> 
> > Yes, I know, existing tools could rely on the location.  But then, I 
> > do not think that tools should be allowed to be _that_ married to 
> > particular implementations.  And indeed, I see no reason why a tool 
> > should access .dotest, except for accessing .dotest/patch, and then it 
> > will be very obvious where it fails.
> 
> Another reason might be something like:
> 
>   test -d .dotest && die "rebase or am already in progress"
> 
> which some of the git tools do, and which third party scripts might care 
> about.

Yep, for example this nice bash-completion addendum which changes the 
prompt according to the current repository's state.

I hope that a symlink .dotest -> .git/rebase (as I suggested in a reply to 
Martin) would help that, but in the long run I'd appreciate losing even 
that.

Ciao,
Dscho

P.S.: note that even a symlink would already help the situation described 
by Sam.

```

## Junio C Hamano, 2007-11-22 11:37

Subject: Re: Temporary directories getting errantly added into trees
Message-ID: <7vhcje5x55.fsf@gitster.siamese.dyndns.org>
URL: https://gitlist.dev/e/7vhcje5x55.fsf%40gitster.siamese.dyndns.org
In-Reply-To: <46a038f90711220301o1cbb16b7g79eea541f8ca5e58@mail.gmail.com>

```
"Martin Langhoff" <martin.langhoff@gmail.com> writes:

> when it comes to .dotest/patch, it must be reasonably accessible. When
> git-am refuses to apply a patch, and I am resolving things by hand, I
> need it pretty handy. I also sometimes edit .dotest/msg-clean.

Any serious "am" user shares the habit to edit .dotest/patch and
it would be VERY painful to change this, I suspect.

I do not mind shipping .dotest in the sample templates/info--exclude
file, though.

```

## Karl Hasselström, 2007-11-23 08:21

Subject: Re: Temporary directories getting errantly added into trees
Message-ID: <20071123082103.GA11236@diana.vm.bytemark.co.uk>
URL: https://gitlist.dev/e/20071123082103.GA11236%40diana.vm.bytemark.co.uk
In-Reply-To: <Pine.LNX.4.64.0711221052280.27959@racer.site>

```
On 2007-11-22 10:55:00 +0000, Johannes Schindelin wrote:

> But I don't know about QGit, StGit, etc...

I don't think StGit relies on the name of any file outside .git. (It
does pollute the root of the worktree with some temp files of its own,
though -- but not across invocations.)

-- 
Karl Hasselström, kha@treskal.com
      www.treskal.com/kalle

```

## Marco Costalba, 2007-11-23 14:44

Subject: Re: Temporary directories getting errantly added into trees
Message-ID: <e5bfff550711230644o3dd069b7r8346b95e79ff5c@mail.gmail.com>
URL: https://gitlist.dev/e/e5bfff550711230644o3dd069b7r8346b95e79ff5c%40mail.gmail.com
In-Reply-To: <Pine.LNX.4.64.0711221052280.27959@racer.site>

```
On Nov 22, 2007 11:55 AM, Johannes Schindelin
<Johannes.Schindelin@gmx.de> wrote:
>
> But I don't know about QGit, StGit, etc...
>

QGit does not rely on .dotest or any other temporary file produced by git

Interface with git is only through git commands.

Thanks
Marco

```

## Sam Vilain, 2007-11-24 00:07

Subject: Re: Temporary directories getting errantly added into trees
Message-ID: <47476B4B.6030906@vilain.net>
URL: https://gitlist.dev/e/47476B4B.6030906%40vilain.net
In-Reply-To: <20071123082103.GA11236@diana.vm.bytemark.co.uk>

```
Karl Hasselström wrote:
>> But I don't know about QGit, StGit, etc...
>>     
> I don't think StGit relies on the name of any file outside .git. (It
> does pollute the root of the worktree with some temp files of its own,
> though -- but not across invocations.)
>   

Yes, I've had to add .tmp_msg* to my .git/info/exclude for those, too. 
Given nothing cares, perhaps put them under .git anyway?

Sam.

```
