Repository navigation
Conversation
Port gitwatch's PULL_BEFORE_PUSH (-R): after committing and before pushing, fetch the current branch from the remote and rebase the local commits on top of it, so a remote that has moved ahead no longer breaks the push. Implemented with libgit2 instead of shelling out to git: fetch via the existing GitAuthenticator, then merge analysis deciding between up-to-date, fast-forward and rebase. A conflicting rebase is aborted, so the repository is never left in a rebasing state; the error propagates into the regular retry loop. Requires a remote, which is validated in AppConfig. Configurable via --pull-before-push or pull_before_push in gitwatch.yaml.
Owner
|
@oschrenk Sorry I've been inactive, thanks for the PRs! I will take a look at them this weekend, I promise :) |
Author
|
No stress. Pull requests are optional and patient. On 19. Nov 2026, at 04:11, Jan Möller ***@***.***> wrote:croissong left a comment (croissong/gitwatch-rs#90)
@oschrenk Sorry I've been inactive, thanks for the PRs! I will take a look at them this weekend, I promise :)
I can also add you as maintainer if you'd like.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: ***@***.***>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #78.
Ports the
-R(PULL_BEFORE_PUSH) option of the original gitwatch.sh. The flag name follows that option, not the--pull-rebasename from the issue.With
--pull-before-pushand a--remote, gitwatch fetches the current branch from the remote after each commit and before the push. It then fast-forwards, or rebases the local commits on top of the remote ones. This keeps the push working when the remote has moved ahead, such as when you edit the same repository on two machines.Usage
gitwatch watch --remote origin --pull-before-push .Or in
gitwatch.yaml:The option requires a remote.
Known limitations
pull --rebasebefore push? #78 asks for. In practice gitwatch commits all changes before the pull. If a tracked file that--ignore-regexexcludes has local edits, the rebase fails withunstaged changes exist in workdir.