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

This resolves #95 : Only symlink files that are tracked by git #100

Merged
merged 1 commit into from
May 16, 2014
Merged

This resolves #95 : Only symlink files that are tracked by git #100

merged 1 commit into from
May 16, 2014

Conversation

squaresurf
Copy link
Contributor

Besides adding a test for this feature, I also had to update some
existing tests slightly.

First I had to make sure that tests that modify their test repo, also
commit to that test repo. Otherwise the linking function wouldn't do
anything since git ignores files not added to the repo.

Secondly, I had to modify the 'fail when linking file with newline' test
to look for symlinks with double quotes since that is how they are
returned by git ls-files which brings up the point that we could now
support filenames with newlines in them. git ls-files wraps such
filenames in quotes like:

"subdir/filename_with\nnewline"

That being said I'm not sure of the usefulness of newlines in filenames.

Besides adding a test for this feature, I also had to update some
existing tests slightly.

First I had to make sure that tests that modify their test repo, also
commit to that test repo. Otherwise the linking function wouldn't do
anything since git ignores files not added to the repo.

Secondly, I had to modify the 'fail when linking file with newline' test
to look for symlinks with double quotes since that is how they are
returned by `git ls-files` which brings up the point that we could now
support filenames with newlines in them. `git ls-files` wraps such
filenames in quotes like:

"subdir/filename_with\nnewline"

That being said I'm not sure of the usefulness of newlines in filenames.
@andsens
Copy link
Owner

andsens commented May 14, 2014

Very nice! I'll have a look at it in the weekend.

andsens added a commit that referenced this pull request May 16, 2014
This resolves #95 : Only symlink files that are tracked by git
@andsens andsens merged commit 5df54e2 into andsens:development May 16, 2014
@andsens
Copy link
Owner

andsens commented May 16, 2014

I was thinking about rewriting your code later on at some point to simply run directly on the output of ls-files to reduce complexity - it would require the linking loop to have some kind of advanced mkdir -p that still respects the linking table, but then I started to think about #77 and how that would be implemented in that case.

Your approach is definitely the simplest and the one that is more readily extensible, especially because we could implement the filtering mechanism in get_repo_files.

@squaresurf
Copy link
Contributor Author

I'm glad it worked out. I was definitely thinking about #77 while I was coding this. Which issue(s) would you like to see done next?

@squaresurf squaresurf deleted the issue-95 branch May 16, 2014 15:07
@andsens
Copy link
Owner

andsens commented May 16, 2014

Which issue(s) would you like to see done next?

Heh, I like that question. Fixing #96 would definitely be helpful if we decide to implement some changes that break backwards compatibility.

@squaresurf
Copy link
Contributor Author

Sweet. I'll work on that next when I get some time. Not sure when that'll be exactly though. No worries if you get to it first.

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