Adding LFS tracked files to index
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1.7k
- Forks
- 408
- Avg merge
- 2d 57m
- Merged PRs (30d)
- 7
Description
I'm writing a script to take snapshots from SVN URLs and add them to Git in a subfolder. Bringing LFS into the fold it seems like calling Repository.index.add_all isn't working quite right. The files that should be tracked seem to get put in to .git/lfs/objects as expected, but git lfs ls-files doesn't list any files. I changed this line of my code
repo.index.add_all([projectPath])
to this
check_call(["/usr/bin/git","add","--all",projectPath])
repo.index.read()
And that's fixed it, but I'd prefer to have the code self contained with library calls.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the snapshot flow using repo.index.add_all([projectPath]) and compare it with the shown git add --all command followed by repo.index.read(). Check the resulting index with git lfs ls-files; done means the library-only path records the LFS-tracked files equivalently.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- git, python
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100