← Back to team overview

dulwich-users team mailing list archive

Re: client.clone, repo.checkout and config core.filemode false

 

Hi Mark,

On Thu, Apr 04, 2013 at 01:55:07PM -0700, Mark Mikofski wrote:
> 1. There is no `client.clone(remote, local)` definition to clone a remote
> repository to a local disk, other than what's in bin/dulwich.py. (is there
> something already that does this somewhere else?) There is a repo.clone() def
> so I thought it might make sense to create a high level function that
> encapsulates what is in `cmd_clone()` in bin/dulwich.py already and also has
> the checkout function, `index.build_index_from_tree()` just like
> `repo.clone()` does. I can submit a patch if you think this is worthy.
I'm a bit wary about adding too much functionality onto Client.

Perhaps it's time to move some of the code in bin/dulwich into a command-layer
module?

> 2. I don't think `index.build_index_from_tree()` respect's the core.filemode
> config, which if set to false should not try to change file permissions.
index.build_index_from_tree() isn't really the right place to be dealing with
the configuration file; it's meant to just deal with index files,
not with the rest of the repo. Perhaps we can:

 - Add an optional honor_filemode=True argument to index.build_index_from_tree()
 - Have Repo.checkout() read the config and pass the right value
   to index.build_index_from_tree()

> 3. I am trying to clone and work on repositories on a fuse filesystem with the following settings:
> `rw, nosuid, nodev, relatime, user_id=XXXX, group_id=XXXX, default_permissions, allow_other 0 0`
> and when I try to use `index.build_index_from_tree()` I get an exception and system says "Operation not permitted". I get this same error if I try to use chmod from a command line even if I do use su.

> 
> 4. There is no `repo.checkout()` definition, although one could use index.build_index_from_tree as you suggest in issue #68 and as Charlies B's did in this SO answer [1]. ?I think it would be nice to have a `repo.checkout()` that does this since there is already the clone high level function. Or perhaps if you want to maintain dulwich as low-level, there could be a high level addon?
I like the idea of adding a Repo method that just builds the tree. There is
some code that does this already in Repo.clone() that you could factor out into
such a new method.  Can we call it something other than Repo.checkout() though?
The checkout command in git can do a variety of things, so naming a method
after it would be confusing.

Cheers,

Jelmer

> 
> 
> Thanks!
> Mark
> 
> [1] http://stackoverflow.com/a/12465185/1020470
> ?
> Thanks,
> Mark Mikofski
> poquitopicante.blogspot.com
> breakingbytes.blogspot.com
> www.breaking-bytes.com

> _______________________________________________
> Mailing list: https://launchpad.net/~dulwich-users
> Post to     : dulwich-users@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~dulwich-users
> More help   : https://help.launchpad.net/ListHelp


-- 


References