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

Pass --renormalize during git add to fix LFS usage in destination repo #301

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

Algomorph
Copy link

@Algomorph Algomorph commented Oct 16, 2024

- Allow the user to set enable_lfs = true as a parameter of regular git.origin (as opposed to only git.github_origin), thereby extending support to GitLab LFS origins (set to enable_lfs = false by default, so change is backwards-compatible to all existing workflows and compatible with non-lfs-enabled Git repositories).

  • Pass --renormalize during git add, which fixes LFS on the target repo (enabling coupling e.g. GitLab origins w/ LFS to GitHub destinations with LFS and similar user stories)

Fixes #277 and addresses #60 (comment)

Copy link

google-cla bot commented Oct 16, 2024

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

Copy link
Collaborator

@hsudhof hsudhof left a comment

Choose a reason for hiding this comment

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

This appears to be orthogonal to adding LFS, is there a strong reason to add the renormalize option in the same PR?

@hsudhof
Copy link
Collaborator

hsudhof commented Oct 16, 2024

TY! Left a comment - the CLA will prevent any imports until signed, sorry about that.

Algomorph and others added 3 commits October 16, 2024 16:57
- "false" by default
- value passed to call to GitOrigin.newGitOrigin, just like for github_origin
- allows for LFS usage with any Git backend that supports LFS, e.g. GitLab

Co-authored-by: Ashraful Islam <[email protected]>
- `renormalize` field is "false" by default
- sets `renormalize` field to true
- if `renormalize` is set to true, "--renormalize" argument is appended to the `git add` command.

Co-authored-by: Ashraful Islam <[email protected]>
- enables use of Git LFS in git destinations

Co-authored-by: Ashraful Islam <[email protected]>
@Algomorph
Copy link
Author

Algomorph commented Oct 16, 2024

@hsudhof I guess it doesn't have to be a single MR.

We were getting Copybara to work on this scenario:
GitLab w/ LFS --> GitHub w/ LFS

It required both of these changes to actually go through, but if you think they are orthogonal, I can make two separate MRs.
Re: CLA, we're waiting on the Corporate CLA to get accepted, so any of this might take a few days to get merged.

@Algomorph
Copy link
Author

@hsudhof I'll wait for your feedback before moving forward with separating this into two PRs.

@Algomorph
Copy link
Author

@hsudhof we removed the enabling of the lfs parameter from the current PR, we'll make a separate one for enabling LFS in non-GitHub origins after we're done with this one.

@Algomorph Algomorph changed the title Enable using non-GitHub LFS systems (e.g. GitLab LFS) in origins and destinations Pass --renormalize during git add to fix LFS usage in destination repo Nov 1, 2024
…neral option is used

Co-authored-by: Ashraful Islam <[email protected]>

- fix on very first (--force) revision
alternate.add().force().all().run();
}else{
alternate.add().force().renormalize().all().run();
}
Copy link
Author

Choose a reason for hiding this comment

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

We discovered that, on initial sync of a branch w/ --force flag usage in global options, adding --renormalize results in a situation where no new files are added to that initial destination commit. Hence the conditional. Perhaps this isn't the best design; if so, we request reviewer's input on what can be a better design.

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.

lfs support for git.destination
3 participants