Git-Wrapper icon indicating copy to clipboard operation
Git-Wrapper copied to clipboard

Make clone more better

Open genehack opened this issue 13 years ago • 5 comments

So, based on this:

15:39 (genehack) how about something like: ->clone( $repo , [ $path | %options ]); 
15:39 * perigrin nods
15:39 (perigrin) that would work
15:39 (perigrin) $options{prefix} = /tmp 
15:39 (genehack) i'm trying to think if there's anything in '%options' other than root_dir 
15:39 (perigrin) would *certainly* solve my problem.
15:39 (genehack) or prefix
15:39 (perigrin) well there could be 
15:39 (perigrin) bare => 1
15:39 (perigrin) would set --bare
15:39 (perigrin) etc.
15:40 (genehack) right, i need to review what options 'clone' can take

also add a 'humanish' filter to turn foo/bar/baz.git into baz; make that the default $path when it's not given (just like git clone)

genehack avatar Feb 06 '12 20:02 genehack

Note that #29 maybe solves this too? (Well, the initial part, not the 'humanish' part or the default $path part)

/cc @perigrin

genehack avatar Feb 19 '13 05:02 genehack

So there is no way to do a clone with Git::Wrapper?

toddr avatar Mar 12 '20 06:03 toddr

@toddr No, calling ->clone() works just fine. This is about improving it, not that it doesn't work.

genehack avatar Mar 12 '20 14:03 genehack

I was thinking about:

my $g = Git::Wrapper->clone( { url => $url, dir => $repo_path, git_binary => $git_binary } )

toddr avatar Mar 12 '20 18:03 toddr

It's still an object method, not a class one:

my $gw = Git::Wrapper->new("/path/to/where/you/want/to/clone");
$gw->clone("repo:/clone/url");

genehack avatar Mar 17 '20 23:03 genehack