Skip to content

Add clone file on MacOS X (darwin). - #3745

Merged
bk2204 merged 1 commit into
git-lfs:masterfrom
kazuki-ma:clonefile
Aug 2, 2019
Merged

bk2204 merged 1 commit into
git-lfs:masterfrom
kazuki-ma:clonefile

Conversation

@kazuki-ma

Copy link
Copy Markdown
Contributor

@kazuki-ma
kazuki-ma force-pushed the clonefile branch 9 times, most recently from c6b9314 to 512ac7b Compare July 31, 2019 15:50

@bk2204 bk2204 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Congratulations on your first contribution to Git LFS! Overall, I think this looks good. There are a few minor issues I noted, and then this should be good to go, assuming it passes all the tests.

Comment thread tools/util_darwin.go Resolved
Comment thread tools/util_darwin_test.go Resolved
Comment thread tools/util_darwin_test.go Resolved
Comment thread tools/util_darwin_test.go Resolved
@kazuki-ma

Copy link
Copy Markdown
Contributor Author

Unn,, I have to reconsider my implementation because on Mac OS X, clonefile is possible only if destination is not exists, and argument is file name.

This is different in linux case. In linux, clone is done by file descriptor, so file should be already exists.

I noticed current implementation depends that writer destination file is not exists, but it is not normal state.

There are 3 possible solution,

  • Change signature of CloneFile to return new writer in case of writer replaced in cloning.
  • Remove destination file and recovery file descriptor alter clone finished.
    • This is not safe in case of function caller copy File instead of *File.
  • create new function CloneFileByName and use it in performance heavy position.

@kazuki-ma
kazuki-ma force-pushed the clonefile branch 5 times, most recently from 9b23c32 to b38193e Compare August 1, 2019 14:11

@bk2204 bk2204 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code you have looks great. I think we'll probably want to wire it up so that it can be used (so we can make sure the interface will work with our code).

@kazuki-ma
kazuki-ma marked this pull request as ready for review August 1, 2019 15:10
@kazuki-ma

Copy link
Copy Markdown
Contributor Author

@bk2204 Thank you for your feedback! Finally, I decide create new CloneFileByName as you see.

All comment addressed. Please review.

I'll implement dedup command.

kazuki-ma added a commit to kazuki-ma/git-lfs that referenced this pull request Aug 2, 2019
kazuki-ma added a commit to kazuki-ma/git-lfs that referenced this pull request Aug 2, 2019
kazuki-ma added a commit to kazuki-ma/git-lfs that referenced this pull request Aug 2, 2019
@bk2204
bk2204 merged commit 5cd4b80 into git-lfs:master Aug 2, 2019
@kazuki-ma
kazuki-ma deleted the clonefile branch September 1, 2019 05:51
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.

2 participants