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

feat: Allow pulling translations from a commit hash #61

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

timmc-edx
Copy link

@timmc-edx timmc-edx commented Dec 20, 2024

By switching from clone to an explicit init+fetch we can get better control of what commits are fetched. clone only allows targeting a branch or a tag, but fetch can ask for any commit. The caveat is that the server needs to allow this via uploadpack.allowReachableSHA1InWant and similar.

Minor changes:

  • checkout is now also quiet by default

For testing, I entered the edx-platform repo and made calls like the following:

../openedx-atlas/atlas pull --revision=986a87b76532a95f2f9fd460cc3fb6bf7692a8f0 \
  translations/edx-platform/conf/locale:conf/locale \
  translations/studio-frontend/src/i18n/messages:conf/plugins-locale/studio-frontend

In between tests I cleared state with rm -rf conf/locale/ conf/plugins-locale/ translations_TEMP/; git checkout conf/.

I didn't check translations files directly, but I did use du -bs . to confirm that the published atlas and my patched version caused the same increase in total file size in the repo, which seemed like a good proxy.

By switching from clone to an explicit init+fetch we can get better control
of what commits are fetched. clone only allows targeting a branch or a
tag, but fetch can ask for any commit. The caveat is that the server needs
to allow this via `uploadpack.allowReachableSHA1InWant` and similar.

Minor changes:

- checkout is now also quiet by default

See openedx#48
Comment on lines +519 to +522
# The `remote.<name>.promisor` config override is needed for git 2.25 and possibly
# later versions (but not in 2.30 and later). In some earlier versions it might
# instead need to be written as `extensions.partialClone=origin` -- 2.25.1 mentions
# this in its output if a promisor is not set, but doesn't actually *use* that config.
Copy link
Author

Choose a reason for hiding this comment

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

Some info on this inconsistency: https://lore.kernel.org/git/[email protected]/T/

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