Sync with the latest state of the remote repository (Pull) and tell me the changed parts.
Procedure
- Check the current location, branch, remote / upstream, and the valid configuration of
pull.rebase/branch.<name>.rebase/pull.ff. If the target is unclear, upstream is not set, or a merge / rebase / conflict resolution is in progress, stop without making changes. - Record the HEAD before pull with
git rev-parse HEAD, and withgit status --short、git diff、git diff --cached、git stash list --format=%Hrecord the OIDs of local changes, staged state, untracked files, and existing stashes. Untracked files are not considered protected by autostash. - Without changing the existing integration settings, run
git pull --autostashand record the exit code and output immediately after. If the method is unset and history has diverged, confirm and stop; do not automatically retry with another method. - Do not judge success by the exit code alone; check
git status、git diff --name-only --diff-filter=U, and verify the diff after execution and the stash OIDs. Separately verify completion of the integration process, absence of unresolved conflicts, and restoration of the local changes from before execution, and also report changes in staged state. Do not judge restoration by exact match of diff strings or changed paths alone; verify whether the recorded edits are preserved/reflected in the files after integration. If a new stash remains, changes are missing, or restoration cannot be confirmed, treat it as incomplete. - If there is a failure, conflict, or unconfirmed restoration, stop there. Report whether it stopped during integration or restoration, the in-progress state of merge / rebase, changes to HEAD, conflict paths, the OIDs of remaining stashes, and the next check. Do not re-apply or delete stashes, reset, abort, or re-pull without approval.
- After confirming both succeeded, obtain the HEAD after pull, and with
git log --oneline <before>..<after>とgit diff --stat <before> <after>/git diff <before> <after>summarize this operation's commits and file diffs. During rebase, rewritten local commits are also included in the range, so do not call all of them remote-originated. If HEAD is the same, report that there were no integrated changes.