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

git-annex: enable /media/ links #20

Merged
merged 1 commit into from
Nov 27, 2022
Merged

git-annex: enable /media/ links #20

merged 1 commit into from
Nov 27, 2022

Conversation

kousu
Copy link
Member

@kousu kousu commented Oct 27, 2022

Previously, Gitea's LFS support allowed direct-downloads of LFS content, via http://$HOSTNAME:$PORT/$USER/$REPO/media/branch/$BRANCH/$FILE This expands that grace to git-annex too.

This also includes corresponding UI changes, mostly to the output of view_file.tmpl. moved to #22

@kousu
Copy link
Member Author

kousu commented Oct 27, 2022

Besides just being good for completeness, this will be needed for my plan to integrate Cornerstone into Neurogitea.

@kousu
Copy link
Member Author

kousu commented Oct 27, 2022

@kousu kousu self-assigned this Oct 27, 2022
@gitea-sync gitea-sync bot force-pushed the git-annex branch 8 times, most recently from dea023b to ff1af59 Compare November 4, 2022 13:35
@gitea-sync gitea-sync bot force-pushed the git-annex branch 3 times, most recently from 2006f7b to 831fc98 Compare November 7, 2022 13:38
@kousu
Copy link
Member Author

kousu commented Nov 7, 2022

I've gotten the view template to render annex files:

Screenshot 2022-11-07 at 18-37-44 lfs-test

and made the "View Raw File" link there link to a path like http://HOSTNAME/$USER/$REPO/media/branch/main/sub-glen_acq-T1w_MTS.nii.gz.

I also made sure it can render text files; notice this is "Stored with git-annex" but still renders inline:

Screenshot 2022-11-07 at 18-39-18 lfs-test

I have yet to write tests.

I've also noticed another TODO: symlink-based annex files render as symlinks (obviously) and aren't detected as annex pointers:

Screenshot 2022-11-07 at 18-40-00 lfs-test

  • Patch annex.ReadPointer to handle symlinks; probably means adding a os.ReadLink() call

@gitea-sync gitea-sync bot force-pushed the git-annex branch 3 times, most recently from 03f1760 to 8905bf6 Compare November 10, 2022 13:43
@kousu kousu force-pushed the git-annex-media branch 3 times, most recently from b16d62f to 921890a Compare November 10, 2022 19:00
@gitea-sync gitea-sync bot force-pushed the git-annex branch 5 times, most recently from 7695e3d to eefb835 Compare November 15, 2022 13:30
@kousu
Copy link
Member Author

kousu commented Nov 15, 2022

Also, there's a way to test the templates, which might be useful; here's an example:

https://github.com/neuropoly/gitea/blob/0afe11d4b436163e8dcf6d5d54a22707d6d18563/tests/integration/repo_test.go#L22-L37

which seems to be based on https://pkg.go.dev/github.com/PuerkitoBio/goquery.

in particular, I want to test for:

  • view_file.tmpl renders "/media" and not "/raw" when used on annexed files
  • the index page does not render the symlink icon on a file that's an annex symlink

kousu added a commit that referenced this pull request Oct 19, 2023
Previously, Gitea's LFS support allowed direct-downloads of LFS content,
via http://$HOSTNAME:$PORT/$USER/$REPO/media/branch/$BRANCH/$FILE
Expand that grace to git-annex too. Now /media should provide the
relevant *content* from the .git/annex/objects/ folder.

This adds tests too. And expands the tests to try symlink-based annexing,
since /media implicitly supports both that and pointer-file-based annexing.
gitea-sync bot pushed a commit that referenced this pull request Oct 30, 2023
Previously, Gitea's LFS support allowed direct-downloads of LFS content,
via http://$HOSTNAME:$PORT/$USER/$REPO/media/branch/$BRANCH/$FILE
Expand that grace to git-annex too. Now /media should provide the
relevant *content* from the .git/annex/objects/ folder.

This adds tests too. And expands the tests to try symlink-based annexing,
since /media implicitly supports both that and pointer-file-based annexing.
gitea-sync bot pushed a commit that referenced this pull request Oct 31, 2023
Previously, Gitea's LFS support allowed direct-downloads of LFS content,
via http://$HOSTNAME:$PORT/$USER/$REPO/media/branch/$BRANCH/$FILE
Expand that grace to git-annex too. Now /media should provide the
relevant *content* from the .git/annex/objects/ folder.

This adds tests too. And expands the tests to try symlink-based annexing,
since /media implicitly supports both that and pointer-file-based annexing.
gitea-sync bot pushed a commit that referenced this pull request Nov 1, 2023
Previously, Gitea's LFS support allowed direct-downloads of LFS content,
via http://$HOSTNAME:$PORT/$USER/$REPO/media/branch/$BRANCH/$FILE
Expand that grace to git-annex too. Now /media should provide the
relevant *content* from the .git/annex/objects/ folder.

This adds tests too. And expands the tests to try symlink-based annexing,
since /media implicitly supports both that and pointer-file-based annexing.
gitea-sync bot pushed a commit that referenced this pull request Nov 2, 2023
Previously, Gitea's LFS support allowed direct-downloads of LFS content,
via http://$HOSTNAME:$PORT/$USER/$REPO/media/branch/$BRANCH/$FILE
Expand that grace to git-annex too. Now /media should provide the
relevant *content* from the .git/annex/objects/ folder.

This adds tests too. And expands the tests to try symlink-based annexing,
since /media implicitly supports both that and pointer-file-based annexing.
kousu added a commit that referenced this pull request Nov 4, 2023
Previously, Gitea's LFS support allowed direct-downloads of LFS content,
via http://$HOSTNAME:$PORT/$USER/$REPO/media/branch/$BRANCH/$FILE
Expand that grace to git-annex too. Now /media should provide the
relevant *content* from the .git/annex/objects/ folder.

This adds tests too. And expands the tests to try symlink-based annexing,
since /media implicitly supports both that and pointer-file-based annexing.
gitea-sync bot pushed a commit that referenced this pull request Nov 5, 2023
Previously, Gitea's LFS support allowed direct-downloads of LFS content,
via http://$HOSTNAME:$PORT/$USER/$REPO/media/branch/$BRANCH/$FILE
Expand that grace to git-annex too. Now /media should provide the
relevant *content* from the .git/annex/objects/ folder.

This adds tests too. And expands the tests to try symlink-based annexing,
since /media implicitly supports both that and pointer-file-based annexing.
gitea-sync bot pushed a commit that referenced this pull request Nov 6, 2023
Previously, Gitea's LFS support allowed direct-downloads of LFS content,
via http://$HOSTNAME:$PORT/$USER/$REPO/media/branch/$BRANCH/$FILE
Expand that grace to git-annex too. Now /media should provide the
relevant *content* from the .git/annex/objects/ folder.

This adds tests too. And expands the tests to try symlink-based annexing,
since /media implicitly supports both that and pointer-file-based annexing.
gitea-sync bot pushed a commit that referenced this pull request Nov 7, 2023
Previously, Gitea's LFS support allowed direct-downloads of LFS content,
via http://$HOSTNAME:$PORT/$USER/$REPO/media/branch/$BRANCH/$FILE
Expand that grace to git-annex too. Now /media should provide the
relevant *content* from the .git/annex/objects/ folder.

This adds tests too. And expands the tests to try symlink-based annexing,
since /media implicitly supports both that and pointer-file-based annexing.
gitea-sync bot pushed a commit that referenced this pull request Nov 8, 2023
Previously, Gitea's LFS support allowed direct-downloads of LFS content,
via http://$HOSTNAME:$PORT/$USER/$REPO/media/branch/$BRANCH/$FILE
Expand that grace to git-annex too. Now /media should provide the
relevant *content* from the .git/annex/objects/ folder.

This adds tests too. And expands the tests to try symlink-based annexing,
since /media implicitly supports both that and pointer-file-based annexing.
gitea-sync bot pushed a commit that referenced this pull request Nov 9, 2023
Previously, Gitea's LFS support allowed direct-downloads of LFS content,
via http://$HOSTNAME:$PORT/$USER/$REPO/media/branch/$BRANCH/$FILE
Expand that grace to git-annex too. Now /media should provide the
relevant *content* from the .git/annex/objects/ folder.

This adds tests too. And expands the tests to try symlink-based annexing,
since /media implicitly supports both that and pointer-file-based annexing.
gitea-sync bot pushed a commit that referenced this pull request Nov 10, 2023
Previously, Gitea's LFS support allowed direct-downloads of LFS content,
via http://$HOSTNAME:$PORT/$USER/$REPO/media/branch/$BRANCH/$FILE
Expand that grace to git-annex too. Now /media should provide the
relevant *content* from the .git/annex/objects/ folder.

This adds tests too. And expands the tests to try symlink-based annexing,
since /media implicitly supports both that and pointer-file-based annexing.
gitea-sync bot pushed a commit that referenced this pull request Nov 11, 2023
Previously, Gitea's LFS support allowed direct-downloads of LFS content,
via http://$HOSTNAME:$PORT/$USER/$REPO/media/branch/$BRANCH/$FILE
Expand that grace to git-annex too. Now /media should provide the
relevant *content* from the .git/annex/objects/ folder.

This adds tests too. And expands the tests to try symlink-based annexing,
since /media implicitly supports both that and pointer-file-based annexing.
gitea-sync bot pushed a commit that referenced this pull request Nov 12, 2023
Previously, Gitea's LFS support allowed direct-downloads of LFS content,
via http://$HOSTNAME:$PORT/$USER/$REPO/media/branch/$BRANCH/$FILE
Expand that grace to git-annex too. Now /media should provide the
relevant *content* from the .git/annex/objects/ folder.

This adds tests too. And expands the tests to try symlink-based annexing,
since /media implicitly supports both that and pointer-file-based annexing.
gitea-sync bot pushed a commit that referenced this pull request Nov 13, 2023
Previously, Gitea's LFS support allowed direct-downloads of LFS content,
via http://$HOSTNAME:$PORT/$USER/$REPO/media/branch/$BRANCH/$FILE
Expand that grace to git-annex too. Now /media should provide the
relevant *content* from the .git/annex/objects/ folder.

This adds tests too. And expands the tests to try symlink-based annexing,
since /media implicitly supports both that and pointer-file-based annexing.
gitea-sync bot pushed a commit that referenced this pull request Nov 14, 2023
Previously, Gitea's LFS support allowed direct-downloads of LFS content,
via http://$HOSTNAME:$PORT/$USER/$REPO/media/branch/$BRANCH/$FILE
Expand that grace to git-annex too. Now /media should provide the
relevant *content* from the .git/annex/objects/ folder.

This adds tests too. And expands the tests to try symlink-based annexing,
since /media implicitly supports both that and pointer-file-based annexing.
kousu added a commit that referenced this pull request Nov 20, 2023
Previously, Gitea's LFS support allowed direct-downloads of LFS content,
via http://$HOSTNAME:$PORT/$USER/$REPO/media/branch/$BRANCH/$FILE
Expand that grace to git-annex too. Now /media should provide the
relevant *content* from the .git/annex/objects/ folder.

This adds tests too. And expands the tests to try symlink-based annexing,
since /media implicitly supports both that and pointer-file-based annexing.
kousu added a commit that referenced this pull request Nov 29, 2023
Previously, Gitea's LFS support allowed direct-downloads of LFS content,
via http://$HOSTNAME:$PORT/$USER/$REPO/media/branch/$BRANCH/$FILE
Expand that grace to git-annex too. Now /media should provide the
relevant *content* from the .git/annex/objects/ folder.

This adds tests too. And expands the tests to try symlink-based annexing,
since /media implicitly supports both that and pointer-file-based annexing.
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.

1 participant