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

Support for partial updates #97

Open
why-not-try-calmer opened this issue Feb 2, 2023 · 2 comments
Open

Support for partial updates #97

why-not-try-calmer opened this issue Feb 2, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@why-not-try-calmer
Copy link

why-not-try-calmer commented Feb 2, 2023

Hi, thanks for this lovely GitHub action that I have already adopted professionnally. One important feature is lacking however: support for non-overwriting updates.

Currently the closest there is to what I mean is target-directory. That will let the user push to this directory only, leaving the rest of the target repository as-is.

The problem is that this is not fine-grained enough: the user might want to also leaves things under that directory as-is. In other words, this action currently makes the presupposition that the user will always be able to avoid overwriting all the files they want to leave untouched by nesting directories.

Notice that this presupposition does not sit well for many workflows -- typically those which want to increment a target directory, never destroying anything when destruction is not necessary (i.e. when the target repository does not include files with the same name as the file to push). For example, if the target directory is an html folder that you want to add pages to, you need to create arbitrary folders (one for each page I would imagine) and that does not fly.

The only way to support partial updates for good would be to implement a new option, i.e. push --soft, which checks out the target repository, commits and push without force-pushing if possible.

I can make a PR for this. But the main question is first: Would that be a welcome addition?

(A workaround could be to intercept the files pushe by this Github Action on some staging branch, and then commit again the files to their final destination, but it makes sense to consider this footwork a part of what this action could be improved with)

@cpina cpina added the enhancement New feature or request label Feb 15, 2023
@cpina
Copy link
Owner

cpina commented Feb 15, 2023

Sorry for the long time to answer. I'm happy the the action is useful for you!

Due to me being a bit short of time I'm trying to avoid adding features (to reduce maintenance, avoid support, writing docs, etc.). I think that in the upcoming months I will not have much time or head space to improve it besides the minimum maintenance.

In the last round of improvements I added section in the docs and I had thought of adding "tricks" or "recipes". Something along the lines of : https://cpina.github.io/push-to-another-repository-docs/faq.html#how-can-i-copy-only-some-files-only-some-directories-exclude-some-files-etc . If you think that could be done in a different step via rsync / cp I would be 100% happy to add an explanation in the FAQ (and perhaps rename FAQ to something better). I'd be happy to name the contributor as well of each recipe.

If it really needs to be done as part of the action: feel free to fork and send a PR with a reference to this issue and mention it here: it might help users to use it and I might consider merging (unlikely in short term for the reasons mentioned above).

@why-not-try-calmer
Copy link
Author

Sorry for the long time to answer. I'm happy the the action is useful for you!

Due to me being a bit short of time I'm trying to avoid adding features (to reduce maintenance, avoid support, writing docs, etc.). I think that in the upcoming months I will not have much time or head space to improve it besides the minimum maintenance.

In the last round of improvements I added section in the docs and I had thought of adding "tricks" or "recipes". Something along the lines of : https://cpina.github.io/push-to-another-repository-docs/faq.html#how-can-i-copy-only-some-files-only-some-directories-exclude-some-files-etc . If you think that could be done in a different step via rsync / cp I would be 100% happy to add an explanation in the FAQ (and perhaps rename FAQ to something better). I'd be happy to name the contributor as well of each recipe.

If it really needs to be done as part of the action: feel free to fork and send a PR with a reference to this issue and mention it here: it might help users to use it and I might consider merging (unlikely in short term for the reasons mentioned above).

Thanks for the thorough answer, I will ponder over it. Good stuff!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants