Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide a method to write a tree to an archive #421

Merged
merged 1 commit into from
Sep 8, 2014

Conversation

carlosmn
Copy link
Member

@carlosmn carlosmn commented Sep 5, 2014

Add Repository.write_archive() to write a given tree to an archive. As
there are many customisation options, we only provide a method to write
to an archive which is created by the user.

Off of #358 this provides a standard way of writing some data into a tarfile, giving the user control over the interesting parts while doing the boring loop. I added the timestamp as a way to provide a timestamp from e.g. a commit when writing a subtree (and thus cannot pass the commit as the treeish), but I don't think we should add much more, since the point of this is to do whatever git does and provide a starting point if someone wants to write stuff in a custom way.

There may be a way to perform one less copy when reading from the object, as IIRC this was written before we had a memoryview into blobs, but this should be good enough for now.

@carlosmn carlosmn force-pushed the archive branch 4 times, most recently from fa1c138 to d8c9840 Compare September 6, 2014 13:32
Add Repository.write_archive() to write a given tree to an archive. As
there are many customisation options, we only provide a method to write
to an archive which is created by the user.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants