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

Support creating hard links #301 #310

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open

Conversation

dxlr8r
Copy link

@dxlr8r dxlr8r commented Jun 10, 2023

@jacebrowning
Copy link
Owner

Thanks for putting this together!

For code coverage, please clone the existing test_ln* methods to make hard-link versions.

gitman/shell.py Outdated Show resolved Hide resolved
gitman/shell.py Outdated

# delete directories from target not present in source
for dir in target_dirs:
rm(dir)
Copy link
Owner

Choose a reason for hiding this comment

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

I'm trying to understand why all this code is required. Is just calling os.link(source, target) insufficient?

Copy link
Author

@dxlr8r dxlr8r Jun 11, 2023

Choose a reason for hiding this comment

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

It is not needed for the initial run, but will most likely be necessary on sequential runs.

Say your source repo has three files, a, b & c. On the initial run you will get links to a, b & c in your target directory.

Now let's say the author of the source repo adds file d and removes a, meaning files b, c & d are the content on the source. Without this extra code, you will however end up with a, b, c & d on the target, instead of b, c & d.

@dxlr8r
Copy link
Author

dxlr8r commented Jun 11, 2023

For code coverage, please clone the existing test_ln* methods to make hard-link versions.

That might take some time, as said before I'm not a Python developer; before this I had hardly done more than a hello world in Python.

Copy link
Author

@dxlr8r dxlr8r left a comment

Choose a reason for hiding this comment

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

Some basic testing, I request help/assistant if better testing is required

@dxlr8r
Copy link
Author

dxlr8r commented Jun 30, 2023

@jacebrowning please add a "help wanted" label. The code works, but I need help with the testing. The tests in GitHub does not pass, but it pass (make {check,test}) on my box (Debian 11 with Python 3.8 using pyenv). As I am not a Python programmer this is the limits of my knowledge and effort.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants