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

fix: stg import --reject should create empty commit #472

Closed
wants to merge 1 commit into from

Conversation

dtor
Copy link
Contributor

@dtor dtor commented Jul 15, 2024

When trying to import a patch that does not apply cleanly, and using --reject option, stg should apply what it can, leave the rest in .rej files, and create an empty commit. The work to apply the patch is outsourced to "git apply --reject" which exits with status code 1 if patch is applied partially and it is treated as error by stg import.

Fix the issue by treating exit codes less than 128 from "git apply --reject" as success (128 signals hard error).

Also add a test case and fix up documentation for "stg import".

Closes: #471

When trying to import a patch that does not apply cleanly, and using
--reject option, stg should apply what it can, leave the rest in .rej
files, and create an empty commit. The work to apply the patch is
outsourced to "git apply --reject" which exits with status code 1 if
patch is applied partially and it is treated as error by stg import.

Fix the issue by treating exit codes less than 128 from "git apply
--reject" as success (128 signals hard error).

Also add a test case and fix up documentation for "stg import".

Closes: stacked-git#471

Signed-off-by: Dmitry Torokhov <dtor@google.com>
@dtor
Copy link
Contributor Author

dtor commented Jul 16, 2024

This does not agree with "stg fold --reject", I will have to rework this.

@dtor dtor closed this Jul 16, 2024
@dtor dtor deleted the stg-import-fix branch July 16, 2024 05:21
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.

"stg import --reject" is broken
1 participant