Git development
 help / color / mirror / Atom feed
* Re: Performance issue with excludes (was: Re: git-svn and submodules)
From: Linus Torvalds @ 2007-10-15 17:10 UTC (permalink / raw)
  To: Benoit SIGOURE; +Cc: git list
In-Reply-To: <45410184-8D7D-47ED-AB10-1A4E52D0ADB0@lrde.epita.fr>



On Mon, 15 Oct 2007, Benoit SIGOURE wrote:
> 
> There is no .gitignore, only .git/info/exclude.

They do exactly the same thing (apart from the nesting nature of 
.gitignore wrt subdirectories), so that doesn't change anything.

		Linus

^ permalink raw reply

* Re: Performance issue with excludes (was: Re: git-svn and submodules)
From: Benoit SIGOURE @ 2007-10-15 16:51 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: git list
In-Reply-To: <alpine.LFD.0.999.0710150928450.6887@woody.linux-foundation.org>

[-- Attachment #1: Type: text/plain, Size: 801 bytes --]

On Oct 15, 2007, at 6:34 PM, Linus Torvalds wrote:

> On Mon, 15 Oct 2007, Benoit SIGOURE wrote:
>>
>> I re-used the test that was posted some time ago:
>
> I think your test is scrogged. You should add the ".gitignore" file
> *before* you do the "git add .". That's when it's going to hurt (since
> that's when you have new files you don't yet know about).
>
> But then it should hurt only for the "git add ." phase, not for  
> anything
> else (unless we have the performance bug of doing the ignore  
> matching even
> on files we know about). And more importantly, it should hurt only  
> once
> (since afterwards, we'll know about the files and know not to ignore
> them).

There is no .gitignore, only .git/info/exclude.

-- 
Benoit Sigoure aka Tsuna
EPITA Research and Development Laboratory



[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 186 bytes --]

^ permalink raw reply

* Re: Performance issue with excludes (was: Re: git-svn and submodules)
From: Linus Torvalds @ 2007-10-15 16:34 UTC (permalink / raw)
  To: Benoit SIGOURE; +Cc: git list
In-Reply-To: <C7EA8AD7-BACA-4116-9C6B-90BA23F0005C@lrde.epita.fr>



On Mon, 15 Oct 2007, Benoit SIGOURE wrote:
> 
> I re-used the test that was posted some time ago:

I think your test is scrogged. You should add the ".gitignore" file 
*before* you do the "git add .". That's when it's going to hurt (since 
that's when you have new files you don't yet know about).

But then it should hurt only for the "git add ." phase, not for anything 
else (unless we have the performance bug of doing the ignore matching even 
on files we know about). And more importantly, it should hurt only once 
(since afterwards, we'll know about the files and know not to ignore 
them).

		Linus

^ permalink raw reply

* Re: git-svn and submodules
From: Andreas Ericsson @ 2007-10-15 16:27 UTC (permalink / raw)
  To: Benoit SIGOURE; +Cc: David Kastrup, git
In-Reply-To: <AA453A15-BBF1-4EA6-B1AC-1C4E00E89FB2@lrde.epita.fr>

Benoit SIGOURE wrote:
> On Oct 15, 2007, at 12:14 PM, David Kastrup wrote:
> 
>> Benoit SIGOURE <tsuna@lrde.epita.fr> writes:
>>
>>> This week I'm probably going to start to dive in git-svn by
>>> implementing simpler things first:
>>>   - git svn create-ignore (to create one .gitignore per directory
>>> from the svn:ignore properties.  This has the disadvantage of
>>> committing the .gitignore during the next dcommit, but when you
>>> import a repo with tons of ignores (>1000), using git svn show-ignore
>>> to build .git/info/exclude is *not* a good idea, because things like
>>> git-status will end up doing >1000 fnmatch *per file* in the repo,
>>> which leads to git-status taking more than 4s on my Core2Duo 2Ghz 2G
>>> RAM)
>>
>> Well, then this should be fixed in git general, by sorting the ignores
>> (wildcards in the first place where they can match), and then just
>> moving those patterns that can actually match according to sort order
>> to the list of fnmatch candidates (and moving those files that can't
>> match anymore die to the sort order out again).
>>
>> I don't think that the final "solution" for avoiding a lousy global
>> O(n^2) algorithm is to replace it with lousy local O(n^2) algorithms
>> and just hope for smaller values of n.
> 
> That's entirely true, it's more of a workaround than a real solution.  
> Anyways, there could be other situations in which someone would like to 
> generate the .gitignore instead of using .git/info/exclude, so this 
> feature could be useful anyways.
> 
> I can try to address this issue later, if I have enough free time in my 
> hands to do so.
> 

Ah, finally found the thread. I sent a core.ignorefile patch to the list
(Let users decide the name of the ignore file) a while ago, but didn't
find this mail to respond to. My apologies.

It's one way of solving it, which I'm currently using, although not so
fitting for when you're importing svn repos permanently.

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

^ permalink raw reply

* Performance issue with excludes (was: Re: git-svn and submodules)
From: Benoit SIGOURE @ 2007-10-15 16:17 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: git list
In-Reply-To: <alpine.LFD.0.999.0710150848380.6887@woody.linux-foundation.org>

[-- Attachment #1: Type: text/plain, Size: 3024 bytes --]

On Oct 15, 2007, at 5:53 PM, Linus Torvalds wrote:

> On Mon, 15 Oct 2007, Benoit SIGOURE wrote:
>>
>>  - git svn create-ignore (to create one .gitignore per directory  
>> from the
>> svn:ignore properties.  This has the disadvantage of committing  
>> the .gitignore
>> during the next dcommit, but when you import a repo with tons of  
>> ignores
>> (>1000), using git svn show-ignore to build .git/info/exclude is  
>> *not* a good
>> idea, because things like git-status will end up doing >1000  
>> fnmatch *per
>> file* in the repo, which leads to git-status taking more than 4s  
>> on my
>> Core2Duo 2Ghz 2G RAM)
>
> Ouch.
>
> That sounds largely unavoidable.. *But*.
>
> Maybe we have a bug here. In particular, we generally shouldn't  
> care about
> the exclude/.gitignore file for ay paths that we know about, which  
> means
> that during an import, we really shouldn't ever even care about
> .gitignore, since all the files are files we are expected to know  
> about.
>
> So yes, in general, "git status" is going to be slow in a tree that  
> has
> been built (since things like object files etc will have to be checked
> against the exclude list! (*)), but if it's a clean import with no
> generated files and only files we already know about, that should  
> not be
> the case.

I re-used the test that was posted some time ago:

------------------------------------------------------------------------ 
---
#
# first create a tree of roughly 100k files
#
mkdir bummer
cd bummer
for ((i=0;i<100;i++)); do
mkdir $i && pushd $i;
for ((j=0;j<1000;j++)); do
echo "$j" >$j; done; popd;
done

#
# init and add this to git
#
time git init
git config user.email "no@thx"
git config user.name "nothx"
time git add .
time git commit -m 'buurrrrn' -a

for ((j=0;j<1000;j++)); do
   echo "/pattern$j" >.git/info/exclude
done

#
# git-status, tunes in at around ~8s for me
#
time git-status
time git-status
time git-status
------------------------------------------------------------------------ 
---

[...]
git commit -m 'buurrrrn' -a  5.62s user 16.84s system 87% cpu 25.634  
total
# On branch master
nothing to commit (working directory clean)
git-status  2.48s user 5.97s system 96% cpu 8.718 total
# On branch master
nothing to commit (working directory clean)
git-status  2.48s user 5.94s system 97% cpu 8.646 total
# On branch master
nothing to commit (working directory clean)
git-status  2.48s user 5.95s system 96% cpu 8.720 total

My machine is a Core2Duo 2Ghz 2G RAM.

>
> So maybe we have a totally unnecessary performance issue, and do  
> all the
> fnmatch() on every path, whether we know about it or not?
>
> 		Linus
>
> (*) It might be that we could also re-order the exclude list so that
> entries that trigger are moved to the head of the list, because it's
> likely that if you have tons of exclude entries, some of them  
> trigger a
> lot more than others (ie "*.o"), and trying those first is likely a  
> good
> idea.

-- 
Benoit Sigoure aka Tsuna
EPITA Research and Development Laboratory



[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 186 bytes --]

^ permalink raw reply

* [PATCH] Make the output of "git svn clone" less confusing.
From: David Kågedal @ 2007-10-15 15:21 UTC (permalink / raw)
  To: git

The problem is that the first thing it prints is

  Initialized empty Git repository in .git/

even if actually created a subdirectory and changed into it first. But to the
user, it looks like it is creating a .git/ dir in the directory he/she is
started git from.
---
 git-svn.perl |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

This change makes it more chatty, which might not be a good thing. But
I think the previous output was worse.

diff --git a/git-svn.perl b/git-svn.perl
index 777e436..d4450ca 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -286,6 +286,7 @@ sub do_git_init_db {
 
 sub init_subdir {
 	my $repo_path = shift or return;
+	print "Creating directory $repo_path\n";
 	mkpath([$repo_path]) unless -d $repo_path;
 	chdir $repo_path or die "Couldn't chdir to $repo_path: $!\n";
 	$ENV{GIT_DIR} = '.git';
-- 
1.5.3.4.213.gb3127-dirty

-- 
David Kågedal

^ permalink raw reply related

* Re: git-svn and submodules
From: Linus Torvalds @ 2007-10-15 15:53 UTC (permalink / raw)
  To: Benoit SIGOURE; +Cc: Eric Wong, git list, Johannes Schindelin
In-Reply-To: <05CAB148-56ED-4FF1-8AAB-4BA2A0B70C2C@lrde.epita.fr>



On Mon, 15 Oct 2007, Benoit SIGOURE wrote:
>
>  - git svn create-ignore (to create one .gitignore per directory from the
> svn:ignore properties.  This has the disadvantage of committing the .gitignore
> during the next dcommit, but when you import a repo with tons of ignores
> (>1000), using git svn show-ignore to build .git/info/exclude is *not* a good
> idea, because things like git-status will end up doing >1000 fnmatch *per
> file* in the repo, which leads to git-status taking more than 4s on my
> Core2Duo 2Ghz 2G RAM)

Ouch.

That sounds largely unavoidable.. *But*.

Maybe we have a bug here. In particular, we generally shouldn't care about 
the exclude/.gitignore file for ay paths that we know about, which means 
that during an import, we really shouldn't ever even care about 
.gitignore, since all the files are files we are expected to know about.

So yes, in general, "git status" is going to be slow in a tree that has 
been built (since things like object files etc will have to be checked 
against the exclude list! (*)), but if it's a clean import with no 
generated files and only files we already know about, that should not be 
the case.

So maybe we have a totally unnecessary performance issue, and do all the 
fnmatch() on every path, whether we know about it or not?

		Linus

(*) It might be that we could also re-order the exclude list so that 
entries that trigger are moved to the head of the list, because it's 
likely that if you have tons of exclude entries, some of them trigger a 
lot more than others (ie "*.o"), and trying those first is likely a good 
idea.

^ permalink raw reply

* Re: git blame crashes with internal error
From: Linus Torvalds @ 2007-10-15 15:39 UTC (permalink / raw)
  To: Bj?rn Steinbrink; +Cc: gitster, git
In-Reply-To: <20071014143628.GA22568@atjola.homenet>



On Sun, 14 Oct 2007, Bj?rn Steinbrink wrote:
> 
> git blame just decided to crash on me, when I tried to use it while
> resolving a merge conflict.

Yes. What's going on is that "ce_mode = 0" is a magic marker for an 
unmerged entry (set up by things like diff-lib.c:do_diff_cache() and 
builtin-read-tree.c:read_tree_unmerged()) and the ce_match_stat_basic() 
function gets upset about this.

I'm not entirely sure that the whole "ce_mode = 0" case is a good idea to 
begin with, and maybe the right thing to do is to remove that horrid 
freakish special case, but removing the internal error seems to be the 
simplest fix for now.

		Linus

---
 read-cache.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/read-cache.c b/read-cache.c
index 56202d1..3b11aa7 100644
--- a/read-cache.c
+++ b/read-cache.c
@@ -149,6 +149,8 @@ static int ce_match_stat_basic(struct cache_entry *ce, struct stat *st)
 		else if (ce_compare_gitlink(ce))
 			changed |= DATA_CHANGED;
 		return changed;
+	case 0:		/* Special case: unmerged file in index */
+		return MODE_CHANGED | DATA_CHANGED | TYPE_CHANGED;
 	default:
 		die("internal error: ce_mode is %o", ntohl(ce->ce_mode));
 	}

^ permalink raw reply related

* .gitignore and svn:ignore [WAS: git-svn and submodules]
From: Chris Shoemaker @ 2007-10-15 15:14 UTC (permalink / raw)
  To: Karl Hasselström
  Cc: Benoit SIGOURE, Eric Wong, git list, Johannes Schindelin
In-Reply-To: <20071015144513.GB7351@diana.vm.bytemark.co.uk>

On Mon, Oct 15, 2007 at 04:45:13PM +0200, Karl Hasselström wrote:
> On 2007-10-15 09:07:21 +0200, Benoit SIGOURE wrote:
> 
> >   - git svn create-ignore (to create one .gitignore per directory
> > from the svn:ignore properties. This has the disadvantage of
> > committing the .gitignore during the next dcommit,
> 
> I built ignore support for git-svnignore a long time ago. It converts
> the per-directory svn:ignore to per-directory .gitignore at commit
> import time, which is very handy:
> 
> -I <ignorefile_name>::
>         Import the svn:ignore directory property to files with this
>         name in each directory. (The Subversion and GIT ignore
>         syntaxes are similar enough that using the Subversion patterns
>         directly with "-I .gitignore" will almost always just work.)
> 
> The only downside with that is that svn ignore patterns are
> non-recursive, while git ignore patterns are recursive. This could be
> solved by prefixing them with a "/".

Has anyone put any thought into mapping the other direction? 
i.e. .gitignore  ->  svn:ignore

-chris

^ permalink raw reply

* Re: [PATCH] [BUG FIXED 2] git-add (-a|-u)  and -n support
From: Johannes Schindelin @ 2007-10-15 14:54 UTC (permalink / raw)
  To: Michael Witten; +Cc: git, Karl Hasselström
In-Reply-To: <85EE4C64-2174-45D3-A459-69746C9CD51C@mit.edu>

Hi,

On Mon, 15 Oct 2007, Michael Witten wrote:

> When is Junio coming back? I know I know... Look through the archives. 
> :-P-

It's not in the archives.  Just send your stuff, and let the list be a 
filter for Junio.  He'll be overwhelmed with the amount of emails already.

If I were to give him some advice, it would be to just delete all git list 
mails in his inbox and ask for people to resend their latest and greatest, 
_after_ he had a look at what Lars collected.

Ciao,
Dscho

^ permalink raw reply

* Re: [PATCH] [BUG FIXED 2] git-add (-a|-u)  and -n support
From: Michael Witten @ 2007-10-15 14:47 UTC (permalink / raw)
  To: git; +Cc: Karl Hasselström
In-Reply-To: <20071015143137.GA7351@diana.vm.bytemark.co.uk>


On 15 Oct 2007, at 10:31:37 AM, Karl Hasselström wrote:

> On 2007-10-14 18:00:44 -0400, Michael Witten wrote:
>
>> Here's compromise that is backwards compatible. For both git-add and
>> git-commit:
>>
>>       -a dir [dir2 ...] => all changes in the given dirs.
>>       -a                => all changes from the root.
>>
>> Then we can just leave -u in place for now, and mark it as
>> deprecated.
>>
>> In any case, the goal is to make the intuition solid between
>> git-commit and git-add.
>
> As I recall, Junio had some specific reason for calling the flag -u
> instead of -a. Search in the list archive for the patch that
> introduced the flag, or wait till he gets back and ask him.

I have a feeling it was because -u currently just updates modified
files in the current directory, while -a updated all modified files.

Fortunately, the suggestion above does not break anything.

Michael Witten

P.S.
When is Junio coming back? I know I know... Look through the  
archives. :-P

^ permalink raw reply

* Re: git-svn and submodules
From: Karl Hasselström @ 2007-10-15 14:45 UTC (permalink / raw)
  To: Benoit SIGOURE; +Cc: Eric Wong, git list, Johannes Schindelin
In-Reply-To: <05CAB148-56ED-4FF1-8AAB-4BA2A0B70C2C@lrde.epita.fr>

On 2007-10-15 09:07:21 +0200, Benoit SIGOURE wrote:

>   - git svn create-ignore (to create one .gitignore per directory
> from the svn:ignore properties. This has the disadvantage of
> committing the .gitignore during the next dcommit,

I built ignore support for git-svnignore a long time ago. It converts
the per-directory svn:ignore to per-directory .gitignore at commit
import time, which is very handy:

-I <ignorefile_name>::
        Import the svn:ignore directory property to files with this
        name in each directory. (The Subversion and GIT ignore
        syntaxes are similar enough that using the Subversion patterns
        directly with "-I .gitignore" will almost always just work.)

The only downside with that is that svn ignore patterns are
non-recursive, while git ignore patterns are recursive. This could be
solved by prefixing them with a "/".

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

^ permalink raw reply

* Re: [PATCH] [BUG FIXED 2] git-add (-a|-u)  and -n support
From: Karl Hasselström @ 2007-10-15 14:31 UTC (permalink / raw)
  To: Michael Witten; +Cc: git, Matthieu Moy
In-Reply-To: <D44B7811-5A0F-4A31-9DB3-6D2BF645E543@MIT.EDU>

On 2007-10-14 18:00:44 -0400, Michael Witten wrote:

> Here's compromise that is backwards compatible. For both git-add and
> git-commit:
>
>       -a dir [dir2 ...] => all changes in the given dirs.
>       -a                => all changes from the root.
>
> Then we can just leave -u in place for now, and mark it as
> deprecated.
>
> In any case, the goal is to make the intuition solid between
> git-commit and git-add.

As I recall, Junio had some specific reason for calling the flag -u
instead of -a. Search in the list archive for the patch that
introduced the flag, or wait till he gets back and ask him.

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

^ permalink raw reply

* Re: RCS keyword expansion
From: Johannes Schindelin @ 2007-10-15 14:28 UTC (permalink / raw)
  To: Peter Karlsson; +Cc: git
In-Reply-To: <Pine.LNX.4.64.0710151457131.1901@ds9.cixit.se>

Hi,

On Mon, 15 Oct 2007, Peter Karlsson wrote:

> I wrote:
>
> > Finding out which commit last changed that file is slow.  That's why 
> > it breaks down.
> 
> That might be, but it only needs to be done when a file is updated.

Almost.

It also needs to be updated when switching branches.  For every file.  
Since the commit blamed for the current version could be different for 
every file.

> > You are just to used to CVS/SVN to see that there is a much better way 
> > in git.
> 
> I can see that favouring the argument that having a $Id$ that gives me 
> the global state id when the file was last updated is a bad idea. Fair 
> enough. Give me a local state tham (which you did, hash id for the file 
> contents).
> 
> My problem now is the file date. That could possibly be fixed by having 
> it updated before I check in the file.
> 
> 
> So, to summarize, if I've understood the responses here correctly, what
> I really want is:
> 
>  on commit:
>   - replace "$Date$" (or whatever) with the current time.

I think that would be more "on edit".

>   - store the contents.
> 
>  on checkout:
>   - update the file.
>   - replace "$Id$" (ditto) with a magic identifier for the file state.
>   - update git's state so that it doesn't see the "$Id$" expansion
>     as a change in the file contents.
> 
> Now the question is: Where can I find documentation on how to do this
> (i.e what should I search for--"hooks"?)?

For the $Id$ thing: Documentation/gitattributes.txt.  For the $Date$ 
thing: Documentation/hooks.txt, and Documentation/git-rev-list.txt.  
You'll need to roll your own thing there, since Git oldtimers feel that 
what you want to do is the wrong thing (see Randal's comment on generating 
it as part of the build process).

What you want to do might be frowned upon by many on the list, but it is 
certainly doable.  See ExampleScripts on the wiki for inspiration.

> And, if this goes into the ".git" directory, can I still have it 
> replicated when I clone a repository? I noticed that my ".git/ignore" 
> file wasn't replicated and that I had to replace it with a local 
> ".gitignore" to get it under version control.

No, there is not way to have it replicated into the .git directory.  The 
common way would be to either have it installed as templates, so that 
every user of yours gets them automatically, or to check them in under 
different names, and make every user install them by hand.

The rationale: every cloner is free to choose what hooks she wants to run.  
So checking in such hooks is always understood as suggestion what hooks 
to install.

Ciao,
Dscho

^ permalink raw reply

* Re: [PATCH 2/3] Quoting paths in tests
From: David Kastrup @ 2007-10-15 14:03 UTC (permalink / raw)
  To: git
In-Reply-To: <47136F71.1050107@viscovery.net>

Johannes Sixt <j.sixt@viscovery.net> writes:

> Jonathan del Strother schrieb:
>> -	svn import -m 'import for git-svn' . $svnrepo >/dev/null &&
>> +	svn import -m 'import for git-svn' . '$svnrepo' >/dev/null &&
>>  	cd .. &&
>>  	rm -rf import &&
>> -	git-svn init $svnrepo"
>> +	git-svn init '$svnrepo'"
>
> I don't see the point in changing an incorrect quoting to a different
> incorrect quoting that you fix up in a follow-up patch. It's *two*
> large patches to review instead of just one. I'm stopping the review
> here.

Since I consider it unlikely that Jonathan is making your life harder
on purpose, it might be somewhat more helpful to offer submission
advice:

Jonathan, try

git rebase -i HEAD~3

or so in order to consolidate the last 3 patches you did.  Interactive
rebase is one useful manner of munging history until it looks
reasonably nice for submission.  One major point of git's distributed
operation is that one can clean up the development history locally
before handing things out.

That makes the project repositories cleaner to understand.

-- 
David Kastrup

^ permalink raw reply

* Re: [PATCH 2/3] Quoting paths in tests
From: Johannes Sixt @ 2007-10-15 14:17 UTC (permalink / raw)
  To: Jonathan del Strother; +Cc: git
In-Reply-To: <8977E4C2-2C13-4C52-8FD9-CEEB5AA85B70@steelskies.com>

Jonathan del Strother schrieb:
> On 15 Oct 2007, at 14:47, Johannes Sixt wrote:
>> I don't see the point in changing an incorrect quoting to a different 
>> incorrect quoting that you fix up in a follow-up patch. It's *two* 
>> large patches to review instead of just one. I'm stopping the review 
>> here.
> 
> If we want to support apostrophed paths in tests,

I could ask, "if we want to support paths with blanks in tests", so...

> I'll flatten 2 & 3 
> into a single patch.  I thought I'd make the apostrophe part optional 
> since there seemed to be some resistance to having to bother about 
> quoting & escaping in tests..

You could also make a patch that reverses the quoting in t9100-* (and 
probably others), i.e. instead of

	"... '$foo'..." (which is incorrect)
or
	"... \"$foo\"..."
make it
	'... "$foo" ...'

It will be a large patch, too, but the result should be easier to read.

-- Hannes

^ permalink raw reply

* Re: RCS keyword expansion
From: Peter Karlsson @ 2007-10-15 14:03 UTC (permalink / raw)
  To: git; +Cc: Johannes Schindelin
In-Reply-To: <Pine.LNX.4.64.0710121231410.25221@racer.site>

Hi!

> Finding out which commit last changed that file is slow.  That's why
> it breaks down.

That might be, but it only needs to be done when a file is updated.

> You are just to used to CVS/SVN to see that there is a much better
> way in git.

I can see that favouring the argument that having a $Id$ that gives me
the global state id when the file was last updated is a bad idea. Fair
enough. Give me a local state tham (which you did, hash id for the file
contents).

My problem now is the file date. That could possibly be fixed by having
it updated before I check in the file.


So, to summarize, if I've understood the responses here correctly, what
I really want is:

 on commit:
  - replace "$Date$" (or whatever) with the current time.
  - store the contents.

 on checkout:
  - update the file.
  - replace "$Id$" (ditto) with a magic identifier for the file state.
  - update git's state so that it doesn't see the "$Id$" expansion
    as a change in the file contents.

Now the question is: Where can I find documentation on how to do this
(i.e what should I search for--"hooks"?)?

And, if this goes into the ".git" directory, can I still have it
replicated when I clone a repository? I noticed that my ".git/ignore"
file wasn't replicated and that I had to replace it with a local
".gitignore" to get it under version control.

-- 
\\// Peter - http://www.softwolves.pp.se/

^ permalink raw reply

* Re: [PATCH 2/3] Quoting paths in tests
From: Jonathan del Strother @ 2007-10-15 14:00 UTC (permalink / raw)
  To: Johannes Sixt; +Cc: git
In-Reply-To: <47136F71.1050107@viscovery.net>

On 15 Oct 2007, at 14:47, Johannes Sixt wrote:

> Jonathan del Strother schrieb:
>> -	svn import -m 'import for git-svn' . $svnrepo >/dev/null &&
>> +	svn import -m 'import for git-svn' . '$svnrepo' >/dev/null &&
>> 	cd .. &&
>> 	rm -rf import &&
>> -	git-svn init $svnrepo"
>> +	git-svn init '$svnrepo'"
>
> I don't see the point in changing an incorrect quoting to a  
> different incorrect quoting that you fix up in a follow-up patch.  
> It's *two* large patches to review instead of just one. I'm stopping  
> the review here.

If we want to support apostrophed paths in tests, I'll flatten 2 & 3  
into a single patch.  I thought I'd make the apostrophe part optional  
since there seemed to be some resistance to having to bother about  
quoting & escaping in tests..

^ permalink raw reply

* [PATCH] Fix compilation with NO_CURL
From: Johannes Schindelin @ 2007-10-15 13:52 UTC (permalink / raw)
  To: git, hjemli, gitster


There were a few places which did not cope well without curl.  This
fixes all of them.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 transport.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/transport.c b/transport.c
index 6fe6ec8..438b557 100644
--- a/transport.c
+++ b/transport.c
@@ -1,7 +1,9 @@
 #include "cache.h"
 #include "transport.h"
 #include "run-command.h"
+#ifndef NO_CURL
 #include "http.h"
+#endif
 #include "pkt-line.h"
 #include "fetch-pack.h"
 #include "walker.h"
@@ -368,6 +370,7 @@ static int disconnect_walker(struct transport *transport)
 	return 0;
 }
 
+#ifndef NO_CURL
 static int curl_transport_push(struct transport *transport, int refspec_nr, const char **refspec, int flags) {
 	const char **argv;
 	int argc;
@@ -400,7 +403,6 @@ static int curl_transport_push(struct transport *transport, int refspec_nr, cons
 	return !!err;
 }
 
-#ifndef NO_CURL
 static int missing__target(int code, int result)
 {
 	return	/* file:// URL -- do we ever use one??? */
@@ -730,6 +732,7 @@ struct transport *transport_get(struct remote *remote, const char *url)
 		ret->fetch = fetch_objs_via_rsync;
 		ret->push = rsync_transport_push;
 
+#ifndef NO_CURL
 	} else if (!prefixcmp(url, "http://")
 	        || !prefixcmp(url, "https://")
 	        || !prefixcmp(url, "ftp://")) {
@@ -737,6 +740,7 @@ struct transport *transport_get(struct remote *remote, const char *url)
 		ret->fetch = fetch_objs_via_curl;
 		ret->push = curl_transport_push;
 		ret->disconnect = disconnect_walker;
+#endif
 
 	} else if (is_local(url) && is_file(url)) {
 		struct bundle_transport_data *data = xcalloc(1, sizeof(*data));
-- 
1.5.3.GIT

^ permalink raw reply related

* Re: [PATCH 2/3] Quoting paths in tests
From: Johannes Sixt @ 2007-10-15 13:47 UTC (permalink / raw)
  To: Jonathan del Strother; +Cc: git, Jonathan del Strother
In-Reply-To: <11924540291536-git-send-email-maillist@steelskies.com>

Jonathan del Strother schrieb:
> -	svn import -m 'import for git-svn' . $svnrepo >/dev/null &&
> +	svn import -m 'import for git-svn' . '$svnrepo' >/dev/null &&
>  	cd .. &&
>  	rm -rf import &&
> -	git-svn init $svnrepo"
> +	git-svn init '$svnrepo'"

I don't see the point in changing an incorrect quoting to a different 
incorrect quoting that you fix up in a follow-up patch. It's *two* large 
patches to review instead of just one. I'm stopping the review here.

-- Hannes

^ permalink raw reply

* Re: [PATCH 1/3] Fixing path quoting in git-rebase
From: Johannes Sixt @ 2007-10-15 13:39 UTC (permalink / raw)
  To: Jonathan del Strother; +Cc: git, Jonathan del Strother
In-Reply-To: <11924540292687-git-send-email-maillist@steelskies.com>

Jonathan del Strother schrieb:
> -	eval GITHEAD_$hd='"$(cat $dotest/onto_name)"'
> +	eval GITHEAD_$hd='"$(cat \"$dotest/onto_name\")"'

I believe this is not correct. It should be this way:

	eval GITHEAD_$hd='$(cat "$dotest/onto_name")'

You can test it with a conflicting git-rebase -m. It only affects what the 
conflict markers look like. The test suite does not test it.

The rest looks good.

-- Hannes

^ permalink raw reply

* [PATCH 2/3] Quoting paths in tests
From: Jonathan del Strother @ 2007-10-15 13:13 UTC (permalink / raw)
  To: git; +Cc: Jonathan del Strother
In-Reply-To: <4711486B.1050301@op5.se>

From: Jonathan del Strother <jon.delStrother@bestbefore.tv>

Add quoting to various test paths so they can be run from a path with a space in

Signed-off-by: Jonathan del Strother <jon.delStrother@bestbefore.tv>
---
 t/lib-git-svn.sh                         |    2 +-
 t/t1020-subdirectory.sh                  |   22 ++++++------
 t/t3050-subprojects-fetch.sh             |    2 +-
 t/t3404-rebase-interactive.sh            |    2 +-
 t/t5500-fetch-pack.sh                    |    2 +-
 t/t5700-clone-reference.sh               |    2 +-
 t/t7003-filter-branch.sh                 |    2 +-
 t/t7501-commit.sh                        |    4 +-
 t/t9100-git-svn-basic.sh                 |   18 +++++-----
 t/t9101-git-svn-props.sh                 |    6 ++--
 t/t9102-git-svn-deep-rmdir.sh            |    6 ++--
 t/t9104-git-svn-follow-parent.sh         |   50 +++++++++++++++---------------
 t/t9105-git-svn-commit-diff.sh           |   10 +++---
 t/t9106-git-svn-commit-diff-clobber.sh   |   14 ++++----
 t/t9107-git-svn-migrate.sh               |   40 ++++++++++++------------
 t/t9108-git-svn-glob.sh                  |    8 ++--
 t/t9110-git-svn-use-svm-props.sh         |    8 ++--
 t/t9111-git-svn-use-svnsync-props.sh     |    8 ++--
 t/t9112-git-svn-md5less-file.sh          |    4 +-
 t/t9113-git-svn-dcommit-new-file.sh      |    6 ++--
 t/t9114-git-svn-dcommit-merge.sh         |    4 +-
 t/t9115-git-svn-dcommit-funky-renames.sh |    4 +-
 t/t9116-git-svn-log.sh                   |    4 +-
 t/t9500-gitweb-standalone-no-errors.sh   |    4 +-
 t/test-lib.sh                            |    2 +-
 25 files changed, 117 insertions(+), 117 deletions(-)

diff --git a/t/lib-git-svn.sh b/t/lib-git-svn.sh
index 8d4a447..cde3053 100644
--- a/t/lib-git-svn.sh
+++ b/t/lib-git-svn.sh
@@ -25,7 +25,7 @@ perl -w -e "
 use SVN::Core;
 use SVN::Repos;
 \$SVN::Core::VERSION gt '1.1.0' or exit(42);
-system(qw/svnadmin create --fs-type fsfs/, '$svnrepo') == 0 or exit(41);
+system(qw/svnadmin create --fs-type fsfs/, \"$svnrepo\") == 0 or exit(41);
 " >&3 2>&4
 x=$?
 if test $x -ne 0
diff --git a/t/t1020-subdirectory.sh b/t/t1020-subdirectory.sh
index b9cef34..5ed7fa4 100755
--- a/t/t1020-subdirectory.sh
+++ b/t/t1020-subdirectory.sh
@@ -21,7 +21,7 @@ LF='
 '
 
 test_expect_success 'update-index and ls-files' '
-	cd $HERE &&
+	cd "$HERE" &&
 	git update-index --add one &&
 	case "`git ls-files`" in
 	one) echo ok one ;;
@@ -41,7 +41,7 @@ test_expect_success 'update-index and ls-files' '
 '
 
 test_expect_success 'cat-file' '
-	cd $HERE &&
+	cd "$HERE" &&
 	two=`git ls-files -s dir/two` &&
 	two=`expr "$two" : "[0-7]* \\([0-9a-f]*\\)"` &&
 	echo "$two" &&
@@ -54,7 +54,7 @@ test_expect_success 'cat-file' '
 rm -f actual dir/actual
 
 test_expect_success 'diff-files' '
-	cd $HERE &&
+	cd "$HERE" &&
 	echo a >>one &&
 	echo d >>dir/two &&
 	case "`git diff-files --name-only`" in
@@ -74,7 +74,7 @@ test_expect_success 'diff-files' '
 '
 
 test_expect_success 'write-tree' '
-	cd $HERE &&
+	cd "$HERE" &&
 	top=`git write-tree` &&
 	echo $top &&
 	cd dir &&
@@ -84,7 +84,7 @@ test_expect_success 'write-tree' '
 '
 
 test_expect_success 'checkout-index' '
-	cd $HERE &&
+	cd "$HERE" &&
 	git checkout-index -f -u one &&
 	cmp one original.one &&
 	cd dir &&
@@ -93,7 +93,7 @@ test_expect_success 'checkout-index' '
 '
 
 test_expect_success 'read-tree' '
-	cd $HERE &&
+	cd "$HERE" &&
 	rm -f one dir/two &&
 	tree=`git write-tree` &&
 	git read-tree --reset -u "$tree" &&
@@ -107,27 +107,27 @@ test_expect_success 'read-tree' '
 '
 
 test_expect_success 'no file/rev ambiguity check inside .git' '
-	cd $HERE &&
+	cd "$HERE" &&
 	git commit -a -m 1 &&
-	cd $HERE/.git &&
+	cd "$HERE/.git" &&
 	git show -s HEAD
 '
 
 test_expect_success 'no file/rev ambiguity check inside a bare repo' '
-	cd $HERE &&
+	cd "$HERE" &&
 	git clone -s --bare .git foo.git &&
 	cd foo.git && GIT_DIR=. git show -s HEAD
 '
 
 # This still does not work as it should...
 : test_expect_success 'no file/rev ambiguity check inside a bare repo' '
-	cd $HERE &&
+	cd "$HERE" &&
 	git clone -s --bare .git foo.git &&
 	cd foo.git && git show -s HEAD
 '
 
 test_expect_success 'detection should not be fooled by a symlink' '
-	cd $HERE &&
+	cd "$HERE" &&
 	rm -fr foo.git &&
 	git clone -s .git another &&
 	ln -s another yetanother &&
diff --git a/t/t3050-subprojects-fetch.sh b/t/t3050-subprojects-fetch.sh
index 34f26a8..4b74cc6 100755
--- a/t/t3050-subprojects-fetch.sh
+++ b/t/t3050-subprojects-fetch.sh
@@ -20,7 +20,7 @@ test_expect_success setup '
 '
 
 test_expect_success clone '
-	git clone file://`pwd`/.git cloned &&
+	git clone "file://`pwd`/.git" cloned &&
 	(git rev-parse HEAD; git ls-files -s) >expected &&
 	(
 		cd cloned &&
diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh
index 1113904..aa86042 100755
--- a/t/t3404-rebase-interactive.sh
+++ b/t/t3404-rebase-interactive.sh
@@ -92,7 +92,7 @@ done
 EOF
 
 chmod a+x fake-editor.sh
-VISUAL="$(pwd)/fake-editor.sh"
+VISUAL="\"$(pwd)/fake-editor.sh\""
 export VISUAL
 
 test_expect_success 'no changes are a nop' '
diff --git a/t/t5500-fetch-pack.sh b/t/t5500-fetch-pack.sh
index 7b6798d..5489ffe 100755
--- a/t/t5500-fetch-pack.sh
+++ b/t/t5500-fetch-pack.sh
@@ -129,7 +129,7 @@ pull_to_client 2nd "B" $((64*3))
 
 pull_to_client 3rd "A" $((1*3)) # old fails
 
-test_expect_success "clone shallow" "git-clone --depth 2 file://`pwd`/. shallow"
+test_expect_success "clone shallow" "git-clone --depth 2 \"file://`pwd`/.\" shallow"
 
 (cd shallow; git count-objects -v) > count.shallow
 
diff --git a/t/t5700-clone-reference.sh b/t/t5700-clone-reference.sh
index 4e93aaa..8bb34f9 100755
--- a/t/t5700-clone-reference.sh
+++ b/t/t5700-clone-reference.sh
@@ -51,7 +51,7 @@ diff expected current'
 cd "$base_dir"
 
 test_expect_success 'cloning with reference (no -l -s)' \
-'git clone --reference B file://`pwd`/A D'
+'git clone --reference B "file://`pwd`/A" D'
 
 cd "$base_dir"
 
diff --git a/t/t7003-filter-branch.sh b/t/t7003-filter-branch.sh
index e935b20..1ab5392 100755
--- a/t/t7003-filter-branch.sh
+++ b/t/t7003-filter-branch.sh
@@ -107,7 +107,7 @@ test_expect_success 'use index-filter to move into a subdirectory' '
 		 "git ls-files -s | sed \"s-\\t-&newsubdir/-\" |
 	          GIT_INDEX_FILE=\$GIT_INDEX_FILE.new \
 			git update-index --index-info &&
-		  mv \$GIT_INDEX_FILE.new \$GIT_INDEX_FILE" directorymoved &&
+		  mv \"\$GIT_INDEX_FILE.new\" \"\$GIT_INDEX_FILE\"" directorymoved &&
 	test -z "$(git diff HEAD directorymoved:newsubdir)"'
 
 test_expect_success 'stops when msg filter fails' '
diff --git a/t/t7501-commit.sh b/t/t7501-commit.sh
index b151b51..e97e756 100644
--- a/t/t7501-commit.sh
+++ b/t/t7501-commit.sh
@@ -69,7 +69,7 @@ test_expect_success \
 
 cat >editor <<\EOF
 #!/bin/sh
-sed -i -e "s/a file/an amend commit/g" $1
+sed -i -e "s/a file/an amend commit/g" "$1"
 EOF
 chmod 755 editor
 
@@ -88,7 +88,7 @@ test_expect_success \
 
 cat >editor <<\EOF
 #!/bin/sh
-sed -i -e "s/amend/older/g" $1
+sed -i -e "s/amend/older/g" "$1"
 EOF
 chmod 755 editor
 
diff --git a/t/t9100-git-svn-basic.sh b/t/t9100-git-svn-basic.sh
index 614cf50..c3585da 100755
--- a/t/t9100-git-svn-basic.sh
+++ b/t/t9100-git-svn-basic.sh
@@ -31,16 +31,16 @@ test_expect_success \
 	echo 'zzz' > bar/zzz &&
 	echo '#!/bin/sh' > exec.sh &&
 	chmod +x exec.sh &&
-	svn import -m 'import for git-svn' . $svnrepo >/dev/null &&
+	svn import -m 'import for git-svn' . '$svnrepo' >/dev/null &&
 	cd .. &&
 	rm -rf import &&
-	git-svn init $svnrepo"
+	git-svn init '$svnrepo'"
 
 test_expect_success \
     'import an SVN revision into git' \
     'git-svn fetch'
 
-test_expect_success "checkout from svn" "svn co $svnrepo '$SVN_TREE'"
+test_expect_success "checkout from svn" "svn co '$svnrepo' '$SVN_TREE'"
 
 name='try a deep --rmdir with a commit'
 test_expect_success "$name" "
@@ -169,7 +169,7 @@ test_expect_success "$name" "
 	svn up '$SVN_TREE' &&
 	test -f '$SVN_TREE'/exec-2.sh &&
 	test ! -L '$SVN_TREE'/exec-2.sh &&
-	git diff help $SVN_TREE/exec-2.sh"
+	git diff help '$SVN_TREE/exec-2.sh'"
 
 if test "$have_utf8" = t
 then
@@ -190,7 +190,7 @@ name='test fetch functionality (svn => git) with alternate GIT_SVN_ID'
 GIT_SVN_ID=alt
 export GIT_SVN_ID
 test_expect_success "$name" \
-    "git-svn init $svnrepo && git-svn fetch &&
+    "git-svn init '$svnrepo' && git-svn fetch &&
      git rev-list --pretty=raw remotes/git-svn | grep ^tree | uniq > a &&
      git rev-list --pretty=raw remotes/alt | grep ^tree | uniq > b &&
      git diff a b"
@@ -220,16 +220,16 @@ test_expect_failure 'exit if remote refs are ambigious' "
         "
 
 test_expect_failure 'exit if init-ing a would clobber a URL' "
-        svnadmin create ${PWD}/svnrepo2 &&
-        svn mkdir -m 'mkdir bar' ${svnrepo}2/bar &&
+        svnadmin create '${PWD}/svnrepo2' &&
+        svn mkdir -m 'mkdir bar' '${svnrepo}2/bar' &&
         git config --unset svn-remote.svn.fetch \
                                 '^bar:refs/remotes/git-svn$' &&
-        git-svn init ${svnrepo}2/bar
+        git-svn init '${svnrepo}2/bar'
         "
 
 test_expect_success \
   'init allows us to connect to another directory in the same repo' "
-        git-svn init --minimize-url -i bar $svnrepo/bar &&
+        git-svn init --minimize-url -i bar '$svnrepo/bar' &&
         git config --get svn-remote.svn.fetch \
                               '^bar:refs/remotes/bar$' &&
         git config --get svn-remote.svn.fetch \
diff --git a/t/t9101-git-svn-props.sh b/t/t9101-git-svn-props.sh
index 5aac644..a1c85e0 100755
--- a/t/t9101-git-svn-props.sh
+++ b/t/t9101-git-svn-props.sh
@@ -52,7 +52,7 @@ EOF
 cd ..
 
 rm -rf import
-test_expect_success 'checkout working copy from svn' "svn co $svnrepo test_wc"
+test_expect_success 'checkout working copy from svn' "svn co '$svnrepo' test_wc"
 test_expect_success 'setup some commits to svn' \
 	'cd test_wc &&
 		echo Greetings >> kw.c &&
@@ -66,7 +66,7 @@ test_expect_success 'setup some commits to svn' \
 		svn commit -m "Propset Id" &&
 	cd ..'
 
-test_expect_success 'initialize git-svn' "git-svn init $svnrepo"
+test_expect_success 'initialize git-svn' "git-svn init '$svnrepo'"
 test_expect_success 'fetch revisions from svn' 'git-svn fetch'
 
 name='test svn:keywords ignoring'
@@ -92,7 +92,7 @@ test_expect_success "propset CR on crlf files" \
 test_expect_success 'fetch and pull latest from svn and checkout a new wc' \
 	"git-svn fetch &&
 	 git pull . remotes/git-svn &&
-	 svn co $svnrepo new_wc"
+	 svn co '$svnrepo' new_wc"
 
 for i in crlf ne_crlf lf ne_lf cr ne_cr empty_cr empty_lf empty empty_crlf
 do
diff --git a/t/t9102-git-svn-deep-rmdir.sh b/t/t9102-git-svn-deep-rmdir.sh
index 4e08083..99c8840 100755
--- a/t/t9102-git-svn-deep-rmdir.sh
+++ b/t/t9102-git-svn-deep-rmdir.sh
@@ -9,12 +9,12 @@ test_expect_success 'initialize repo' "
 	mkdir -p deeply/nested/directory/number/2 &&
 	echo foo > deeply/nested/directory/number/1/file &&
 	echo foo > deeply/nested/directory/number/2/another &&
-	svn import -m 'import for git-svn' . $svnrepo &&
+	svn import -m 'import for git-svn' . '$svnrepo' &&
 	cd ..
 	"
 
 test_expect_success 'mirror via git-svn' "
-	git-svn init $svnrepo &&
+	git-svn init '$svnrepo' &&
 	git-svn fetch &&
 	git checkout -f -b test-rmdir remotes/git-svn
 	"
@@ -23,7 +23,7 @@ test_expect_success 'Try a commit on rmdir' "
 	git rm -f deeply/nested/directory/number/2/another &&
 	git commit -a -m 'remove another' &&
 	git-svn set-tree --rmdir HEAD &&
-	svn ls -R $svnrepo | grep ^deeply/nested/directory/number/1
+	svn ls -R '$svnrepo' | grep ^deeply/nested/directory/number/1
 	"
 
 
diff --git a/t/t9104-git-svn-follow-parent.sh b/t/t9104-git-svn-follow-parent.sh
index 7ba7630..aa2bfe2 100755
--- a/t/t9104-git-svn-follow-parent.sh
+++ b/t/t9104-git-svn-follow-parent.sh
@@ -11,9 +11,9 @@ test_expect_success 'initialize repo' "
 	cd import &&
 	mkdir -p trunk &&
 	echo hello > trunk/readme &&
-	svn import -m 'initial' . $svnrepo &&
+	svn import -m 'initial' . '$svnrepo' &&
 	cd .. &&
-	svn co $svnrepo wc &&
+	svn co '$svnrepo' wc &&
 	cd wc &&
 	echo world >> trunk/readme &&
 	poke trunk/readme &&
@@ -27,7 +27,7 @@ test_expect_success 'initialize repo' "
 	"
 
 test_expect_success 'init and fetch a moved directory' "
-	git-svn init --minimize-url -i thunk $svnrepo/thunk &&
+	git-svn init --minimize-url -i thunk '$svnrepo/thunk' &&
 	git-svn fetch -i thunk &&
 	test \"\`git rev-parse --verify refs/remotes/thunk@2\`\" \
            = \"\`git rev-parse --verify refs/remotes/thunk~1\`\" &&
@@ -38,7 +38,7 @@ test_expect_success 'init and fetch a moved directory' "
 	"
 
 test_expect_success 'init and fetch from one svn-remote' "
-        git config svn-remote.svn.url $svnrepo &&
+        git config svn-remote.svn.url '$svnrepo' &&
         git config --add svn-remote.svn.fetch \
           trunk:refs/remotes/svn/trunk &&
         git config --add svn-remote.svn.fetch \
@@ -52,9 +52,9 @@ test_expect_success 'init and fetch from one svn-remote' "
 
 test_expect_success 'follow deleted parent' "
         (svn cp -m 'resurrecting trunk as junk' \
-               $svnrepo/trunk@2 $svnrepo/junk ||
+               '$svnrepo/trunk@2' '$svnrepo'/junk ||
          svn cp -m 'resurrecting trunk as junk' \
-               -r2 $svnrepo/trunk $svnrepo/junk) &&
+               -r2 '$svnrepo/trunk' '$svnrepo/junk') &&
         git config --add svn-remote.svn.fetch \
           junk:refs/remotes/svn/junk &&
         git-svn fetch -i svn/thunk &&
@@ -67,10 +67,10 @@ test_expect_success 'follow deleted parent' "
 test_expect_success 'follow larger parent' "
         mkdir -p import/trunk/thunk/bump/thud &&
         echo hi > import/trunk/thunk/bump/thud/file &&
-        svn import -m 'import a larger parent' import $svnrepo/larger-parent &&
-        svn cp -m 'hi' $svnrepo/larger-parent $svnrepo/another-larger &&
+        svn import -m 'import a larger parent' import '$svnrepo/larger-parent' &&
+        svn cp -m 'hi' '$svnrepo/larger-parent' '$svnrepo/another-larger' &&
         git-svn init --minimize-url -i larger \
-          $svnrepo/another-larger/trunk/thunk/bump/thud &&
+          '$svnrepo/another-larger/trunk/thunk/bump/thud' &&
         git-svn fetch -i larger &&
         git rev-parse --verify refs/remotes/larger &&
         git rev-parse --verify \
@@ -83,23 +83,23 @@ test_expect_success 'follow larger parent' "
         "
 
 test_expect_success 'follow higher-level parent' "
-        svn mkdir -m 'follow higher-level parent' $svnrepo/blob &&
-        svn co $svnrepo/blob blob &&
+        svn mkdir -m 'follow higher-level parent' '$svnrepo/blob' &&
+        svn co '$svnrepo/blob' blob &&
         cd blob &&
                 echo hi > hi &&
                 svn add hi &&
                 svn commit -m 'hihi' &&
                 cd ..
-        svn mkdir -m 'new glob at top level' $svnrepo/glob &&
-        svn mv -m 'move blob down a level' $svnrepo/blob $svnrepo/glob/blob &&
-        git-svn init --minimize-url -i blob $svnrepo/glob/blob &&
+        svn mkdir -m 'new glob at top level' '$svnrepo/glob' &&
+        svn mv -m 'move blob down a level' '$svnrepo/blob' '$svnrepo/glob/blob' &&
+        git-svn init --minimize-url -i blob '$svnrepo/glob/blob' &&
         git-svn fetch -i blob
         "
 
 test_expect_success 'follow deleted directory' "
-	svn mv -m 'bye!' $svnrepo/glob/blob/hi $svnrepo/glob/blob/bye &&
-	svn rm -m 'remove glob' $svnrepo/glob &&
-	git-svn init --minimize-url -i glob $svnrepo/glob &&
+	svn mv -m 'bye!' '$svnrepo/glob/blob/hi' '$svnrepo/glob/blob/bye' &&
+	svn rm -m 'remove glob' '$svnrepo/glob' &&
+	git-svn init --minimize-url -i glob '$svnrepo/glob' &&
 	git-svn fetch -i glob &&
 	test \"\`git cat-file blob refs/remotes/glob:blob/bye\`\" = hi &&
 	test \"\`git ls-tree refs/remotes/glob | wc -l \`\" -eq 1
@@ -118,9 +118,9 @@ test_expect_success 'follow-parent avoids deleting relevant info' "
 	  echo 'bad delete test 2' > \
 	   import/trunk/subversion/bindings/swig/perl/another-larger &&
 	cd import &&
-	  svn import -m 'r9270 test' . $svnrepo/r9270 &&
+	  svn import -m 'r9270 test' . '$svnrepo/r9270' &&
 	cd .. &&
-	svn co $svnrepo/r9270/trunk/subversion/bindings/swig/perl r9270 &&
+	svn co '$svnrepo/r9270/trunk/subversion/bindings/swig/perl' r9270 &&
 	cd r9270 &&
 	  svn mkdir native &&
 	  svn mv t native/t &&
@@ -130,7 +130,7 @@ test_expect_success 'follow-parent avoids deleting relevant info' "
 	  svn commit -m 'reorg test' &&
 	cd .. &&
 	git-svn init --minimize-url -i r9270-t \
-	  $svnrepo/r9270/trunk/subversion/bindings/swig/perl/native/t &&
+	  '$svnrepo/r9270/trunk/subversion/bindings/swig/perl/native/t' &&
 	git-svn fetch -i r9270-t &&
 	test \`git rev-list r9270-t | wc -l\` -eq 2 &&
 	test \"\`git ls-tree --name-only r9270-t~1\`\" = \
@@ -138,9 +138,9 @@ test_expect_success 'follow-parent avoids deleting relevant info' "
 	"
 
 test_expect_success "track initial change if it was only made to parent" "
-	svn cp -m 'wheee!' $svnrepo/r9270/trunk $svnrepo/r9270/drunk &&
+	svn cp -m 'wheee!' '$svnrepo/r9270/trunk' '$svnrepo/r9270/drunk' &&
 	git-svn init --minimize-url -i r9270-d \
-	  $svnrepo/r9270/drunk/subversion/bindings/swig/perl/native/t &&
+	  '$svnrepo/r9270/drunk/subversion/bindings/swig/perl/native/t' &&
 	git-svn fetch -i r9270-d &&
 	test \`git rev-list r9270-d | wc -l\` -eq 3 &&
 	test \"\`git ls-tree --name-only r9270-t\`\" = \
@@ -150,7 +150,7 @@ test_expect_success "track initial change if it was only made to parent" "
 	"
 
 test_expect_success "track multi-parent paths" "
-	svn cp -m 'resurrect /glob' $svnrepo/r9270 $svnrepo/glob &&
+	svn cp -m 'resurrect /glob' '$svnrepo/r9270' '$svnrepo/glob' &&
 	git-svn multi-fetch &&
 	test \`git cat-file commit refs/remotes/glob | \
 	       grep '^parent ' | wc -l\` -eq 2
@@ -161,8 +161,8 @@ test_expect_success "multi-fetch continues to work" "
 	"
 
 test_expect_success "multi-fetch works off a 'clean' repository" "
-	rm -r $GIT_DIR/svn $GIT_DIR/refs/remotes $GIT_DIR/logs &&
-	mkdir $GIT_DIR/svn &&
+	rm -r '$GIT_DIR/svn' '$GIT_DIR/refs/remotes' '$GIT_DIR/logs' &&
+	mkdir '$GIT_DIR/svn' &&
 	git-svn multi-fetch
 	"
 
diff --git a/t/t9105-git-svn-commit-diff.sh b/t/t9105-git-svn-commit-diff.sh
index 318e172..2e1eb75 100755
--- a/t/t9105-git-svn-commit-diff.sh
+++ b/t/t9105-git-svn-commit-diff.sh
@@ -8,7 +8,7 @@ test_expect_success 'initialize repo' "
 	mkdir import &&
 	cd import &&
 	echo hello > readme &&
-	svn import -m 'initial' . $svnrepo &&
+	svn import -m 'initial' . '$svnrepo' &&
 	cd .. &&
 	echo hello > readme &&
 	git update-index --add readme &&
@@ -27,16 +27,16 @@ prev=`git rev-parse --verify HEAD^1`
 test_expect_success 'test the commit-diff command' "
 	test -n '$prev' && test -n '$head' &&
 	git-svn commit-diff -r1 '$prev' '$head' '$svnrepo' &&
-	svn co $svnrepo wc &&
+	svn co '$svnrepo' wc &&
 	cmp readme wc/readme
 	"
 
 test_expect_success 'commit-diff to a sub-directory (with git-svn config)' "
-	svn import -m 'sub-directory' import $svnrepo/subdir &&
-	git-svn init --minimize-url $svnrepo/subdir &&
+	svn import -m 'sub-directory' import '$svnrepo/subdir' &&
+	git-svn init --minimize-url '$svnrepo/subdir' &&
 	git-svn fetch &&
 	git-svn commit-diff -r3 '$prev' '$head' &&
-	svn cat $svnrepo/subdir/readme > readme.2 &&
+	svn cat '$svnrepo/subdir/readme' > readme.2 &&
 	cmp readme readme.2
 	"
 
diff --git a/t/t9106-git-svn-commit-diff-clobber.sh b/t/t9106-git-svn-commit-diff-clobber.sh
index 79b7968..bb42339 100755
--- a/t/t9106-git-svn-commit-diff-clobber.sh
+++ b/t/t9106-git-svn-commit-diff-clobber.sh
@@ -8,14 +8,14 @@ test_expect_success 'initialize repo' "
 	mkdir import &&
 	cd import &&
 	echo initial > file &&
-	svn import -m 'initial' . $svnrepo &&
+	svn import -m 'initial' . '$svnrepo' &&
 	cd .. &&
 	echo initial > file &&
 	git update-index --add file &&
 	git commit -a -m 'initial'
 	"
 test_expect_success 'commit change from svn side' "
-	svn co $svnrepo t.svn &&
+	svn co '$svnrepo' t.svn &&
 	cd t.svn &&
 	echo second line from svn >> file &&
 	poke file &&
@@ -27,7 +27,7 @@ test_expect_success 'commit change from svn side' "
 test_expect_failure 'commit conflicting change from git' "
 	echo second line from git >> file &&
 	git commit -a -m 'second line from git' &&
-	git-svn commit-diff -r1 HEAD~1 HEAD $svnrepo
+	git-svn commit-diff -r1 HEAD~1 HEAD '$svnrepo'
 	" || true
 
 test_expect_success 'commit complementing change from git' "
@@ -36,14 +36,14 @@ test_expect_success 'commit complementing change from git' "
 	git commit -a -m 'second line from svn' &&
 	echo third line from git >> file &&
 	git commit -a -m 'third line from git' &&
-	git-svn commit-diff -r2 HEAD~1 HEAD $svnrepo
+	git-svn commit-diff -r2 HEAD~1 HEAD '$svnrepo'
 	"
 
 test_expect_failure 'dcommit fails to commit because of conflict' "
-	git-svn init $svnrepo &&
+	git-svn init '$svnrepo' &&
 	git-svn fetch &&
 	git reset --hard refs/remotes/git-svn &&
-	svn co $svnrepo t.svn &&
+	svn co '$svnrepo' t.svn &&
 	cd t.svn &&
 	echo fourth line from svn >> file &&
 	poke file &&
@@ -67,7 +67,7 @@ test_expect_success 'dcommit does the svn equivalent of an index merge' "
 	"
 
 test_expect_success 'commit another change from svn side' "
-	svn co $svnrepo t.svn &&
+	svn co '$svnrepo' t.svn &&
 	cd t.svn &&
 		echo third line from svn >> file &&
 		poke file &&
diff --git a/t/t9107-git-svn-migrate.sh b/t/t9107-git-svn-migrate.sh
index 67fdf70..90bf786 100755
--- a/t/t9107-git-svn-migrate.sh
+++ b/t/t9107-git-svn-migrate.sh
@@ -4,7 +4,7 @@ test_description='git-svn metadata migrations from previous versions'
 . ./lib-git-svn.sh
 
 test_expect_success 'setup old-looking metadata' "
-	cp $GIT_DIR/config $GIT_DIR/config-old-git-svn &&
+	cp '$GIT_DIR/config' '$GIT_DIR/config-old-git-svn' &&
 	mkdir import &&
 	cd import &&
 		for i in trunk branches/a branches/b \
@@ -12,13 +12,13 @@ test_expect_success 'setup old-looking metadata' "
 			mkdir -p \$i && \
 			echo hello >> \$i/README || exit 1
 		done && \
-		svn import -m test . $svnrepo
+		svn import -m test . '$svnrepo'
 		cd .. &&
-	git-svn init $svnrepo &&
+	git-svn init '$svnrepo' &&
 	git-svn fetch &&
-	mv $GIT_DIR/svn/* $GIT_DIR/ &&
-	mv $GIT_DIR/svn/.metadata $GIT_DIR/ &&
-	rmdir $GIT_DIR/svn &&
+	mv '$GIT_DIR'/svn/* '$GIT_DIR/' &&
+	mv '$GIT_DIR/svn/.metadata' '$GIT_DIR/' &&
+	rmdir '$GIT_DIR/svn' &&
 	git update-ref refs/heads/git-svn-HEAD refs/remotes/git-svn &&
 	git update-ref refs/heads/svn-HEAD refs/remotes/git-svn &&
 	git update-ref -d refs/remotes/git-svn refs/remotes/git-svn
@@ -28,20 +28,20 @@ head=`git rev-parse --verify refs/heads/git-svn-HEAD^0`
 test_expect_success 'git-svn-HEAD is a real HEAD' "test -n '$head'"
 
 test_expect_success 'initialize old-style (v0) git-svn layout' "
-	mkdir -p $GIT_DIR/git-svn/info $GIT_DIR/svn/info &&
-	echo $svnrepo > $GIT_DIR/git-svn/info/url &&
-	echo $svnrepo > $GIT_DIR/svn/info/url &&
+	mkdir -p '$GIT_DIR/git-svn/info' '$GIT_DIR/svn/info' &&
+	echo '$svnrepo' > '$GIT_DIR/git-svn/info/url' &&
+	echo '$svnrepo' > '$GIT_DIR/svn/info/url' &&
 	git-svn migrate &&
-	! test -d $GIT_DIR/git-svn &&
+	! test -d '$GIT_DIR/git-svn' &&
 	git rev-parse --verify refs/remotes/git-svn^0 &&
 	git rev-parse --verify refs/remotes/svn^0 &&
-	test \`git config --get svn-remote.svn.url\` = '$svnrepo' &&
+	test \"\`git config --get svn-remote.svn.url\`\" = \"$svnrepo\" &&
 	test \`git config --get svn-remote.svn.fetch\` = \
              ':refs/remotes/git-svn'
 	"
 
 test_expect_success 'initialize a multi-repository repo' "
-	git-svn init $svnrepo -T trunk -t tags -b branches &&
+	git-svn init '$svnrepo' -T trunk -t tags -b branches &&
 	git config --get-all svn-remote.svn.fetch > fetch.out &&
 	grep '^trunk:refs/remotes/trunk$' fetch.out &&
 	test -n \"\`git config --get svn-remote.svn.branches \
@@ -76,14 +76,14 @@ test_expect_success 'multi-fetch works on partial urls + paths' "
 test_expect_success 'migrate --minimize on old inited layout' "
 	git config --unset-all svn-remote.svn.fetch &&
 	git config --unset-all svn-remote.svn.url &&
-	rm -rf $GIT_DIR/svn &&
+	rm -rf '$GIT_DIR/svn' &&
 	for i in \`cat fetch.out\`; do
 		path=\`expr \$i : '\\([^:]*\\):.*$'\`
 		ref=\`expr \$i : '[^:]*:refs/remotes/\\(.*\\)$'\`
 		if test -z \"\$ref\"; then continue; fi
 		if test -n \"\$path\"; then path=\"/\$path\"; fi
-		( mkdir -p $GIT_DIR/svn/\$ref/info/ &&
-		echo $svnrepo\$path > $GIT_DIR/svn/\$ref/info/url ) || exit 1;
+		( mkdir -p '$GIT_DIR'/svn/\$ref/info/ &&
+		echo '$svnrepo'\$path > '$GIT_DIR'/svn/\$ref/info/url ) || exit 1;
 	done &&
 	git-svn migrate --minimize &&
 	test -z \"\`git config -l |grep -v '^svn-remote\.git-svn\.'\`\" &&
@@ -99,13 +99,13 @@ test_expect_success 'migrate --minimize on old inited layout' "
 
 test_expect_success  ".rev_db auto-converted to .rev_db.UUID" "
 	git-svn fetch -i trunk &&
-	expect=$GIT_DIR/svn/trunk/.rev_db.* &&
+	expect=\"\`find \"\$GIT_DIR\"/svn/trunk/ -name '.rev_db.*'\`\" &&
 	test -n \"\$expect\" &&
-	mv \$expect $GIT_DIR/svn/trunk/.rev_db &&
+	mv \"\$expect\" \"\$GIT_DIR\"/svn/trunk/.rev_db &&
 	git-svn fetch -i trunk &&
-	test -L $GIT_DIR/svn/trunk/.rev_db &&
-	test -f \$expect &&
-	cmp \$expect $GIT_DIR/svn/trunk/.rev_db
+	test -L \"\$GIT_DIR\"/svn/trunk/.rev_db &&
+	test -f \"\$expect\" &&
+	cmp \"\$expect\" \"\$GIT_DIR\"/svn/trunk/.rev_db
 	"
 
 test_done
diff --git a/t/t9108-git-svn-glob.sh b/t/t9108-git-svn-glob.sh
index db4344c..c6dc0ef 100755
--- a/t/t9108-git-svn-glob.sh
+++ b/t/t9108-git-svn-glob.sh
@@ -14,8 +14,8 @@ test_expect_success 'test refspec globbing' "
 	mkdir -p trunk/src/a trunk/src/b trunk/doc &&
 	echo 'hello world' > trunk/src/a/readme &&
 	echo 'goodbye world' > trunk/src/b/readme &&
-	svn import -m 'initial' trunk $svnrepo/trunk &&
-	svn co $svnrepo tmp &&
+	svn import -m 'initial' trunk '$svnrepo/trunk' &&
+	svn co '$svnrepo' tmp &&
 	cd tmp &&
 		mkdir branches tags &&
 		svn add branches tags &&
@@ -38,7 +38,7 @@ test_expect_success 'test refspec globbing' "
 		poke tags/end/src/b/readme &&
 		svn commit -m 'nothing to see here'
 		cd .. &&
-	git config --add svn-remote.svn.url $svnrepo &&
+	git config --add svn-remote.svn.url '$svnrepo' &&
 	git config --add svn-remote.svn.fetch \
 	                 'trunk/src/a:refs/remotes/trunk' &&
 	git config --add svn-remote.svn.branches \
@@ -60,7 +60,7 @@ echo nothing to see here >> expect.two
 cat expect.end >> expect.two
 
 test_expect_success 'test left-hand-side only globbing' "
-	git config --add svn-remote.two.url $svnrepo &&
+	git config --add svn-remote.two.url '$svnrepo' &&
 	git config --add svn-remote.two.fetch trunk:refs/remotes/two/trunk &&
 	git config --add svn-remote.two.branches \
 	                 'branches/*:refs/remotes/two/branches/*' &&
diff --git a/t/t9110-git-svn-use-svm-props.sh b/t/t9110-git-svn-use-svm-props.sh
index 6235af4..d4ab01f 100755
--- a/t/t9110-git-svn-use-svm-props.sh
+++ b/t/t9110-git-svn-use-svm-props.sh
@@ -8,11 +8,11 @@ test_description='git-svn useSvmProps test'
 . ./lib-git-svn.sh
 
 test_expect_success 'load svm repo' "
-	svnadmin load -q $rawsvnrepo < ../t9110/svm.dump &&
-	git-svn init --minimize-url -R arr -i bar $svnrepo/mirror/arr &&
-	git-svn init --minimize-url -R argh -i dir $svnrepo/mirror/argh &&
+	svnadmin load -q '$rawsvnrepo' < ../t9110/svm.dump &&
+	git-svn init --minimize-url -R arr -i bar '$svnrepo/mirror/arr' &&
+	git-svn init --minimize-url -R argh -i dir '$svnrepo/mirror/argh' &&
 	git-svn init --minimize-url -R argh -i e \
-	  $svnrepo/mirror/argh/a/b/c/d/e &&
+	  '$svnrepo/mirror/argh/a/b/c/d/e' &&
 	git config svn.useSvmProps true &&
 	git-svn fetch --all
 	"
diff --git a/t/t9111-git-svn-use-svnsync-props.sh b/t/t9111-git-svn-use-svnsync-props.sh
index ec7dedd..936f023 100755
--- a/t/t9111-git-svn-use-svnsync-props.sh
+++ b/t/t9111-git-svn-use-svnsync-props.sh
@@ -8,10 +8,10 @@ test_description='git-svn useSvnsyncProps test'
 . ./lib-git-svn.sh
 
 test_expect_success 'load svnsync repo' "
-	svnadmin load -q $rawsvnrepo < ../t9111/svnsync.dump &&
-	git-svn init --minimize-url -R arr -i bar $svnrepo/bar &&
-	git-svn init --minimize-url -R argh -i dir $svnrepo/dir &&
-	git-svn init --minimize-url -R argh -i e $svnrepo/dir/a/b/c/d/e &&
+	svnadmin load -q '$rawsvnrepo' < ../t9111/svnsync.dump &&
+	git-svn init --minimize-url -R arr -i bar '$svnrepo/bar' &&
+	git-svn init --minimize-url -R argh -i dir '$svnrepo/dir' &&
+	git-svn init --minimize-url -R argh -i e '$svnrepo/dir/a/b/c/d/e' &&
 	git config svn.useSvnsyncProps true &&
 	git-svn fetch --all
 	"
diff --git a/t/t9112-git-svn-md5less-file.sh b/t/t9112-git-svn-md5less-file.sh
index 08313bb..b095583 100755
--- a/t/t9112-git-svn-md5less-file.sh
+++ b/t/t9112-git-svn-md5less-file.sh
@@ -38,8 +38,8 @@ PROPS-END
 
 EOF
 
-test_expect_success 'load svn dumpfile' "svnadmin load $rawsvnrepo < dumpfile.svn"
+test_expect_success 'load svn dumpfile' "svnadmin load '$rawsvnrepo' < dumpfile.svn"
 
-test_expect_success 'initialize git-svn' "git-svn init $svnrepo"
+test_expect_success 'initialize git-svn' "git-svn init '$svnrepo'"
 test_expect_success 'fetch revisions from svn' 'git-svn fetch'
 test_done
diff --git a/t/t9113-git-svn-dcommit-new-file.sh b/t/t9113-git-svn-dcommit-new-file.sh
index 9ef0db9..0088c75 100755
--- a/t/t9113-git-svn-dcommit-new-file.sh
+++ b/t/t9113-git-svn-dcommit-new-file.sh
@@ -15,14 +15,14 @@ test_description='git-svn dcommit new files over svn:// test'
 
 start_svnserve () {
 	svnserve --listen-port $SVNSERVE_PORT \
-	         --root $rawsvnrepo \
+	         --root '$rawsvnrepo' \
 	         --listen-once \
 	         --listen-host 127.0.0.1 &
 }
 
 test_expect_success 'start tracking an empty repo' "
-	svn mkdir -m 'empty dir' $svnrepo/empty-dir &&
-	echo anon-access = write >> $rawsvnrepo/conf/svnserve.conf &&
+	svn mkdir -m 'empty dir' '$svnrepo/empty-dir' &&
+	echo anon-access = write >> '$rawsvnrepo/conf/svnserve.conf' &&
 	start_svnserve &&
 	git svn init svn://127.0.0.1:$SVNSERVE_PORT &&
 	git svn fetch
diff --git a/t/t9114-git-svn-dcommit-merge.sh b/t/t9114-git-svn-dcommit-merge.sh
index d6ca955..64ec7fd 100755
--- a/t/t9114-git-svn-dcommit-merge.sh
+++ b/t/t9114-git-svn-dcommit-merge.sh
@@ -35,7 +35,7 @@ EOF
 }
 
 test_expect_success 'setup svn repository' "
-	svn co $svnrepo mysvnwork &&
+	svn co '$svnrepo' mysvnwork &&
 	mkdir -p mysvnwork/trunk &&
 	cd mysvnwork &&
 		big_text_block >> trunk/README &&
@@ -45,7 +45,7 @@ test_expect_success 'setup svn repository' "
 	"
 
 test_expect_success 'setup git mirror and merge' "
-	git svn init $svnrepo -t tags -T trunk -b branches &&
+	git svn init '$svnrepo' -t tags -T trunk -b branches &&
 	git svn fetch &&
 	git checkout --track -b svn remotes/trunk &&
 	git checkout -b merge &&
diff --git a/t/t9115-git-svn-dcommit-funky-renames.sh b/t/t9115-git-svn-dcommit-funky-renames.sh
index 182299c..653578d 100755
--- a/t/t9115-git-svn-dcommit-funky-renames.sh
+++ b/t/t9115-git-svn-dcommit-funky-renames.sh
@@ -8,12 +8,12 @@ test_description='git-svn dcommit can commit renames of files with ugly names'
 . ./lib-git-svn.sh
 
 test_expect_success 'load repository with strange names' "
-	svnadmin load -q $rawsvnrepo < ../t9115/funky-names.dump &&
+	svnadmin load -q '$rawsvnrepo' < ../t9115/funky-names.dump &&
 	start_httpd
 	"
 
 test_expect_success 'init and fetch repository' "
-	git svn init $svnrepo &&
+	git svn init '$svnrepo' &&
 	git svn fetch &&
 	git reset --hard git-svn
 	"
diff --git a/t/t9116-git-svn-log.sh b/t/t9116-git-svn-log.sh
index 0d4e6b3..70c0c5f 100755
--- a/t/t9116-git-svn-log.sh
+++ b/t/t9116-git-svn-log.sh
@@ -14,9 +14,9 @@ test_expect_success 'setup repository and import' "
 			mkdir -p \$i && \
 			echo hello >> \$i/README || exit 1
 		done && \
-		svn import -m test . $svnrepo
+		svn import -m test . '$svnrepo'
 		cd .. &&
-	git-svn init $svnrepo -T trunk -b branches -t tags &&
+	git-svn init '$svnrepo' -T trunk -b branches -t tags &&
 	git-svn fetch &&
 	git reset --hard trunk &&
 	echo bye >> README &&
diff --git a/t/t9500-gitweb-standalone-no-errors.sh b/t/t9500-gitweb-standalone-no-errors.sh
index 642b836..b90e78c 100755
--- a/t/t9500-gitweb-standalone-no-errors.sh
+++ b/t/t9500-gitweb-standalone-no-errors.sh
@@ -45,13 +45,13 @@ gitweb_run () {
 	export QUERY_STRING=""$1""
 	export PATH_INFO=""$2""
 
-	export GITWEB_CONFIG=$(pwd)/gitweb_config.perl
+	export GITWEB_CONFIG="$(pwd)/gitweb_config.perl"
 
 	# some of git commands write to STDERR on error, but this is not
 	# written to web server logs, so we are not interested in that:
 	# we are interested only in properly formatted errors/warnings
 	rm -f gitweb.log &&
-	perl -- $(pwd)/../../gitweb/gitweb.perl \
+	perl -- "$(pwd)/../../gitweb/gitweb.perl" \
 		>/dev/null 2>gitweb.log &&
 	if grep -q -s "^[[]" gitweb.log >/dev/null; then false; else true; fi
 
diff --git a/t/test-lib.sh b/t/test-lib.sh
index cc1253c..a68415f 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -229,7 +229,7 @@ test_create_repo () {
 	repo="$1"
 	mkdir "$repo"
 	cd "$repo" || error "Cannot setup test environment"
-	"$GIT_EXEC_PATH/git" init --template=$GIT_EXEC_PATH/templates/blt/ >/dev/null 2>&1 ||
+	"$GIT_EXEC_PATH/git" init --template="$GIT_EXEC_PATH/templates/blt/" >/dev/null 2>&1 ||
 	error "cannot run git init -- have you built things yet?"
 	mv .git/hooks .git/hooks-disabled
 	cd "$owd"
-- 
1.5.3.1

^ permalink raw reply related

* [PATCH 3/3] Fix apostrophe quoting in tests
From: Jonathan del Strother @ 2007-10-15 13:13 UTC (permalink / raw)
  To: git; +Cc: Jonathan del Strother
In-Reply-To: <4711486B.1050301@op5.se>

From: Jonathan del Strother <jon.delStrother@bestbefore.tv>

Double-quoting all paths so the tests can be run from inside a directory named "Joe's git"

Signed-off-by: Jonathan del Strother <jon.delStrother@bestbefore.tv>
---
 t/t9100-git-svn-basic.sh                 |   54 +++++++++++++++---------------
 t/t9101-git-svn-props.sh                 |    6 ++--
 t/t9102-git-svn-deep-rmdir.sh            |    6 ++--
 t/t9104-git-svn-follow-parent.sh         |   50 ++++++++++++++--------------
 t/t9105-git-svn-commit-diff.sh           |   12 +++---
 t/t9106-git-svn-commit-diff-clobber.sh   |   14 ++++----
 t/t9107-git-svn-migrate.sh               |   28 ++++++++--------
 t/t9108-git-svn-glob.sh                  |    8 ++--
 t/t9110-git-svn-use-svm-props.sh         |    8 ++--
 t/t9111-git-svn-use-svnsync-props.sh     |    8 ++--
 t/t9112-git-svn-md5less-file.sh          |    4 +-
 t/t9113-git-svn-dcommit-new-file.sh      |    6 ++--
 t/t9114-git-svn-dcommit-merge.sh         |    4 +-
 t/t9115-git-svn-dcommit-funky-renames.sh |    4 +-
 t/t9116-git-svn-log.sh                   |    4 +-
 15 files changed, 108 insertions(+), 108 deletions(-)

diff --git a/t/t9100-git-svn-basic.sh b/t/t9100-git-svn-basic.sh
index c3585da..1d802a8 100755
--- a/t/t9100-git-svn-basic.sh
+++ b/t/t9100-git-svn-basic.sh
@@ -31,16 +31,16 @@ test_expect_success \
 	echo 'zzz' > bar/zzz &&
 	echo '#!/bin/sh' > exec.sh &&
 	chmod +x exec.sh &&
-	svn import -m 'import for git-svn' . '$svnrepo' >/dev/null &&
+	svn import -m 'import for git-svn' . \"$svnrepo\" >/dev/null &&
 	cd .. &&
 	rm -rf import &&
-	git-svn init '$svnrepo'"
+	git-svn init \"$svnrepo\""
 
 test_expect_success \
     'import an SVN revision into git' \
     'git-svn fetch'
 
-test_expect_success "checkout from svn" "svn co '$svnrepo' '$SVN_TREE'"
+test_expect_success "checkout from svn" "svn co \"$svnrepo\" \"$SVN_TREE\""
 
 name='try a deep --rmdir with a commit'
 test_expect_success "$name" "
@@ -51,8 +51,8 @@ test_expect_success "$name" "
 	git commit -m '$name' &&
 	git-svn set-tree --find-copies-harder --rmdir \
 		remotes/git-svn..mybranch &&
-	svn up '$SVN_TREE' &&
-	test -d '$SVN_TREE'/dir && test ! -d '$SVN_TREE'/dir/a"
+	svn up \"$SVN_TREE\" &&
+	test -d \"$SVN_TREE\"/dir && test ! -d \"$SVN_TREE\"/dir/a"
 
 
 name='detect node change from file to directory #1'
@@ -69,7 +69,7 @@ test_expect_failure "$name" "
 
 name='detect node change from directory to file #1'
 test_expect_failure "$name" "
-	rm -rf dir '$GIT_DIR'/index &&
+	rm -rf dir \"$GIT_DIR\"/index &&
 	git checkout -f -b mybranch2 remotes/git-svn &&
 	mv bar/zzz zzz &&
 	rm -rf bar &&
@@ -83,7 +83,7 @@ test_expect_failure "$name" "
 
 name='detect node change from file to directory #2'
 test_expect_failure "$name" "
-	rm -f '$GIT_DIR'/index &&
+	rm -f \"$GIT_DIR\"/index &&
 	git checkout -f -b mybranch3 remotes/git-svn &&
 	rm bar/zzz &&
 	git update-index --remove bar/zzz &&
@@ -97,7 +97,7 @@ test_expect_failure "$name" "
 
 name='detect node change from directory to file #2'
 test_expect_failure "$name" "
-	rm -f '$GIT_DIR'/index &&
+	rm -f \"$GIT_DIR\"/index &&
 	git checkout -f -b mybranch4 remotes/git-svn &&
 	rm -rf dir &&
 	git update-index --remove -- dir/file &&
@@ -111,15 +111,15 @@ test_expect_failure "$name" "
 
 name='remove executable bit from a file'
 test_expect_success "$name" "
-	rm -f '$GIT_DIR'/index &&
+	rm -f \"$GIT_DIR\"/index &&
 	git checkout -f -b mybranch5 remotes/git-svn &&
 	chmod -x exec.sh &&
 	git update-index exec.sh &&
 	git commit -m '$name' &&
 	git-svn set-tree --find-copies-harder --rmdir \
 		remotes/git-svn..mybranch5 &&
-	svn up '$SVN_TREE' &&
-	test ! -x '$SVN_TREE'/exec.sh"
+	svn up \"$SVN_TREE\" &&
+	test ! -x \"$SVN_TREE\"/exec.sh"
 
 
 name='add executable bit back file'
@@ -129,8 +129,8 @@ test_expect_success "$name" "
 	git commit -m '$name' &&
 	git-svn set-tree --find-copies-harder --rmdir \
 		remotes/git-svn..mybranch5 &&
-	svn up '$SVN_TREE' &&
-	test -x '$SVN_TREE'/exec.sh"
+	svn up \"$SVN_TREE\" &&
+	test -x \"$SVN_TREE\"/exec.sh"
 
 
 name='executable file becomes a symlink to bar/zzz (file)'
@@ -141,8 +141,8 @@ test_expect_success "$name" "
 	git commit -m '$name' &&
 	git-svn set-tree --find-copies-harder --rmdir \
 		remotes/git-svn..mybranch5 &&
-	svn up '$SVN_TREE' &&
-	test -L '$SVN_TREE'/exec.sh"
+	svn up \"$SVN_TREE\" &&
+	test -L \"$SVN_TREE\"/exec.sh"
 
 name='new symlink is added to a file that was also just made executable'
 
@@ -153,9 +153,9 @@ test_expect_success "$name" "
 	git commit -m '$name' &&
 	git-svn set-tree --find-copies-harder --rmdir \
 		remotes/git-svn..mybranch5 &&
-	svn up '$SVN_TREE' &&
-	test -x '$SVN_TREE'/bar/zzz &&
-	test -L '$SVN_TREE'/exec-2.sh"
+	svn up \"$SVN_TREE\" &&
+	test -x \"$SVN_TREE\"/bar/zzz &&
+	test -L \"$SVN_TREE\"/exec-2.sh"
 
 name='modify a symlink to become a file'
 test_expect_success "$name" "
@@ -166,10 +166,10 @@ test_expect_success "$name" "
 	git commit -m '$name' &&
 	git-svn set-tree --find-copies-harder --rmdir \
 		remotes/git-svn..mybranch5 &&
-	svn up '$SVN_TREE' &&
-	test -f '$SVN_TREE'/exec-2.sh &&
-	test ! -L '$SVN_TREE'/exec-2.sh &&
-	git diff help '$SVN_TREE/exec-2.sh'"
+	svn up \"$SVN_TREE\" &&
+	test -f \"$SVN_TREE\"/exec-2.sh &&
+	test ! -L \"$SVN_TREE\"/exec-2.sh &&
+	git diff help \"$SVN_TREE\"/exec-2.sh"
 
 if test "$have_utf8" = t
 then
@@ -190,7 +190,7 @@ name='test fetch functionality (svn => git) with alternate GIT_SVN_ID'
 GIT_SVN_ID=alt
 export GIT_SVN_ID
 test_expect_success "$name" \
-    "git-svn init '$svnrepo' && git-svn fetch &&
+    "git-svn init \"$svnrepo\" && git-svn fetch &&
      git rev-list --pretty=raw remotes/git-svn | grep ^tree | uniq > a &&
      git rev-list --pretty=raw remotes/alt | grep ^tree | uniq > b &&
      git diff a b"
@@ -220,16 +220,16 @@ test_expect_failure 'exit if remote refs are ambigious' "
         "
 
 test_expect_failure 'exit if init-ing a would clobber a URL' "
-        svnadmin create '${PWD}/svnrepo2' &&
-        svn mkdir -m 'mkdir bar' '${svnrepo}2/bar' &&
+        svnadmin create \"${PWD}/svnrepo2\" &&
+        svn mkdir -m 'mkdir bar' \"${svnrepo}2/bar\" &&
         git config --unset svn-remote.svn.fetch \
                                 '^bar:refs/remotes/git-svn$' &&
-        git-svn init '${svnrepo}2/bar'
+        git-svn init \"${svnrepo}2/bar\"
         "
 
 test_expect_success \
   'init allows us to connect to another directory in the same repo' "
-        git-svn init --minimize-url -i bar '$svnrepo/bar' &&
+        git-svn init --minimize-url -i bar \"$svnrepo/bar\" &&
         git config --get svn-remote.svn.fetch \
                               '^bar:refs/remotes/bar$' &&
         git config --get svn-remote.svn.fetch \
diff --git a/t/t9101-git-svn-props.sh b/t/t9101-git-svn-props.sh
index a1c85e0..e741bfe 100755
--- a/t/t9101-git-svn-props.sh
+++ b/t/t9101-git-svn-props.sh
@@ -52,7 +52,7 @@ EOF
 cd ..
 
 rm -rf import
-test_expect_success 'checkout working copy from svn' "svn co '$svnrepo' test_wc"
+test_expect_success 'checkout working copy from svn' "svn co \"$svnrepo\" test_wc"
 test_expect_success 'setup some commits to svn' \
 	'cd test_wc &&
 		echo Greetings >> kw.c &&
@@ -66,7 +66,7 @@ test_expect_success 'setup some commits to svn' \
 		svn commit -m "Propset Id" &&
 	cd ..'
 
-test_expect_success 'initialize git-svn' "git-svn init '$svnrepo'"
+test_expect_success 'initialize git-svn' "git-svn init \"$svnrepo\""
 test_expect_success 'fetch revisions from svn' 'git-svn fetch'
 
 name='test svn:keywords ignoring'
@@ -92,7 +92,7 @@ test_expect_success "propset CR on crlf files" \
 test_expect_success 'fetch and pull latest from svn and checkout a new wc' \
 	"git-svn fetch &&
 	 git pull . remotes/git-svn &&
-	 svn co '$svnrepo' new_wc"
+	 svn co \"$svnrepo\" new_wc"
 
 for i in crlf ne_crlf lf ne_lf cr ne_cr empty_cr empty_lf empty empty_crlf
 do
diff --git a/t/t9102-git-svn-deep-rmdir.sh b/t/t9102-git-svn-deep-rmdir.sh
index 99c8840..e3af319 100755
--- a/t/t9102-git-svn-deep-rmdir.sh
+++ b/t/t9102-git-svn-deep-rmdir.sh
@@ -9,12 +9,12 @@ test_expect_success 'initialize repo' "
 	mkdir -p deeply/nested/directory/number/2 &&
 	echo foo > deeply/nested/directory/number/1/file &&
 	echo foo > deeply/nested/directory/number/2/another &&
-	svn import -m 'import for git-svn' . '$svnrepo' &&
+	svn import -m 'import for git-svn' . \"$svnrepo\" &&
 	cd ..
 	"
 
 test_expect_success 'mirror via git-svn' "
-	git-svn init '$svnrepo' &&
+	git-svn init \"$svnrepo\" &&
 	git-svn fetch &&
 	git checkout -f -b test-rmdir remotes/git-svn
 	"
@@ -23,7 +23,7 @@ test_expect_success 'Try a commit on rmdir' "
 	git rm -f deeply/nested/directory/number/2/another &&
 	git commit -a -m 'remove another' &&
 	git-svn set-tree --rmdir HEAD &&
-	svn ls -R '$svnrepo' | grep ^deeply/nested/directory/number/1
+	svn ls -R \"$svnrepo\" | grep ^deeply/nested/directory/number/1
 	"
 
 
diff --git a/t/t9104-git-svn-follow-parent.sh b/t/t9104-git-svn-follow-parent.sh
index aa2bfe2..a422afa 100755
--- a/t/t9104-git-svn-follow-parent.sh
+++ b/t/t9104-git-svn-follow-parent.sh
@@ -11,9 +11,9 @@ test_expect_success 'initialize repo' "
 	cd import &&
 	mkdir -p trunk &&
 	echo hello > trunk/readme &&
-	svn import -m 'initial' . '$svnrepo' &&
+	svn import -m 'initial' . \"$svnrepo\" &&
 	cd .. &&
-	svn co '$svnrepo' wc &&
+	svn co \"$svnrepo\" wc &&
 	cd wc &&
 	echo world >> trunk/readme &&
 	poke trunk/readme &&
@@ -27,7 +27,7 @@ test_expect_success 'initialize repo' "
 	"
 
 test_expect_success 'init and fetch a moved directory' "
-	git-svn init --minimize-url -i thunk '$svnrepo/thunk' &&
+	git-svn init --minimize-url -i thunk \"$svnrepo/thunk\" &&
 	git-svn fetch -i thunk &&
 	test \"\`git rev-parse --verify refs/remotes/thunk@2\`\" \
            = \"\`git rev-parse --verify refs/remotes/thunk~1\`\" &&
@@ -38,7 +38,7 @@ test_expect_success 'init and fetch a moved directory' "
 	"
 
 test_expect_success 'init and fetch from one svn-remote' "
-        git config svn-remote.svn.url '$svnrepo' &&
+        git config svn-remote.svn.url \"$svnrepo\" &&
         git config --add svn-remote.svn.fetch \
           trunk:refs/remotes/svn/trunk &&
         git config --add svn-remote.svn.fetch \
@@ -52,9 +52,9 @@ test_expect_success 'init and fetch from one svn-remote' "
 
 test_expect_success 'follow deleted parent' "
         (svn cp -m 'resurrecting trunk as junk' \
-               '$svnrepo/trunk@2' '$svnrepo'/junk ||
+               \"$svnrepo/trunk@2\" \"$svnrepo\"/junk ||
          svn cp -m 'resurrecting trunk as junk' \
-               -r2 '$svnrepo/trunk' '$svnrepo/junk') &&
+               -r2 \"$svnrepo/trunk\" \"$svnrepo/junk\") &&
         git config --add svn-remote.svn.fetch \
           junk:refs/remotes/svn/junk &&
         git-svn fetch -i svn/thunk &&
@@ -67,10 +67,10 @@ test_expect_success 'follow deleted parent' "
 test_expect_success 'follow larger parent' "
         mkdir -p import/trunk/thunk/bump/thud &&
         echo hi > import/trunk/thunk/bump/thud/file &&
-        svn import -m 'import a larger parent' import '$svnrepo/larger-parent' &&
-        svn cp -m 'hi' '$svnrepo/larger-parent' '$svnrepo/another-larger' &&
+        svn import -m 'import a larger parent' import \"$svnrepo/larger-parent\" &&
+        svn cp -m 'hi' \"$svnrepo/larger-parent\" \"$svnrepo/another-larger\" &&
         git-svn init --minimize-url -i larger \
-          '$svnrepo/another-larger/trunk/thunk/bump/thud' &&
+          \"$svnrepo/another-larger/trunk/thunk/bump/thud\" &&
         git-svn fetch -i larger &&
         git rev-parse --verify refs/remotes/larger &&
         git rev-parse --verify \
@@ -83,23 +83,23 @@ test_expect_success 'follow larger parent' "
         "
 
 test_expect_success 'follow higher-level parent' "
-        svn mkdir -m 'follow higher-level parent' '$svnrepo/blob' &&
-        svn co '$svnrepo/blob' blob &&
+        svn mkdir -m 'follow higher-level parent' \"$svnrepo/blob\" &&
+        svn co \"$svnrepo/blob\" blob &&
         cd blob &&
                 echo hi > hi &&
                 svn add hi &&
                 svn commit -m 'hihi' &&
                 cd ..
-        svn mkdir -m 'new glob at top level' '$svnrepo/glob' &&
-        svn mv -m 'move blob down a level' '$svnrepo/blob' '$svnrepo/glob/blob' &&
-        git-svn init --minimize-url -i blob '$svnrepo/glob/blob' &&
+        svn mkdir -m 'new glob at top level' \"$svnrepo/glob\" &&
+        svn mv -m 'move blob down a level' \"$svnrepo/blob\" \"$svnrepo/glob/blob\" &&
+        git-svn init --minimize-url -i blob \"$svnrepo/glob/blob\" &&
         git-svn fetch -i blob
         "
 
 test_expect_success 'follow deleted directory' "
-	svn mv -m 'bye!' '$svnrepo/glob/blob/hi' '$svnrepo/glob/blob/bye' &&
-	svn rm -m 'remove glob' '$svnrepo/glob' &&
-	git-svn init --minimize-url -i glob '$svnrepo/glob' &&
+	svn mv -m 'bye!' \"$svnrepo/glob/blob/hi\" \"$svnrepo/glob/blob/bye\" &&
+	svn rm -m 'remove glob' \"$svnrepo/glob\" &&
+	git-svn init --minimize-url -i glob \"$svnrepo/glob\" &&
 	git-svn fetch -i glob &&
 	test \"\`git cat-file blob refs/remotes/glob:blob/bye\`\" = hi &&
 	test \"\`git ls-tree refs/remotes/glob | wc -l \`\" -eq 1
@@ -118,9 +118,9 @@ test_expect_success 'follow-parent avoids deleting relevant info' "
 	  echo 'bad delete test 2' > \
 	   import/trunk/subversion/bindings/swig/perl/another-larger &&
 	cd import &&
-	  svn import -m 'r9270 test' . '$svnrepo/r9270' &&
+	  svn import -m 'r9270 test' . \"$svnrepo/r9270\" &&
 	cd .. &&
-	svn co '$svnrepo/r9270/trunk/subversion/bindings/swig/perl' r9270 &&
+	svn co \"$svnrepo/r9270/trunk/subversion/bindings/swig/perl\" r9270 &&
 	cd r9270 &&
 	  svn mkdir native &&
 	  svn mv t native/t &&
@@ -130,7 +130,7 @@ test_expect_success 'follow-parent avoids deleting relevant info' "
 	  svn commit -m 'reorg test' &&
 	cd .. &&
 	git-svn init --minimize-url -i r9270-t \
-	  '$svnrepo/r9270/trunk/subversion/bindings/swig/perl/native/t' &&
+	  \"$svnrepo/r9270/trunk/subversion/bindings/swig/perl/native/t\" &&
 	git-svn fetch -i r9270-t &&
 	test \`git rev-list r9270-t | wc -l\` -eq 2 &&
 	test \"\`git ls-tree --name-only r9270-t~1\`\" = \
@@ -138,9 +138,9 @@ test_expect_success 'follow-parent avoids deleting relevant info' "
 	"
 
 test_expect_success "track initial change if it was only made to parent" "
-	svn cp -m 'wheee!' '$svnrepo/r9270/trunk' '$svnrepo/r9270/drunk' &&
+	svn cp -m 'wheee!' \"$svnrepo/r9270/trunk\" \"$svnrepo/r9270/drunk\" &&
 	git-svn init --minimize-url -i r9270-d \
-	  '$svnrepo/r9270/drunk/subversion/bindings/swig/perl/native/t' &&
+	  \"$svnrepo/r9270/drunk/subversion/bindings/swig/perl/native/t\" &&
 	git-svn fetch -i r9270-d &&
 	test \`git rev-list r9270-d | wc -l\` -eq 3 &&
 	test \"\`git ls-tree --name-only r9270-t\`\" = \
@@ -150,7 +150,7 @@ test_expect_success "track initial change if it was only made to parent" "
 	"
 
 test_expect_success "track multi-parent paths" "
-	svn cp -m 'resurrect /glob' '$svnrepo/r9270' '$svnrepo/glob' &&
+	svn cp -m 'resurrect /glob' \"$svnrepo/r9270\" \"$svnrepo/glob\" &&
 	git-svn multi-fetch &&
 	test \`git cat-file commit refs/remotes/glob | \
 	       grep '^parent ' | wc -l\` -eq 2
@@ -161,8 +161,8 @@ test_expect_success "multi-fetch continues to work" "
 	"
 
 test_expect_success "multi-fetch works off a 'clean' repository" "
-	rm -r '$GIT_DIR/svn' '$GIT_DIR/refs/remotes' '$GIT_DIR/logs' &&
-	mkdir '$GIT_DIR/svn' &&
+	rm -r \"$GIT_DIR/svn\" \"$GIT_DIR/refs/remotes\" \"$GIT_DIR/logs\" &&
+	mkdir \"$GIT_DIR/svn\" &&
 	git-svn multi-fetch
 	"
 
diff --git a/t/t9105-git-svn-commit-diff.sh b/t/t9105-git-svn-commit-diff.sh
index 2e1eb75..9cc38d3 100755
--- a/t/t9105-git-svn-commit-diff.sh
+++ b/t/t9105-git-svn-commit-diff.sh
@@ -8,7 +8,7 @@ test_expect_success 'initialize repo' "
 	mkdir import &&
 	cd import &&
 	echo hello > readme &&
-	svn import -m 'initial' . '$svnrepo' &&
+	svn import -m 'initial' . \"$svnrepo\" &&
 	cd .. &&
 	echo hello > readme &&
 	git update-index --add readme &&
@@ -26,17 +26,17 @@ prev=`git rev-parse --verify HEAD^1`
 
 test_expect_success 'test the commit-diff command' "
 	test -n '$prev' && test -n '$head' &&
-	git-svn commit-diff -r1 '$prev' '$head' '$svnrepo' &&
-	svn co '$svnrepo' wc &&
+	git-svn commit-diff -r1 '$prev' '$head' \"$svnrepo\" &&
+	svn co \"$svnrepo\" wc &&
 	cmp readme wc/readme
 	"
 
 test_expect_success 'commit-diff to a sub-directory (with git-svn config)' "
-	svn import -m 'sub-directory' import '$svnrepo/subdir' &&
-	git-svn init --minimize-url '$svnrepo/subdir' &&
+	svn import -m 'sub-directory' import \"$svnrepo/subdir\" &&
+	git-svn init --minimize-url \"$svnrepo/subdir\" &&
 	git-svn fetch &&
 	git-svn commit-diff -r3 '$prev' '$head' &&
-	svn cat '$svnrepo/subdir/readme' > readme.2 &&
+	svn cat \"$svnrepo/subdir/readme\" > readme.2 &&
 	cmp readme readme.2
 	"
 
diff --git a/t/t9106-git-svn-commit-diff-clobber.sh b/t/t9106-git-svn-commit-diff-clobber.sh
index bb42339..892ca55 100755
--- a/t/t9106-git-svn-commit-diff-clobber.sh
+++ b/t/t9106-git-svn-commit-diff-clobber.sh
@@ -8,14 +8,14 @@ test_expect_success 'initialize repo' "
 	mkdir import &&
 	cd import &&
 	echo initial > file &&
-	svn import -m 'initial' . '$svnrepo' &&
+	svn import -m 'initial' . \"$svnrepo\" &&
 	cd .. &&
 	echo initial > file &&
 	git update-index --add file &&
 	git commit -a -m 'initial'
 	"
 test_expect_success 'commit change from svn side' "
-	svn co '$svnrepo' t.svn &&
+	svn co \"$svnrepo\" t.svn &&
 	cd t.svn &&
 	echo second line from svn >> file &&
 	poke file &&
@@ -27,7 +27,7 @@ test_expect_success 'commit change from svn side' "
 test_expect_failure 'commit conflicting change from git' "
 	echo second line from git >> file &&
 	git commit -a -m 'second line from git' &&
-	git-svn commit-diff -r1 HEAD~1 HEAD '$svnrepo'
+	git-svn commit-diff -r1 HEAD~1 HEAD \"$svnrepo\"
 	" || true
 
 test_expect_success 'commit complementing change from git' "
@@ -36,14 +36,14 @@ test_expect_success 'commit complementing change from git' "
 	git commit -a -m 'second line from svn' &&
 	echo third line from git >> file &&
 	git commit -a -m 'third line from git' &&
-	git-svn commit-diff -r2 HEAD~1 HEAD '$svnrepo'
+	git-svn commit-diff -r2 HEAD~1 HEAD \"$svnrepo\"
 	"
 
 test_expect_failure 'dcommit fails to commit because of conflict' "
-	git-svn init '$svnrepo' &&
+	git-svn init \"$svnrepo\" &&
 	git-svn fetch &&
 	git reset --hard refs/remotes/git-svn &&
-	svn co '$svnrepo' t.svn &&
+	svn co \"$svnrepo\" t.svn &&
 	cd t.svn &&
 	echo fourth line from svn >> file &&
 	poke file &&
@@ -67,7 +67,7 @@ test_expect_success 'dcommit does the svn equivalent of an index merge' "
 	"
 
 test_expect_success 'commit another change from svn side' "
-	svn co '$svnrepo' t.svn &&
+	svn co \"$svnrepo\" t.svn &&
 	cd t.svn &&
 		echo third line from svn >> file &&
 		poke file &&
diff --git a/t/t9107-git-svn-migrate.sh b/t/t9107-git-svn-migrate.sh
index 90bf786..59e8f0d 100755
--- a/t/t9107-git-svn-migrate.sh
+++ b/t/t9107-git-svn-migrate.sh
@@ -4,7 +4,7 @@ test_description='git-svn metadata migrations from previous versions'
 . ./lib-git-svn.sh
 
 test_expect_success 'setup old-looking metadata' "
-	cp '$GIT_DIR/config' '$GIT_DIR/config-old-git-svn' &&
+	cp \"$GIT_DIR/config\" \"$GIT_DIR/config-old-git-svn\" &&
 	mkdir import &&
 	cd import &&
 		for i in trunk branches/a branches/b \
@@ -12,13 +12,13 @@ test_expect_success 'setup old-looking metadata' "
 			mkdir -p \$i && \
 			echo hello >> \$i/README || exit 1
 		done && \
-		svn import -m test . '$svnrepo'
+		svn import -m test . \"$svnrepo\"
 		cd .. &&
-	git-svn init '$svnrepo' &&
+	git-svn init \"$svnrepo\" &&
 	git-svn fetch &&
-	mv '$GIT_DIR'/svn/* '$GIT_DIR/' &&
-	mv '$GIT_DIR/svn/.metadata' '$GIT_DIR/' &&
-	rmdir '$GIT_DIR/svn' &&
+	mv \"$GIT_DIR\"/svn/* \"$GIT_DIR/\" &&
+	mv \"$GIT_DIR/svn/.metadata\" \"$GIT_DIR/\" &&
+	rmdir \"$GIT_DIR/svn\" &&
 	git update-ref refs/heads/git-svn-HEAD refs/remotes/git-svn &&
 	git update-ref refs/heads/svn-HEAD refs/remotes/git-svn &&
 	git update-ref -d refs/remotes/git-svn refs/remotes/git-svn
@@ -28,11 +28,11 @@ head=`git rev-parse --verify refs/heads/git-svn-HEAD^0`
 test_expect_success 'git-svn-HEAD is a real HEAD' "test -n '$head'"
 
 test_expect_success 'initialize old-style (v0) git-svn layout' "
-	mkdir -p '$GIT_DIR/git-svn/info' '$GIT_DIR/svn/info' &&
-	echo '$svnrepo' > '$GIT_DIR/git-svn/info/url' &&
-	echo '$svnrepo' > '$GIT_DIR/svn/info/url' &&
+	mkdir -p \"$GIT_DIR/git-svn/info\" \"$GIT_DIR/svn/info\" &&
+	echo \"$svnrepo\" > \"$GIT_DIR/git-svn/info/url\" &&
+	echo \"$svnrepo\" > \"$GIT_DIR/svn/info/url\" &&
 	git-svn migrate &&
-	! test -d '$GIT_DIR/git-svn' &&
+	! test -d \"$GIT_DIR/git-svn\" &&
 	git rev-parse --verify refs/remotes/git-svn^0 &&
 	git rev-parse --verify refs/remotes/svn^0 &&
 	test \"\`git config --get svn-remote.svn.url\`\" = \"$svnrepo\" &&
@@ -41,7 +41,7 @@ test_expect_success 'initialize old-style (v0) git-svn layout' "
 	"
 
 test_expect_success 'initialize a multi-repository repo' "
-	git-svn init '$svnrepo' -T trunk -t tags -b branches &&
+	git-svn init \"$svnrepo\" -T trunk -t tags -b branches &&
 	git config --get-all svn-remote.svn.fetch > fetch.out &&
 	grep '^trunk:refs/remotes/trunk$' fetch.out &&
 	test -n \"\`git config --get svn-remote.svn.branches \
@@ -76,14 +76,14 @@ test_expect_success 'multi-fetch works on partial urls + paths' "
 test_expect_success 'migrate --minimize on old inited layout' "
 	git config --unset-all svn-remote.svn.fetch &&
 	git config --unset-all svn-remote.svn.url &&
-	rm -rf '$GIT_DIR/svn' &&
+	rm -rf \"$GIT_DIR/svn\" &&
 	for i in \`cat fetch.out\`; do
 		path=\`expr \$i : '\\([^:]*\\):.*$'\`
 		ref=\`expr \$i : '[^:]*:refs/remotes/\\(.*\\)$'\`
 		if test -z \"\$ref\"; then continue; fi
 		if test -n \"\$path\"; then path=\"/\$path\"; fi
-		( mkdir -p '$GIT_DIR'/svn/\$ref/info/ &&
-		echo '$svnrepo'\$path > '$GIT_DIR'/svn/\$ref/info/url ) || exit 1;
+		( mkdir -p \"$GIT_DIR\"/svn/\$ref/info/ &&
+		echo \"$svnrepo\"\$path > \"$GIT_DIR\"/svn/\$ref/info/url ) || exit 1;
 	done &&
 	git-svn migrate --minimize &&
 	test -z \"\`git config -l |grep -v '^svn-remote\.git-svn\.'\`\" &&
diff --git a/t/t9108-git-svn-glob.sh b/t/t9108-git-svn-glob.sh
index c6dc0ef..eb039ef 100755
--- a/t/t9108-git-svn-glob.sh
+++ b/t/t9108-git-svn-glob.sh
@@ -14,8 +14,8 @@ test_expect_success 'test refspec globbing' "
 	mkdir -p trunk/src/a trunk/src/b trunk/doc &&
 	echo 'hello world' > trunk/src/a/readme &&
 	echo 'goodbye world' > trunk/src/b/readme &&
-	svn import -m 'initial' trunk '$svnrepo/trunk' &&
-	svn co '$svnrepo' tmp &&
+	svn import -m 'initial' trunk \"$svnrepo/trunk\" &&
+	svn co \"$svnrepo\" tmp &&
 	cd tmp &&
 		mkdir branches tags &&
 		svn add branches tags &&
@@ -38,7 +38,7 @@ test_expect_success 'test refspec globbing' "
 		poke tags/end/src/b/readme &&
 		svn commit -m 'nothing to see here'
 		cd .. &&
-	git config --add svn-remote.svn.url '$svnrepo' &&
+	git config --add svn-remote.svn.url \"$svnrepo\" &&
 	git config --add svn-remote.svn.fetch \
 	                 'trunk/src/a:refs/remotes/trunk' &&
 	git config --add svn-remote.svn.branches \
@@ -60,7 +60,7 @@ echo nothing to see here >> expect.two
 cat expect.end >> expect.two
 
 test_expect_success 'test left-hand-side only globbing' "
-	git config --add svn-remote.two.url '$svnrepo' &&
+	git config --add svn-remote.two.url \"$svnrepo\" &&
 	git config --add svn-remote.two.fetch trunk:refs/remotes/two/trunk &&
 	git config --add svn-remote.two.branches \
 	                 'branches/*:refs/remotes/two/branches/*' &&
diff --git a/t/t9110-git-svn-use-svm-props.sh b/t/t9110-git-svn-use-svm-props.sh
index d4ab01f..9df60ba 100755
--- a/t/t9110-git-svn-use-svm-props.sh
+++ b/t/t9110-git-svn-use-svm-props.sh
@@ -8,11 +8,11 @@ test_description='git-svn useSvmProps test'
 . ./lib-git-svn.sh
 
 test_expect_success 'load svm repo' "
-	svnadmin load -q '$rawsvnrepo' < ../t9110/svm.dump &&
-	git-svn init --minimize-url -R arr -i bar '$svnrepo/mirror/arr' &&
-	git-svn init --minimize-url -R argh -i dir '$svnrepo/mirror/argh' &&
+	svnadmin load -q \"$rawsvnrepo\" < ../t9110/svm.dump &&
+	git-svn init --minimize-url -R arr -i bar \"$svnrepo/mirror/arr\" &&
+	git-svn init --minimize-url -R argh -i dir \"$svnrepo/mirror/argh\" &&
 	git-svn init --minimize-url -R argh -i e \
-	  '$svnrepo/mirror/argh/a/b/c/d/e' &&
+	  \"$svnrepo/mirror/argh/a/b/c/d/e\" &&
 	git config svn.useSvmProps true &&
 	git-svn fetch --all
 	"
diff --git a/t/t9111-git-svn-use-svnsync-props.sh b/t/t9111-git-svn-use-svnsync-props.sh
index 936f023..e3693eb 100755
--- a/t/t9111-git-svn-use-svnsync-props.sh
+++ b/t/t9111-git-svn-use-svnsync-props.sh
@@ -8,10 +8,10 @@ test_description='git-svn useSvnsyncProps test'
 . ./lib-git-svn.sh
 
 test_expect_success 'load svnsync repo' "
-	svnadmin load -q '$rawsvnrepo' < ../t9111/svnsync.dump &&
-	git-svn init --minimize-url -R arr -i bar '$svnrepo/bar' &&
-	git-svn init --minimize-url -R argh -i dir '$svnrepo/dir' &&
-	git-svn init --minimize-url -R argh -i e '$svnrepo/dir/a/b/c/d/e' &&
+	svnadmin load -q \"$rawsvnrepo\" < ../t9111/svnsync.dump &&
+	git-svn init --minimize-url -R arr -i bar \"$svnrepo/bar\" &&
+	git-svn init --minimize-url -R argh -i dir \"$svnrepo/dir\" &&
+	git-svn init --minimize-url -R argh -i e \"$svnrepo/dir/a/b/c/d/e\" &&
 	git config svn.useSvnsyncProps true &&
 	git-svn fetch --all
 	"
diff --git a/t/t9112-git-svn-md5less-file.sh b/t/t9112-git-svn-md5less-file.sh
index b095583..124120c 100755
--- a/t/t9112-git-svn-md5less-file.sh
+++ b/t/t9112-git-svn-md5less-file.sh
@@ -38,8 +38,8 @@ PROPS-END
 
 EOF
 
-test_expect_success 'load svn dumpfile' "svnadmin load '$rawsvnrepo' < dumpfile.svn"
+test_expect_success 'load svn dumpfile' "svnadmin load \"$rawsvnrepo\" < dumpfile.svn"
 
-test_expect_success 'initialize git-svn' "git-svn init '$svnrepo'"
+test_expect_success 'initialize git-svn' "git-svn init \"$svnrepo\""
 test_expect_success 'fetch revisions from svn' 'git-svn fetch'
 test_done
diff --git a/t/t9113-git-svn-dcommit-new-file.sh b/t/t9113-git-svn-dcommit-new-file.sh
index 0088c75..150d7f0 100755
--- a/t/t9113-git-svn-dcommit-new-file.sh
+++ b/t/t9113-git-svn-dcommit-new-file.sh
@@ -15,14 +15,14 @@ test_description='git-svn dcommit new files over svn:// test'
 
 start_svnserve () {
 	svnserve --listen-port $SVNSERVE_PORT \
-	         --root '$rawsvnrepo' \
+	         --root "$rawsvnrepo" \
 	         --listen-once \
 	         --listen-host 127.0.0.1 &
 }
 
 test_expect_success 'start tracking an empty repo' "
-	svn mkdir -m 'empty dir' '$svnrepo/empty-dir' &&
-	echo anon-access = write >> '$rawsvnrepo/conf/svnserve.conf' &&
+	svn mkdir -m 'empty dir' \"$svnrepo/empty-dir\" &&
+	echo anon-access = write >> \"$rawsvnrepo/conf/svnserve.conf\" &&
 	start_svnserve &&
 	git svn init svn://127.0.0.1:$SVNSERVE_PORT &&
 	git svn fetch
diff --git a/t/t9114-git-svn-dcommit-merge.sh b/t/t9114-git-svn-dcommit-merge.sh
index 64ec7fd..ffe8859 100755
--- a/t/t9114-git-svn-dcommit-merge.sh
+++ b/t/t9114-git-svn-dcommit-merge.sh
@@ -35,7 +35,7 @@ EOF
 }
 
 test_expect_success 'setup svn repository' "
-	svn co '$svnrepo' mysvnwork &&
+	svn co \"$svnrepo\" mysvnwork &&
 	mkdir -p mysvnwork/trunk &&
 	cd mysvnwork &&
 		big_text_block >> trunk/README &&
@@ -45,7 +45,7 @@ test_expect_success 'setup svn repository' "
 	"
 
 test_expect_success 'setup git mirror and merge' "
-	git svn init '$svnrepo' -t tags -T trunk -b branches &&
+	git svn init \"$svnrepo\" -t tags -T trunk -b branches &&
 	git svn fetch &&
 	git checkout --track -b svn remotes/trunk &&
 	git checkout -b merge &&
diff --git a/t/t9115-git-svn-dcommit-funky-renames.sh b/t/t9115-git-svn-dcommit-funky-renames.sh
index 653578d..0681ffa 100755
--- a/t/t9115-git-svn-dcommit-funky-renames.sh
+++ b/t/t9115-git-svn-dcommit-funky-renames.sh
@@ -8,12 +8,12 @@ test_description='git-svn dcommit can commit renames of files with ugly names'
 . ./lib-git-svn.sh
 
 test_expect_success 'load repository with strange names' "
-	svnadmin load -q '$rawsvnrepo' < ../t9115/funky-names.dump &&
+	svnadmin load -q \"$rawsvnrepo\" < ../t9115/funky-names.dump &&
 	start_httpd
 	"
 
 test_expect_success 'init and fetch repository' "
-	git svn init '$svnrepo' &&
+	git svn init \"$svnrepo\" &&
 	git svn fetch &&
 	git reset --hard git-svn
 	"
diff --git a/t/t9116-git-svn-log.sh b/t/t9116-git-svn-log.sh
index 70c0c5f..890b5f1 100755
--- a/t/t9116-git-svn-log.sh
+++ b/t/t9116-git-svn-log.sh
@@ -14,9 +14,9 @@ test_expect_success 'setup repository and import' "
 			mkdir -p \$i && \
 			echo hello >> \$i/README || exit 1
 		done && \
-		svn import -m test . '$svnrepo'
+		svn import -m test . \"$svnrepo\"
 		cd .. &&
-	git-svn init '$svnrepo' -T trunk -b branches -t tags &&
+	git-svn init \"$svnrepo\" -T trunk -b branches -t tags &&
 	git-svn fetch &&
 	git reset --hard trunk &&
 	echo bye >> README &&
-- 
1.5.3.1

^ permalink raw reply related

* [PATCH 1/3] Fixing path quoting in git-rebase
From: Jonathan del Strother @ 2007-10-15 13:13 UTC (permalink / raw)
  To: git; +Cc: Jonathan del Strother
In-Reply-To: <4711486B.1050301@op5.se>

From: Jonathan del Strother <jon.delStrother@bestbefore.tv>

git-rebase used to fail when run from a path with a space in.

Signed-off-by: Jonathan del Strother <jon.delStrother@bestbefore.tv>
---
 git-rebase.sh |   26 +++++++++++++-------------
 1 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/git-rebase.sh b/git-rebase.sh
index 1583402..9995d9d 100755
--- a/git-rebase.sh
+++ b/git-rebase.sh
@@ -59,7 +59,7 @@ continue_merge () {
 		die "$RESOLVEMSG"
 	fi
 
-	cmt=`cat $dotest/current`
+	cmt=`cat "$dotest/current"`
 	if ! git diff-index --quiet HEAD
 	then
 		if ! git-commit -C "$cmt"
@@ -84,14 +84,14 @@ continue_merge () {
 }
 
 call_merge () {
-	cmt="$(cat $dotest/cmt.$1)"
+	cmt="$(cat "$dotest/cmt.$1")"
 	echo "$cmt" > "$dotest/current"
 	hd=$(git rev-parse --verify HEAD)
 	cmt_name=$(git symbolic-ref HEAD)
-	msgnum=$(cat $dotest/msgnum)
-	end=$(cat $dotest/end)
+	msgnum=$(cat "$dotest/msgnum")
+	end=$(cat "$dotest/end")
 	eval GITHEAD_$cmt='"${cmt_name##refs/heads/}~$(($end - $msgnum))"'
-	eval GITHEAD_$hd='"$(cat $dotest/onto_name)"'
+	eval GITHEAD_$hd='"$(cat \"$dotest/onto_name\")"'
 	export GITHEAD_$cmt GITHEAD_$hd
 	git-merge-$strategy "$cmt^" -- "$hd" "$cmt"
 	rv=$?
@@ -140,10 +140,10 @@ do
 		}
 		if test -d "$dotest"
 		then
-			prev_head="`cat $dotest/prev_head`"
-			end="`cat $dotest/end`"
-			msgnum="`cat $dotest/msgnum`"
-			onto="`cat $dotest/onto`"
+			prev_head=$(cat "$dotest/prev_head")
+			end=$(cat "$dotest/end")
+			msgnum=$(cat "$dotest/msgnum")
+			onto=$(cat "$dotest/onto")
 			continue_merge
 			while test "$msgnum" -le "$end"
 			do
@@ -160,11 +160,11 @@ do
 		if test -d "$dotest"
 		then
 			git rerere clear
-			prev_head="`cat $dotest/prev_head`"
-			end="`cat $dotest/end`"
-			msgnum="`cat $dotest/msgnum`"
+			prev_head=$(cat "$dotest/prev_head")
+			end=$(cat "$dotest/end")
+			msgnum=$(cat "$dotest/msgnum")
 			msgnum=$(($msgnum + 1))
-			onto="`cat $dotest/onto`"
+			onto=$(cat "$dotest/onto")
 			while test "$msgnum" -le "$end"
 			do
 				call_merge "$msgnum"
-- 
1.5.3.1

^ permalink raw reply related

* Re: [PATCH] Fixing path quoting issues
From: Jonathan del Strother @ 2007-10-15 13:13 UTC (permalink / raw)
  To: git
In-Reply-To: <4711486B.1050301@op5.se>


OK, second attempt at this.  First patch fixes quoting in git rebase.  Second patch allows you to run tests from a path with a space in.  The third allows you to run tests from a path with an apostrophe in (and is where things start to get a bit ugly, hence the separate patch).

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox