Closed
Description
I have a git repo that i'm using in a pretty roundabout way. Basically i have a repo/master
directory which stores a bunch of folders that have content in them. Then i have some repo/SECTION
folders. To identify where each piece of content goes, i symlink the directory to the section it belongs in. Calling git add
on the symlink directly adds the symlink, and not the content of the linked directory. After initializing the repo with GitPython calling repo.index.add('SECTION/DIR_SYMLINK')
results in all of the items from the folder being added as if DIR_SYMLINK were a folder, but does not add its folder. See git output below.
On branch master
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
new file: gal19/117a76a47d475c3e9866701d24302a45/image0000.jpg
new file: gal19/117a76a47d475c3e9866701d24302a45/image0001.png
...
new file: gal19/117a76a47d475c3e9866701d24302a45/image0035.jpg
new file: gal19/117a76a47d475c3e9866701d24302a45/image0036.jpg
new file: gal19/117a76a47d475c3e9866701d24302a45/index.html
new file: gal19/117a76a47d475c3e9866701d24302a45/info.json
Untracked files:
(use "git add <file>..." to include in what will be committed)
gal19/117a76a47d475c3e9866701d24302a45
After a git reset HEAD
and git add gal19/117a76a47d475c3e9866701d24302a45
this is the git status:
On branch master
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
new file: gal19/117a76a47d475c3e9866701d24302a45
Metadata
Metadata
Assignees
Type
Projects
Relationships
Development
No branches or pull requests
Activity
Byron commentedon Jun 26, 2015
I am able to reproduce the issue, and am working on a fix.
Byron commentedon Jun 26, 2015
Please feel free to try the latest master, which contains a fix for the issue at hand.
Thanks for letting me know, the issue description was very helpful indeed.
Byron commentedon Jun 26, 2015
You can watch the development stream on youtube.
GitPython #11 [issue 302 - fix adding symlinks to directories]
ben-en commentedon Jun 30, 2015
Hi Byron! Thanks for taking on this issue so quickly. Unfortunately this does not seem to resolve my issue. As you assumed, i am on the latest GitPython (now 0.3.6) and am on Python 3. As you also (correctly) assumed, the gal19 folder is a 'SECTION' and the random hash is the symlink to the directory. Now, with a fully committed git repo, i've manually added a symlink to a directory again. This time i've just used GitPython in the interactive python shell. Here are the commands and their responses:
As you can see in the last line, the same result has occurred as the original bug description. Below is the git status which illustrates this better.
I'm not sure what other information i could provide, but feel free to request anything you'd think would help!
Thanks again for taking the time to handle this issue.
Byron commentedon Jul 1, 2015
If you are using GitPython v0.3.6, you are not using the version that contains the fix. The latter is only to be found on github - if you grab the latest master, you should be fine indeed.
Would you try again and let me know ? Thank you
ben-en commentedon Jul 1, 2015
Oh thank you, i had thought i had managed to acquire the latest version from github. I am now on 1.0.1 and it works! Thank you very much :)